diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/Kconfig | 15 | ||||
-rw-r--r-- | drivers/block/aoe/aoeblk.c | 4 | ||||
-rw-r--r-- | drivers/block/floppy.c | 23 | ||||
-rw-r--r-- | drivers/block/loop.c | 4 | ||||
-rw-r--r-- | drivers/block/pktcdvd.c | 26 |
5 files changed, 39 insertions, 33 deletions
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig index e57ac5a43246..875ae7699025 100644 --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig | |||
@@ -400,13 +400,16 @@ config BLK_DEV_RAM_SIZE | |||
400 | 8192. | 400 | 8192. |
401 | 401 | ||
402 | config BLK_DEV_INITRD | 402 | config BLK_DEV_INITRD |
403 | bool "Initial RAM disk (initrd) support" | 403 | bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support" |
404 | help | 404 | help |
405 | The initial RAM disk is a RAM disk that is loaded by the boot loader | 405 | The initial RAM filesystem is a ramfs which is loaded by the |
406 | (loadlin or lilo) and that is mounted as root before the normal boot | 406 | boot loader (loadlin or lilo) and that is mounted as root |
407 | procedure. It is typically used to load modules needed to mount the | 407 | before the normal boot procedure. It is typically used to |
408 | "real" root file system, etc. See <file:Documentation/initrd.txt> | 408 | load modules needed to mount the "real" root file system, |
409 | for details. | 409 | etc. See <file:Documentation/initrd.txt> for details. |
410 | |||
411 | If RAM disk support (BLK_DEV_RAM) is also included, this | ||
412 | also enables initial RAM disk (initrd) support. | ||
410 | 413 | ||
411 | 414 | ||
412 | config CDROM_PKTCDVD | 415 | config CDROM_PKTCDVD |
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c index 32fea55fac48..393b86a3dbf8 100644 --- a/drivers/block/aoe/aoeblk.c +++ b/drivers/block/aoe/aoeblk.c | |||
@@ -211,9 +211,7 @@ aoeblk_gdalloc(void *vp) | |||
211 | return; | 211 | return; |
212 | } | 212 | } |
213 | 213 | ||
214 | d->bufpool = mempool_create(MIN_BUFS, | 214 | d->bufpool = mempool_create_slab_pool(MIN_BUFS, buf_pool_cache); |
215 | mempool_alloc_slab, mempool_free_slab, | ||
216 | buf_pool_cache); | ||
217 | if (d->bufpool == NULL) { | 215 | if (d->bufpool == NULL) { |
218 | printk(KERN_ERR "aoe: aoeblk_gdalloc: cannot allocate bufpool " | 216 | printk(KERN_ERR "aoe: aoeblk_gdalloc: cannot allocate bufpool " |
219 | "for %ld.%ld\n", d->aoemajor, d->aoeminor); | 217 | "for %ld.%ld\n", d->aoemajor, d->aoeminor); |
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 840919bba76c..d3ad9081697e 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -250,6 +250,18 @@ static int irqdma_allocated; | |||
250 | #include <linux/cdrom.h> /* for the compatibility eject ioctl */ | 250 | #include <linux/cdrom.h> /* for the compatibility eject ioctl */ |
251 | #include <linux/completion.h> | 251 | #include <linux/completion.h> |
252 | 252 | ||
253 | /* | ||
254 | * Interrupt freeing also means /proc VFS work - dont do it | ||
255 | * from interrupt context. We push this work into keventd: | ||
256 | */ | ||
257 | static void fd_free_irq_fn(void *data) | ||
258 | { | ||
259 | fd_free_irq(); | ||
260 | } | ||
261 | |||
262 | static DECLARE_WORK(fd_free_irq_work, fd_free_irq_fn, NULL); | ||
263 | |||
264 | |||
253 | static struct request *current_req; | 265 | static struct request *current_req; |
254 | static struct request_queue *floppy_queue; | 266 | static struct request_queue *floppy_queue; |
255 | static void do_fd_request(request_queue_t * q); | 267 | static void do_fd_request(request_queue_t * q); |
@@ -4433,6 +4445,13 @@ static int floppy_grab_irq_and_dma(void) | |||
4433 | return 0; | 4445 | return 0; |
4434 | } | 4446 | } |
4435 | spin_unlock_irqrestore(&floppy_usage_lock, flags); | 4447 | spin_unlock_irqrestore(&floppy_usage_lock, flags); |
4448 | |||
4449 | /* | ||
4450 | * We might have scheduled a free_irq(), wait it to | ||
4451 | * drain first: | ||
4452 | */ | ||
4453 | flush_scheduled_work(); | ||
4454 | |||
4436 | if (fd_request_irq()) { | 4455 | if (fd_request_irq()) { |
4437 | DPRINT("Unable to grab IRQ%d for the floppy driver\n", | 4456 | DPRINT("Unable to grab IRQ%d for the floppy driver\n", |
4438 | FLOPPY_IRQ); | 4457 | FLOPPY_IRQ); |
@@ -4522,7 +4541,7 @@ static void floppy_release_irq_and_dma(void) | |||
4522 | if (irqdma_allocated) { | 4541 | if (irqdma_allocated) { |
4523 | fd_disable_dma(); | 4542 | fd_disable_dma(); |
4524 | fd_free_dma(); | 4543 | fd_free_dma(); |
4525 | fd_free_irq(); | 4544 | schedule_work(&fd_free_irq_work); |
4526 | irqdma_allocated = 0; | 4545 | irqdma_allocated = 0; |
4527 | } | 4546 | } |
4528 | set_dor(0, ~0, 8); | 4547 | set_dor(0, ~0, 8); |
@@ -4633,6 +4652,8 @@ void cleanup_module(void) | |||
4633 | /* eject disk, if any */ | 4652 | /* eject disk, if any */ |
4634 | fd_eject(0); | 4653 | fd_eject(0); |
4635 | 4654 | ||
4655 | flush_scheduled_work(); /* fd_free_irq() might be pending */ | ||
4656 | |||
4636 | wait_for_completion(&device_release); | 4657 | wait_for_completion(&device_release); |
4637 | } | 4658 | } |
4638 | 4659 | ||
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 74bf0255e98f..9c3b94e8f03b 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
@@ -839,7 +839,9 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file, | |||
839 | 839 | ||
840 | set_blocksize(bdev, lo_blocksize); | 840 | set_blocksize(bdev, lo_blocksize); |
841 | 841 | ||
842 | kernel_thread(loop_thread, lo, CLONE_KERNEL); | 842 | error = kernel_thread(loop_thread, lo, CLONE_KERNEL); |
843 | if (error < 0) | ||
844 | goto out_putf; | ||
843 | wait_for_completion(&lo->lo_done); | 845 | wait_for_completion(&lo->lo_done); |
844 | return 0; | 846 | return 0; |
845 | 847 | ||
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 1d261f985f31..a04f60693c39 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -230,16 +230,6 @@ static int pkt_grow_pktlist(struct pktcdvd_device *pd, int nr_packets) | |||
230 | return 1; | 230 | return 1; |
231 | } | 231 | } |
232 | 232 | ||
233 | static void *pkt_rb_alloc(gfp_t gfp_mask, void *data) | ||
234 | { | ||
235 | return kmalloc(sizeof(struct pkt_rb_node), gfp_mask); | ||
236 | } | ||
237 | |||
238 | static void pkt_rb_free(void *ptr, void *data) | ||
239 | { | ||
240 | kfree(ptr); | ||
241 | } | ||
242 | |||
243 | static inline struct pkt_rb_node *pkt_rbtree_next(struct pkt_rb_node *node) | 233 | static inline struct pkt_rb_node *pkt_rbtree_next(struct pkt_rb_node *node) |
244 | { | 234 | { |
245 | struct rb_node *n = rb_next(&node->rb_node); | 235 | struct rb_node *n = rb_next(&node->rb_node); |
@@ -2073,16 +2063,6 @@ static int pkt_close(struct inode *inode, struct file *file) | |||
2073 | } | 2063 | } |
2074 | 2064 | ||
2075 | 2065 | ||
2076 | static void *psd_pool_alloc(gfp_t gfp_mask, void *data) | ||
2077 | { | ||
2078 | return kmalloc(sizeof(struct packet_stacked_data), gfp_mask); | ||
2079 | } | ||
2080 | |||
2081 | static void psd_pool_free(void *ptr, void *data) | ||
2082 | { | ||
2083 | kfree(ptr); | ||
2084 | } | ||
2085 | |||
2086 | static int pkt_end_io_read_cloned(struct bio *bio, unsigned int bytes_done, int err) | 2066 | static int pkt_end_io_read_cloned(struct bio *bio, unsigned int bytes_done, int err) |
2087 | { | 2067 | { |
2088 | struct packet_stacked_data *psd = bio->bi_private; | 2068 | struct packet_stacked_data *psd = bio->bi_private; |
@@ -2475,7 +2455,8 @@ static int pkt_setup_dev(struct pkt_ctrl_command *ctrl_cmd) | |||
2475 | if (!pd) | 2455 | if (!pd) |
2476 | return ret; | 2456 | return ret; |
2477 | 2457 | ||
2478 | pd->rb_pool = mempool_create(PKT_RB_POOL_SIZE, pkt_rb_alloc, pkt_rb_free, NULL); | 2458 | pd->rb_pool = mempool_create_kmalloc_pool(PKT_RB_POOL_SIZE, |
2459 | sizeof(struct pkt_rb_node)); | ||
2479 | if (!pd->rb_pool) | 2460 | if (!pd->rb_pool) |
2480 | goto out_mem; | 2461 | goto out_mem; |
2481 | 2462 | ||
@@ -2639,7 +2620,8 @@ static int __init pkt_init(void) | |||
2639 | { | 2620 | { |
2640 | int ret; | 2621 | int ret; |
2641 | 2622 | ||
2642 | psd_pool = mempool_create(PSD_POOL_SIZE, psd_pool_alloc, psd_pool_free, NULL); | 2623 | psd_pool = mempool_create_kmalloc_pool(PSD_POOL_SIZE, |
2624 | sizeof(struct packet_stacked_data)); | ||
2643 | if (!psd_pool) | 2625 | if (!psd_pool) |
2644 | return -ENOMEM; | 2626 | return -ENOMEM; |
2645 | 2627 | ||