brd.c (754451342fc5954061ede74b0a8485ec4a4c6eaa) brd.c (5657a819a8d94426c76be04dcedfad0f64cfff00)
1/*
2 * Ram backed block device driver.
3 *
4 * Copyright (C) 2007 Nick Piggin
5 * Copyright (C) 2007 Novell Inc.
6 *
7 * Parts derived from drivers/block/rd.c, and drivers/block/loop.c, copyright
8 * of their respective owners.

--- 317 unchanged lines hidden (view full) ---

326 .owner = THIS_MODULE,
327 .rw_page = brd_rw_page,
328};
329
330/*
331 * And now the modules code and kernel interface.
332 */
333static int rd_nr = CONFIG_BLK_DEV_RAM_COUNT;
1/*
2 * Ram backed block device driver.
3 *
4 * Copyright (C) 2007 Nick Piggin
5 * Copyright (C) 2007 Novell Inc.
6 *
7 * Parts derived from drivers/block/rd.c, and drivers/block/loop.c, copyright
8 * of their respective owners.

--- 317 unchanged lines hidden (view full) ---

326 .owner = THIS_MODULE,
327 .rw_page = brd_rw_page,
328};
329
330/*
331 * And now the modules code and kernel interface.
332 */
333static int rd_nr = CONFIG_BLK_DEV_RAM_COUNT;
334module_param(rd_nr, int, S_IRUGO);
334module_param(rd_nr, int, 0444);
335MODULE_PARM_DESC(rd_nr, "Maximum number of brd devices");
336
337unsigned long rd_size = CONFIG_BLK_DEV_RAM_SIZE;
335MODULE_PARM_DESC(rd_nr, "Maximum number of brd devices");
336
337unsigned long rd_size = CONFIG_BLK_DEV_RAM_SIZE;
338module_param(rd_size, ulong, S_IRUGO);
338module_param(rd_size, ulong, 0444);
339MODULE_PARM_DESC(rd_size, "Size of each RAM disk in kbytes.");
340
341static int max_part = 1;
339MODULE_PARM_DESC(rd_size, "Size of each RAM disk in kbytes.");
340
341static int max_part = 1;
342module_param(max_part, int, S_IRUGO);
342module_param(max_part, int, 0444);
343MODULE_PARM_DESC(max_part, "Num Minors to reserve between devices");
344
345MODULE_LICENSE("GPL");
346MODULE_ALIAS_BLOCKDEV_MAJOR(RAMDISK_MAJOR);
347MODULE_ALIAS("rd");
348
349#ifndef MODULE
350/* Legacy boot options - nonmodular */

--- 46 unchanged lines hidden (view full) ---

397 disk->fops = &brd_fops;
398 disk->private_data = brd;
399 disk->queue = brd->brd_queue;
400 disk->flags = GENHD_FL_EXT_DEVT;
401 sprintf(disk->disk_name, "ram%d", i);
402 set_capacity(disk, rd_size * 2);
403 disk->queue->backing_dev_info->capabilities |= BDI_CAP_SYNCHRONOUS_IO;
404
343MODULE_PARM_DESC(max_part, "Num Minors to reserve between devices");
344
345MODULE_LICENSE("GPL");
346MODULE_ALIAS_BLOCKDEV_MAJOR(RAMDISK_MAJOR);
347MODULE_ALIAS("rd");
348
349#ifndef MODULE
350/* Legacy boot options - nonmodular */

--- 46 unchanged lines hidden (view full) ---

397 disk->fops = &brd_fops;
398 disk->private_data = brd;
399 disk->queue = brd->brd_queue;
400 disk->flags = GENHD_FL_EXT_DEVT;
401 sprintf(disk->disk_name, "ram%d", i);
402 set_capacity(disk, rd_size * 2);
403 disk->queue->backing_dev_info->capabilities |= BDI_CAP_SYNCHRONOUS_IO;
404
405 /* Tell the block layer that this is not a rotational device */
406 blk_queue_flag_set(QUEUE_FLAG_NONROT, disk->queue);
407 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, disk->queue);
408
405 return brd;
406
407out_free_queue:
408 blk_cleanup_queue(brd->brd_queue);
409out_free_dev:
410 kfree(brd);
411out:
412 return NULL;

--- 125 unchanged lines hidden ---
409 return brd;
410
411out_free_queue:
412 blk_cleanup_queue(brd->brd_queue);
413out_free_dev:
414 kfree(brd);
415out:
416 return NULL;

--- 125 unchanged lines hidden ---