diff options
Diffstat (limited to 'drivers/block/xsysace.c')
-rw-r--r-- | drivers/block/xsysace.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c index a7b83c0a7eb5..b71888b909a0 100644 --- a/drivers/block/xsysace.c +++ b/drivers/block/xsysace.c | |||
@@ -89,6 +89,7 @@ | |||
89 | #include <linux/delay.h> | 89 | #include <linux/delay.h> |
90 | #include <linux/slab.h> | 90 | #include <linux/slab.h> |
91 | #include <linux/blkdev.h> | 91 | #include <linux/blkdev.h> |
92 | #include <linux/smp_lock.h> | ||
92 | #include <linux/ata.h> | 93 | #include <linux/ata.h> |
93 | #include <linux/hdreg.h> | 94 | #include <linux/hdreg.h> |
94 | #include <linux/platform_device.h> | 95 | #include <linux/platform_device.h> |
@@ -465,7 +466,7 @@ struct request *ace_get_next_request(struct request_queue * q) | |||
465 | struct request *req; | 466 | struct request *req; |
466 | 467 | ||
467 | while ((req = blk_peek_request(q)) != NULL) { | 468 | while ((req = blk_peek_request(q)) != NULL) { |
468 | if (blk_fs_request(req)) | 469 | if (req->cmd_type == REQ_TYPE_FS) |
469 | break; | 470 | break; |
470 | blk_start_request(req); | 471 | blk_start_request(req); |
471 | __blk_end_request_all(req, -EIO); | 472 | __blk_end_request_all(req, -EIO); |
@@ -901,11 +902,14 @@ static int ace_open(struct block_device *bdev, fmode_t mode) | |||
901 | 902 | ||
902 | dev_dbg(ace->dev, "ace_open() users=%i\n", ace->users + 1); | 903 | dev_dbg(ace->dev, "ace_open() users=%i\n", ace->users + 1); |
903 | 904 | ||
905 | lock_kernel(); | ||
904 | spin_lock_irqsave(&ace->lock, flags); | 906 | spin_lock_irqsave(&ace->lock, flags); |
905 | ace->users++; | 907 | ace->users++; |
906 | spin_unlock_irqrestore(&ace->lock, flags); | 908 | spin_unlock_irqrestore(&ace->lock, flags); |
907 | 909 | ||
908 | check_disk_change(bdev); | 910 | check_disk_change(bdev); |
911 | unlock_kernel(); | ||
912 | |||
909 | return 0; | 913 | return 0; |
910 | } | 914 | } |
911 | 915 | ||
@@ -917,6 +921,7 @@ static int ace_release(struct gendisk *disk, fmode_t mode) | |||
917 | 921 | ||
918 | dev_dbg(ace->dev, "ace_release() users=%i\n", ace->users - 1); | 922 | dev_dbg(ace->dev, "ace_release() users=%i\n", ace->users - 1); |
919 | 923 | ||
924 | lock_kernel(); | ||
920 | spin_lock_irqsave(&ace->lock, flags); | 925 | spin_lock_irqsave(&ace->lock, flags); |
921 | ace->users--; | 926 | ace->users--; |
922 | if (ace->users == 0) { | 927 | if (ace->users == 0) { |
@@ -924,6 +929,7 @@ static int ace_release(struct gendisk *disk, fmode_t mode) | |||
924 | ace_out(ace, ACE_CTRL, val & ~ACE_CTRL_LOCKREQ); | 929 | ace_out(ace, ACE_CTRL, val & ~ACE_CTRL_LOCKREQ); |
925 | } | 930 | } |
926 | spin_unlock_irqrestore(&ace->lock, flags); | 931 | spin_unlock_irqrestore(&ace->lock, flags); |
932 | unlock_kernel(); | ||
927 | return 0; | 933 | return 0; |
928 | } | 934 | } |
929 | 935 | ||