|
The return value depends on the input parameter.
- if a major device number was requested in range [1..255] then the function returns zero on success, or a negative error code
- if any unused major number was requested with =0 parameter then the return value is the allocated major number in range [1..255] or a negative error code otherwise
|
#define | MODULE_PARAM_PREFIX "block." |
|
struct class | block_class |
|
int | register_blkdev (unsigned int major, const char *name) |
|
| EXPORT_SYMBOL (register_blkdev) |
|
void | unregister_blkdev (unsigned int major, const char *name) |
|
| EXPORT_SYMBOL (unregister_blkdev) |
|
int | blk_alloc_devt (struct hd_struct *part, dev_t *devt) |
|
void | blk_free_devt (dev_t devt) |
|
void | blk_register_region (dev_t devt, unsigned long range, struct module *module, struct kobject *(*probe)(dev_t, int *, void *), int(*lock)(dev_t, void *), void *data) |
|
| EXPORT_SYMBOL (blk_register_region) |
|
void | blk_unregister_region (dev_t devt, unsigned long range) |
|
| EXPORT_SYMBOL (blk_unregister_region) |
|
void | add_disk (struct gendisk *disk) |
|
| EXPORT_SYMBOL (add_disk) |
|
void | del_gendisk (struct gendisk *disk) |
|
| EXPORT_SYMBOL (del_gendisk) |
|
struct gendisk * | get_gendisk (dev_t devt, int *partno) |
|
| EXPORT_SYMBOL (get_gendisk) |
|
struct block_device * | bdget_disk (struct gendisk *disk, int partno) |
|
| EXPORT_SYMBOL (bdget_disk) |
|
void __init | printk_all_partitions (void) |
|
| subsys_initcall (genhd_device_init) |
|
int | disk_expand_part_tbl (struct gendisk *disk, int partno) |
|
dev_t | blk_lookup_devt (const char *name, int partno) |
|
| EXPORT_SYMBOL (blk_lookup_devt) |
|
struct gendisk * | alloc_disk (int minors) |
|
| EXPORT_SYMBOL (alloc_disk) |
|
struct gendisk * | alloc_disk_node (int minors, int node_id) |
|
| EXPORT_SYMBOL (alloc_disk_node) |
|
struct kobject * | get_disk (struct gendisk *disk) |
|
| EXPORT_SYMBOL (get_disk) |
|
void | put_disk (struct gendisk *disk) |
|
| EXPORT_SYMBOL (put_disk) |
|
void | set_device_ro (struct block_device *bdev, int flag) |
|
| EXPORT_SYMBOL (set_device_ro) |
|
void | set_disk_ro (struct gendisk *disk, int flag) |
|
| EXPORT_SYMBOL (set_disk_ro) |
|
int | bdev_read_only (struct block_device *bdev) |
|
| EXPORT_SYMBOL (bdev_read_only) |
|
int | invalidate_partition (struct gendisk *disk, int partno) |
|
| EXPORT_SYMBOL (invalidate_partition) |
|
void | disk_block_events (struct gendisk *disk) |
|
void | disk_unblock_events (struct gendisk *disk) |
|
void | disk_flush_events (struct gendisk *disk, unsigned int mask) |
|
unsigned int | disk_clear_events (struct gendisk *disk, unsigned int mask) |
|
| module_param_cb (events_dfl_poll_msecs,&disk_events_dfl_poll_msecs_param_ops,&disk_events_dfl_poll_msecs, 0644) |
|
blk_alloc_devt - allocate a dev_t for a partition : partition to allocate dev_t for : out parameter for resulting dev_t
Allocate a dev_t for block device.
RETURNS: 0 on success, allocated dev_t is returned in *. -errno on failure.
CONTEXT: Might sleep.
Definition at line 408 of file genhd.c.
disk_block_events - block and flush disk event checking : disk to block events for
On return from this function, it is guaranteed that event checking isn't in progress and won't happen until unblocked by disk_unblock_events(). Events blocking is counted and the actual unblocking happens after the matching number of unblocks are done.
Note that this intentionally does not block event checking from disk_clear_events().
CONTEXT: Might sleep.
Definition at line 1447 of file genhd.c.
int disk_expand_part_tbl |
( |
struct gendisk * |
disk, |
|
|
int |
partno |
|
) |
| |
disk_expand_part_tbl - expand disk->part_tbl : disk to expand part_tbl for : expand such that this partno can fit in
Expand disk->part_tbl such that can fit in. disk->part_tbl uses RCU to allow unlocked dereferencing for stats and other stuff.
LOCKING: Matching bd_mutex locked, might sleep.
RETURNS: 0 on success, -errno on failure.
Definition at line 1069 of file genhd.c.
void disk_flush_events |
( |
struct gendisk * |
disk, |
|
|
unsigned int |
mask |
|
) |
| |
disk_flush_events - schedule immediate event checking and flushing : disk to check and flush events for : events to flush
Schedule immediate event checking on if not blocked. Events in are scheduled to be cleared from the driver. Note that this doesn't clear the events from ->ev.
CONTEXT: If is non-zero must be called with bdev->bd_mutex held.
Definition at line 1528 of file genhd.c.
disk_get_part - get partition : disk to look partition from : partition number
Look for partition from . If found, increment reference count and return it.
CONTEXT: Don't care.
RETURNS: Pointer to the found partition on success, NULL if not found.
Definition at line 57 of file genhd.c.
disk_map_sector_rcu - map sector to partition : gendisk of interest : sector to map
Find out which partition maps to on . This is primarily used for stats accounting.
CONTEXT: RCU read locked. The returned partition pointer is valid only while preemption is disabled.
RETURNS: Found partition on success, part0 is returned if no partition matches
Definition at line 212 of file genhd.c.