X-Git-Url: http://bbs.cooldavid.org/git/?a=blobdiff_plain;f=drivers%2Fblock%2Fxd.c;h=4abd2bcd20fb8b069362e2684c8eed2dcd6a0620;hb=2a48fc0ab24241755dc93bfd4f01d68efab47f5a;hp=18a80ff57ce89f821fd3f5910a09207b7f5db605;hpb=7e125f7b9cbfce4101191b8076d606c517a73066;p=net-next-2.6.git diff --git a/drivers/block/xd.c b/drivers/block/xd.c index 18a80ff57ce..4abd2bcd20f 100644 --- a/drivers/block/xd.c +++ b/drivers/block/xd.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -57,6 +58,7 @@ #include "xd.h" +static DEFINE_MUTEX(xd_mutex); static void __init do_xd_setup (int *integers); #ifdef MODULE static int xd[5] = { -1,-1,-1,-1, }; @@ -133,7 +135,7 @@ static int xd_getgeo(struct block_device *bdev, struct hd_geometry *geo); static const struct block_device_operations xd_fops = { .owner = THIS_MODULE, - .locked_ioctl = xd_ioctl, + .ioctl = xd_ioctl, .getgeo = xd_getgeo, }; static DECLARE_WAIT_QUEUE_HEAD(xd_wait_int); @@ -322,7 +324,7 @@ static void do_xd_request (struct request_queue * q) int res = -EIO; int retry; - if (!blk_fs_request(req)) + if (req->cmd_type != REQ_TYPE_FS) goto done; if (block + count > get_capacity(req->rq_disk)) goto done; @@ -347,7 +349,7 @@ static int xd_getgeo(struct block_device *bdev, struct hd_geometry *geo) } /* xd_ioctl: handle device ioctl's */ -static int xd_ioctl(struct block_device *bdev, fmode_t mode, u_int cmd, u_long arg) +static int xd_locked_ioctl(struct block_device *bdev, fmode_t mode, u_int cmd, u_long arg) { switch (cmd) { case HDIO_SET_DMA: @@ -375,6 +377,18 @@ static int xd_ioctl(struct block_device *bdev, fmode_t mode, u_int cmd, u_long a } } +static int xd_ioctl(struct block_device *bdev, fmode_t mode, + unsigned int cmd, unsigned long param) +{ + int ret; + + mutex_lock(&xd_mutex); + ret = xd_locked_ioctl(bdev, mode, cmd, param); + mutex_unlock(&xd_mutex); + + return ret; +} + /* xd_readwrite: handle a read/write request */ static int xd_readwrite (u_char operation,XD_INFO *p,char *buffer,u_int block,u_int count) {