diff options
| -rw-r--r-- | drivers/block/cciss.c | 23 | ||||
| -rw-r--r-- | drivers/block/cciss.h | 4 | ||||
| -rw-r--r-- | drivers/block/cciss_cmd.h | 2 | ||||
| -rw-r--r-- | drivers/block/floppy.c | 15 |
4 files changed, 24 insertions, 20 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 8e0f9256eb58..516d5bbec2b6 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
| @@ -238,9 +238,9 @@ static void set_performant_mode(ctlr_info_t *h, CommandList_struct *c) | |||
| 238 | /* | 238 | /* |
| 239 | * Enqueuing and dequeuing functions for cmdlists. | 239 | * Enqueuing and dequeuing functions for cmdlists. |
| 240 | */ | 240 | */ |
| 241 | static inline void addQ(struct hlist_head *list, CommandList_struct *c) | 241 | static inline void addQ(struct list_head *list, CommandList_struct *c) |
| 242 | { | 242 | { |
| 243 | hlist_add_head(&c->list, list); | 243 | list_add_tail(&c->list, list); |
| 244 | } | 244 | } |
| 245 | 245 | ||
| 246 | static inline void removeQ(CommandList_struct *c) | 246 | static inline void removeQ(CommandList_struct *c) |
| @@ -253,12 +253,12 @@ static inline void removeQ(CommandList_struct *c) | |||
| 253 | * them off as 'stale' to prevent the driver from | 253 | * them off as 'stale' to prevent the driver from |
| 254 | * falling over. | 254 | * falling over. |
| 255 | */ | 255 | */ |
| 256 | if (WARN_ON(hlist_unhashed(&c->list))) { | 256 | if (WARN_ON(list_empty(&c->list))) { |
| 257 | c->cmd_type = CMD_MSG_STALE; | 257 | c->cmd_type = CMD_MSG_STALE; |
| 258 | return; | 258 | return; |
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | hlist_del_init(&c->list); | 261 | list_del_init(&c->list); |
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | static void enqueue_cmd_and_start_io(ctlr_info_t *h, | 264 | static void enqueue_cmd_and_start_io(ctlr_info_t *h, |
| @@ -905,7 +905,7 @@ static CommandList_struct *cmd_alloc(ctlr_info_t *h) | |||
| 905 | 905 | ||
| 906 | c->cmdindex = i; | 906 | c->cmdindex = i; |
| 907 | 907 | ||
| 908 | INIT_HLIST_NODE(&c->list); | 908 | INIT_LIST_HEAD(&c->list); |
| 909 | c->busaddr = (__u32) cmd_dma_handle; | 909 | c->busaddr = (__u32) cmd_dma_handle; |
| 910 | temp64.val = (__u64) err_dma_handle; | 910 | temp64.val = (__u64) err_dma_handle; |
| 911 | c->ErrDesc.Addr.lower = temp64.val32.lower; | 911 | c->ErrDesc.Addr.lower = temp64.val32.lower; |
| @@ -944,7 +944,7 @@ static CommandList_struct *cmd_special_alloc(ctlr_info_t *h) | |||
| 944 | } | 944 | } |
| 945 | memset(c->err_info, 0, sizeof(ErrorInfo_struct)); | 945 | memset(c->err_info, 0, sizeof(ErrorInfo_struct)); |
| 946 | 946 | ||
| 947 | INIT_HLIST_NODE(&c->list); | 947 | INIT_LIST_HEAD(&c->list); |
| 948 | c->busaddr = (__u32) cmd_dma_handle; | 948 | c->busaddr = (__u32) cmd_dma_handle; |
| 949 | temp64.val = (__u64) err_dma_handle; | 949 | temp64.val = (__u64) err_dma_handle; |
| 950 | c->ErrDesc.Addr.lower = temp64.val32.lower; | 950 | c->ErrDesc.Addr.lower = temp64.val32.lower; |
| @@ -2888,8 +2888,8 @@ static void start_io(ctlr_info_t *h) | |||
| 2888 | { | 2888 | { |
| 2889 | CommandList_struct *c; | 2889 | CommandList_struct *c; |
| 2890 | 2890 | ||
| 2891 | while (!hlist_empty(&h->reqQ)) { | 2891 | while (!list_empty(&h->reqQ)) { |
| 2892 | c = hlist_entry(h->reqQ.first, CommandList_struct, list); | 2892 | c = list_entry(h->reqQ.next, CommandList_struct, list); |
| 2893 | /* can't do anything if fifo is full */ | 2893 | /* can't do anything if fifo is full */ |
| 2894 | if ((h->access.fifo_full(h))) { | 2894 | if ((h->access.fifo_full(h))) { |
| 2895 | dev_warn(&h->pdev->dev, "fifo full\n"); | 2895 | dev_warn(&h->pdev->dev, "fifo full\n"); |
| @@ -3402,11 +3402,10 @@ static inline u32 process_nonindexed_cmd(ctlr_info_t *h, u32 raw_tag) | |||
| 3402 | { | 3402 | { |
| 3403 | u32 tag; | 3403 | u32 tag; |
| 3404 | CommandList_struct *c = NULL; | 3404 | CommandList_struct *c = NULL; |
| 3405 | struct hlist_node *tmp; | ||
| 3406 | __u32 busaddr_masked, tag_masked; | 3405 | __u32 busaddr_masked, tag_masked; |
| 3407 | 3406 | ||
| 3408 | tag = cciss_tag_discard_error_bits(raw_tag); | 3407 | tag = cciss_tag_discard_error_bits(raw_tag); |
| 3409 | hlist_for_each_entry(c, tmp, &h->cmpQ, list) { | 3408 | list_for_each_entry(c, &h->cmpQ, list) { |
| 3410 | busaddr_masked = cciss_tag_discard_error_bits(c->busaddr); | 3409 | busaddr_masked = cciss_tag_discard_error_bits(c->busaddr); |
| 3411 | tag_masked = cciss_tag_discard_error_bits(tag); | 3410 | tag_masked = cciss_tag_discard_error_bits(tag); |
| 3412 | if (busaddr_masked == tag_masked) { | 3411 | if (busaddr_masked == tag_masked) { |
| @@ -4572,8 +4571,8 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, | |||
| 4572 | h = hba[i]; | 4571 | h = hba[i]; |
| 4573 | h->pdev = pdev; | 4572 | h->pdev = pdev; |
| 4574 | h->busy_initializing = 1; | 4573 | h->busy_initializing = 1; |
| 4575 | INIT_HLIST_HEAD(&h->cmpQ); | 4574 | INIT_LIST_HEAD(&h->cmpQ); |
| 4576 | INIT_HLIST_HEAD(&h->reqQ); | 4575 | INIT_LIST_HEAD(&h->reqQ); |
| 4577 | mutex_init(&h->busy_shutting_down); | 4576 | mutex_init(&h->busy_shutting_down); |
| 4578 | 4577 | ||
| 4579 | if (cciss_pci_init(h) != 0) | 4578 | if (cciss_pci_init(h) != 0) |
diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h index 4b8933d778f1..579f74918493 100644 --- a/drivers/block/cciss.h +++ b/drivers/block/cciss.h | |||
| @@ -103,8 +103,8 @@ struct ctlr_info | |||
| 103 | struct access_method access; | 103 | struct access_method access; |
| 104 | 104 | ||
| 105 | /* queue and queue Info */ | 105 | /* queue and queue Info */ |
| 106 | struct hlist_head reqQ; | 106 | struct list_head reqQ; |
| 107 | struct hlist_head cmpQ; | 107 | struct list_head cmpQ; |
| 108 | unsigned int Qdepth; | 108 | unsigned int Qdepth; |
| 109 | unsigned int maxQsinceinit; | 109 | unsigned int maxQsinceinit; |
| 110 | unsigned int maxSG; | 110 | unsigned int maxSG; |
diff --git a/drivers/block/cciss_cmd.h b/drivers/block/cciss_cmd.h index eb060f1b00b6..35463d2f0ee7 100644 --- a/drivers/block/cciss_cmd.h +++ b/drivers/block/cciss_cmd.h | |||
| @@ -195,7 +195,7 @@ typedef struct _CommandList_struct { | |||
| 195 | int ctlr; | 195 | int ctlr; |
| 196 | int cmd_type; | 196 | int cmd_type; |
| 197 | long cmdindex; | 197 | long cmdindex; |
| 198 | struct hlist_node list; | 198 | struct list_head list; |
| 199 | struct request * rq; | 199 | struct request * rq; |
| 200 | struct completion *waiting; | 200 | struct completion *waiting; |
| 201 | int retry_count; | 201 | int retry_count; |
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 25e4dffa0aad..b9ba04fc2b34 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
| @@ -597,6 +597,11 @@ static unsigned char fsector_t; /* sector in track */ | |||
| 597 | static unsigned char in_sector_offset; /* offset within physical sector, | 597 | static unsigned char in_sector_offset; /* offset within physical sector, |
| 598 | * expressed in units of 512 bytes */ | 598 | * expressed in units of 512 bytes */ |
| 599 | 599 | ||
| 600 | static inline bool drive_no_geom(int drive) | ||
| 601 | { | ||
| 602 | return !current_type[drive] && !ITYPE(UDRS->fd_device); | ||
| 603 | } | ||
| 604 | |||
| 600 | #ifndef fd_eject | 605 | #ifndef fd_eject |
| 601 | static inline int fd_eject(int drive) | 606 | static inline int fd_eject(int drive) |
| 602 | { | 607 | { |
| @@ -3782,7 +3787,7 @@ static int check_floppy_change(struct gendisk *disk) | |||
| 3782 | if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags) || | 3787 | if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags) || |
| 3783 | test_bit(FD_VERIFY_BIT, &UDRS->flags) || | 3788 | test_bit(FD_VERIFY_BIT, &UDRS->flags) || |
| 3784 | test_bit(drive, &fake_change) || | 3789 | test_bit(drive, &fake_change) || |
| 3785 | (!ITYPE(UDRS->fd_device) && !current_type[drive])) | 3790 | drive_no_geom(drive)) |
| 3786 | return 1; | 3791 | return 1; |
| 3787 | return 0; | 3792 | return 0; |
| 3788 | } | 3793 | } |
| @@ -3848,13 +3853,13 @@ static int __floppy_read_block_0(struct block_device *bdev) | |||
| 3848 | static int floppy_revalidate(struct gendisk *disk) | 3853 | static int floppy_revalidate(struct gendisk *disk) |
| 3849 | { | 3854 | { |
| 3850 | int drive = (long)disk->private_data; | 3855 | int drive = (long)disk->private_data; |
| 3851 | #define NO_GEOM (!current_type[drive] && !ITYPE(UDRS->fd_device)) | ||
| 3852 | int cf; | 3856 | int cf; |
| 3853 | int res = 0; | 3857 | int res = 0; |
| 3854 | 3858 | ||
| 3855 | if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags) || | 3859 | if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags) || |
| 3856 | test_bit(FD_VERIFY_BIT, &UDRS->flags) || | 3860 | test_bit(FD_VERIFY_BIT, &UDRS->flags) || |
| 3857 | test_bit(drive, &fake_change) || NO_GEOM) { | 3861 | test_bit(drive, &fake_change) || |
| 3862 | drive_no_geom(drive)) { | ||
| 3858 | if (WARN(atomic_read(&usage_count) == 0, | 3863 | if (WARN(atomic_read(&usage_count) == 0, |
| 3859 | "VFS: revalidate called on non-open device.\n")) | 3864 | "VFS: revalidate called on non-open device.\n")) |
| 3860 | return -EFAULT; | 3865 | return -EFAULT; |
| @@ -3862,7 +3867,7 @@ static int floppy_revalidate(struct gendisk *disk) | |||
| 3862 | lock_fdc(drive, false); | 3867 | lock_fdc(drive, false); |
| 3863 | cf = (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags) || | 3868 | cf = (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags) || |
| 3864 | test_bit(FD_VERIFY_BIT, &UDRS->flags)); | 3869 | test_bit(FD_VERIFY_BIT, &UDRS->flags)); |
| 3865 | if (!(cf || test_bit(drive, &fake_change) || NO_GEOM)) { | 3870 | if (!(cf || test_bit(drive, &fake_change) || drive_no_geom(drive))) { |
| 3866 | process_fd_request(); /*already done by another thread */ | 3871 | process_fd_request(); /*already done by another thread */ |
| 3867 | return 0; | 3872 | return 0; |
| 3868 | } | 3873 | } |
| @@ -3874,7 +3879,7 @@ static int floppy_revalidate(struct gendisk *disk) | |||
| 3874 | clear_bit(FD_DISK_CHANGED_BIT, &UDRS->flags); | 3879 | clear_bit(FD_DISK_CHANGED_BIT, &UDRS->flags); |
| 3875 | if (cf) | 3880 | if (cf) |
| 3876 | UDRS->generation++; | 3881 | UDRS->generation++; |
| 3877 | if (NO_GEOM) { | 3882 | if (drive_no_geom(drive)) { |
| 3878 | /* auto-sensing */ | 3883 | /* auto-sensing */ |
| 3879 | res = __floppy_read_block_0(opened_bdev[drive]); | 3884 | res = __floppy_read_block_0(opened_bdev[drive]); |
| 3880 | } else { | 3885 | } else { |
