Lines Matching full:major
21 #include <linux/major.h>
54 /* for extended dynamic devt allocation, currently only one major is used */
164 int major; member
174 static inline int major_to_index(unsigned major) in major_to_index() argument
176 return major % BLKDEV_MAJOR_HASH_SIZE; in major_to_index()
186 if (dp->major == offset) in blkdev_show()
187 seq_printf(seqf, "%3d %s\n", dp->major, dp->name); in blkdev_show()
195 * @major: the requested major device number [1..BLKDEV_MAJOR_MAX-1]. If
196 * @major = 0, try to allocate any unused major number.
205 * The return value depends on the @major input parameter:
207 * - if a major device number was requested in range [1..BLKDEV_MAJOR_MAX-1]
209 * - if any unused major number was requested with @major = 0 parameter
210 * then the return value is the allocated major number in range
214 * major numbers.
218 int __register_blkdev(unsigned int major, const char *name, in __register_blkdev() argument
227 if (major == 0) { in __register_blkdev()
234 printk("%s: failed to get major for %s\n", in __register_blkdev()
239 major = index; in __register_blkdev()
240 ret = major; in __register_blkdev()
243 if (major >= BLKDEV_MAJOR_MAX) { in __register_blkdev()
244 pr_err("%s: major requested (%u) is greater than the maximum (%u) for %s\n", in __register_blkdev()
245 __func__, major, BLKDEV_MAJOR_MAX-1, name); in __register_blkdev()
257 p->major = major; in __register_blkdev()
263 index = major_to_index(major); in __register_blkdev()
267 if ((*n)->major == major) in __register_blkdev()
277 printk("register_blkdev: cannot get major %u for %s\n", in __register_blkdev()
278 major, name); in __register_blkdev()
287 void unregister_blkdev(unsigned int major, const char *name) in unregister_blkdev() argument
291 int index = major_to_index(major); in unregister_blkdev()
296 if ((*n)->major == major) in unregister_blkdev()
328 if (MAJOR(devt) <= 0xff && MINOR(devt) <= 0xff) { in bdevt_str()
330 snprintf(tbuf, BDEVT_SIZE, "%02x%02x", MAJOR(devt), MINOR(devt)); in bdevt_str()
333 snprintf(buf, BDEVT_SIZE, "%03x:%05x", MAJOR(devt), MINOR(devt)); in bdevt_str()
407 * If the driver provides an explicit major number it also must provide in device_add_disk()
414 if (disk->major) { in device_add_disk()
432 disk->major = BLOCK_EXT_MAJOR; in device_add_disk()
443 ddev->devt = MKDEV(disk->major, disk->first_minor); in device_add_disk()
492 disk->major, disk->first_minor); in device_add_disk()
515 * freeing of the dynamic major works. in device_add_disk()
517 disk->part0->bd_dev = MKDEV(disk->major, disk->first_minor); in device_add_disk()
543 if (disk->major == BLOCK_EXT_MAJOR) in device_add_disk()
719 unsigned int major = MAJOR(devt); in blk_request_module() local
723 for (n = &major_names[major_to_index(major)]; *n; n = &(*n)->next) { in blk_request_module()
724 if ((*n)->major == major && (*n)->probe) { in blk_request_module()
732 if (request_module("block-major-%d-%d", MAJOR(devt), MINOR(devt)) > 0) in blk_request_module()
734 request_module("block-major-%d", MAJOR(devt)); in blk_request_module()
842 seq_puts(seqf, "major minor #blocks name\n\n"); in show_partition_start()
860 MAJOR(part->bd_dev), MINOR(part->bd_dev), in show_partition()
1231 seq_puts(seqf, "major minor name" in diskstats_show()
1259 MAJOR(hd->bd_dev), MINOR(hd->bd_dev), hd, in diskstats_show()
1339 devt = MKDEV(MAJOR(dev->devt), in blk_lookup_devt()