/linux-4.1.27/block/ |
H A D | genhd.c | 41 static void disk_alloc_events(struct gendisk *disk); 42 static void disk_add_events(struct gendisk *disk); 43 static void disk_del_events(struct gendisk *disk); 44 static void disk_release_events(struct gendisk *disk); 48 * @disk: disk to look partition from 51 * Look for partition @partno from @disk. If found, increment 60 struct hd_struct *disk_get_part(struct gendisk *disk, int partno) disk_get_part() argument 70 ptbl = rcu_dereference(disk->part_tbl); disk_get_part() 86 * @disk: disk to iterate over 89 * Initialize @piter so that it iterates over partitions of @disk. 94 void disk_part_iter_init(struct disk_part_iter *piter, struct gendisk *disk, disk_part_iter_init() argument 100 ptbl = rcu_dereference(disk->part_tbl); disk_part_iter_init() 102 piter->disk = disk; disk_part_iter_init() 138 ptbl = rcu_dereference(piter->disk->part_tbl); disk_part_iter_next() 202 * @disk: gendisk of interest 205 * Find out which partition @sector maps to on @disk. This is 215 struct hd_struct *disk_map_sector_rcu(struct gendisk *disk, sector_t sector) disk_map_sector_rcu() argument 221 ptbl = rcu_dereference(disk->part_tbl); disk_map_sector_rcu() 235 return &disk->part0; disk_map_sector_rcu() 413 struct gendisk *disk = part_to_disk(part); blk_alloc_devt() local 417 if (part->partno < disk->minors) { blk_alloc_devt() 418 *devt = MKDEV(disk->major, disk->first_minor + part->partno); blk_alloc_devt() 507 static void register_disk(struct gendisk *disk) register_disk() argument 509 struct device *ddev = disk_to_dev(disk); register_disk() 515 ddev->parent = disk->driverfs_dev; register_disk() 517 dev_set_name(ddev, "%s", disk->disk_name); register_disk() 540 disk->part0.holder_dir = kobject_create_and_add("holders", &ddev->kobj); register_disk() 541 disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj); register_disk() 544 if (!disk_part_scan_enabled(disk)) register_disk() 548 if (!get_capacity(disk)) register_disk() 551 bdev = bdget_disk(disk, 0); register_disk() 562 /* announce disk after possible partitions are created */ register_disk() 567 disk_part_iter_init(&piter, disk, 0); register_disk() 575 * @disk: per-device partitioning information 577 * This function registers the partitioning information in @disk 582 void add_disk(struct gendisk *disk) add_disk() argument 592 WARN_ON(disk->minors && !(disk->major || disk->first_minor)); add_disk() 593 WARN_ON(!disk->minors && !(disk->flags & GENHD_FL_EXT_DEVT)); add_disk() 595 disk->flags |= GENHD_FL_UP; add_disk() 597 retval = blk_alloc_devt(&disk->part0, &devt); add_disk() 602 disk_to_dev(disk)->devt = devt; add_disk() 607 disk->major = MAJOR(devt); add_disk() 608 disk->first_minor = MINOR(devt); add_disk() 610 disk_alloc_events(disk); add_disk() 613 bdi = &disk->queue->backing_dev_info; add_disk() 614 bdi_register_dev(bdi, disk_devt(disk)); add_disk() 616 blk_register_region(disk_devt(disk), disk->minors, NULL, add_disk() 617 exact_match, exact_lock, disk); add_disk() local 618 register_disk(disk); add_disk() 619 blk_register_queue(disk); add_disk() 623 * so that it sticks around as long as @disk is there. add_disk() 625 WARN_ON_ONCE(!blk_get_queue(disk->queue)); add_disk() 627 retval = sysfs_create_link(&disk_to_dev(disk)->kobj, &bdi->dev->kobj, add_disk() 631 disk_add_events(disk); add_disk() 635 void del_gendisk(struct gendisk *disk) del_gendisk() argument 640 disk_del_events(disk); del_gendisk() 643 disk_part_iter_init(&piter, disk, del_gendisk() 646 invalidate_partition(disk, part->partno); del_gendisk() 647 delete_partition(disk, part->partno); del_gendisk() 651 invalidate_partition(disk, 0); del_gendisk() 652 set_capacity(disk, 0); del_gendisk() 653 disk->flags &= ~GENHD_FL_UP; del_gendisk() 655 sysfs_remove_link(&disk_to_dev(disk)->kobj, "bdi"); del_gendisk() 656 blk_unregister_queue(disk); del_gendisk() 657 blk_unregister_region(disk_devt(disk), disk->minors); del_gendisk() 659 part_stat_set_all(&disk->part0, 0); del_gendisk() 660 disk->part0.stamp = 0; del_gendisk() 662 kobject_put(disk->part0.holder_dir); del_gendisk() 663 kobject_put(disk->slave_dir); del_gendisk() 664 disk->driverfs_dev = NULL; del_gendisk() 666 sysfs_remove_link(block_depr, dev_name(disk_to_dev(disk))); del_gendisk() 667 pm_runtime_set_memalloc_noio(disk_to_dev(disk), false); del_gendisk() 668 device_del(disk_to_dev(disk)); del_gendisk() 682 struct gendisk *disk = NULL; get_gendisk() local 689 disk = dev_to_disk(kobj_to_dev(kobj)); get_gendisk() 697 disk = part_to_disk(part); get_gendisk() 702 return disk; get_gendisk() 708 * @disk: gendisk of interest 711 * Find partition @partno from @disk, do bdget() on it. 719 struct block_device *bdget_disk(struct gendisk *disk, int partno) bdget_disk() argument 724 part = disk_get_part(disk, partno); bdget_disk() 745 struct gendisk *disk = dev_to_disk(dev); printk_all_partitions() local 755 if (get_capacity(disk) == 0 || printk_all_partitions() 756 (disk->flags & GENHD_FL_SUPPRESS_PARTITION_INFO)) printk_all_partitions() 764 disk_part_iter_init(&piter, disk, DISK_PITER_INCL_PART0); printk_all_partitions() 766 bool is_part0 = part == &disk->part0; printk_all_partitions() 771 , disk_name(disk, part->partno, name_buf), printk_all_partitions() 774 if (disk->driverfs_dev != NULL && printk_all_partitions() 775 disk->driverfs_dev->driver != NULL) printk_all_partitions() 777 disk->driverfs_dev->driver->name); printk_all_partitions() 858 /* show the full disk and all non-0 size partitions of it */ show_partition() 923 struct gendisk *disk = dev_to_disk(dev); disk_range_show() local 925 return sprintf(buf, "%d\n", disk->minors); disk_range_show() 931 struct gendisk *disk = dev_to_disk(dev); disk_ext_range_show() local 933 return sprintf(buf, "%d\n", disk_max_parts(disk)); disk_ext_range_show() 939 struct gendisk *disk = dev_to_disk(dev); disk_removable_show() local 942 (disk->flags & GENHD_FL_REMOVABLE ? 1 : 0)); disk_removable_show() 948 struct gendisk *disk = dev_to_disk(dev); disk_ro_show() local 950 return sprintf(buf, "%d\n", get_disk_ro(disk) ? 1 : 0); disk_ro_show() 956 struct gendisk *disk = dev_to_disk(dev); disk_capability_show() local 958 return sprintf(buf, "%x\n", disk->flags); disk_capability_show() 965 struct gendisk *disk = dev_to_disk(dev); disk_alignment_offset_show() local 967 return sprintf(buf, "%d\n", queue_alignment_offset(disk->queue)); disk_alignment_offset_show() 974 struct gendisk *disk = dev_to_disk(dev); disk_discard_alignment_show() local 976 return sprintf(buf, "%d\n", queue_discard_alignment(disk->queue)); disk_discard_alignment_show() 1030 * disk_replace_part_tbl - replace disk->part_tbl in RCU-safe way 1031 * @disk: disk to replace part_tbl for 1034 * Replace disk->part_tbl with @new_ptbl in RCU-safe way. The 1040 static void disk_replace_part_tbl(struct gendisk *disk, disk_replace_part_tbl() argument 1043 struct disk_part_tbl *old_ptbl = disk->part_tbl; disk_replace_part_tbl() 1045 rcu_assign_pointer(disk->part_tbl, new_ptbl); disk_replace_part_tbl() 1054 * disk_expand_part_tbl - expand disk->part_tbl 1055 * @disk: disk to expand part_tbl for 1058 * Expand disk->part_tbl such that @partno can fit in. disk->part_tbl 1067 int disk_expand_part_tbl(struct gendisk *disk, int partno) disk_expand_part_tbl() argument 1069 struct disk_part_tbl *old_ptbl = disk->part_tbl; disk_expand_part_tbl() 1084 if (disk_max_parts(disk) && target > disk_max_parts(disk)) disk_expand_part_tbl() 1091 new_ptbl = kzalloc_node(size, GFP_KERNEL, disk->node_id); disk_expand_part_tbl() 1100 disk_replace_part_tbl(disk, new_ptbl); disk_expand_part_tbl() 1106 struct gendisk *disk = dev_to_disk(dev); disk_release() local 1109 disk_release_events(disk); disk_release() 1110 kfree(disk->random); disk_release() 1111 disk_replace_part_tbl(disk, NULL); disk_release() 1112 free_part_stats(&disk->part0); disk_release() 1113 free_part_info(&disk->part0); disk_release() 1114 if (disk->queue) disk_release() 1115 blk_put_queue(disk->queue); disk_release() 1116 kfree(disk); disk_release() 1125 struct gendisk *disk = dev_to_disk(dev); block_devnode() local 1127 if (disk->devnode) block_devnode() 1128 return disk->devnode(disk, mode); block_devnode() 1133 .name = "disk", 1141 * aggregate disk stat collector. Uses the same stats that the sysfs 1226 struct gendisk *disk = dev_to_disk(dev); blk_lookup_devt() local 1232 if (partno < disk->minors) { blk_lookup_devt() 1240 part = disk_get_part(disk, partno); blk_lookup_devt() 1261 struct gendisk *disk; alloc_disk_node() local 1263 disk = kzalloc_node(sizeof(struct gendisk), GFP_KERNEL, node_id); alloc_disk_node() 1264 if (disk) { alloc_disk_node() 1265 if (!init_part_stats(&disk->part0)) { alloc_disk_node() 1266 kfree(disk); alloc_disk_node() 1269 disk->node_id = node_id; alloc_disk_node() 1270 if (disk_expand_part_tbl(disk, 0)) { alloc_disk_node() 1271 free_part_stats(&disk->part0); alloc_disk_node() 1272 kfree(disk); alloc_disk_node() 1275 disk->part_tbl->part[0] = &disk->part0; alloc_disk_node() 1286 seqcount_init(&disk->part0.nr_sects_seq); alloc_disk_node() 1287 hd_ref_init(&disk->part0); alloc_disk_node() 1289 disk->minors = minors; alloc_disk_node() 1290 rand_initialize_disk(disk); alloc_disk_node() 1291 disk_to_dev(disk)->class = &block_class; alloc_disk_node() 1292 disk_to_dev(disk)->type = &disk_type; alloc_disk_node() 1293 device_initialize(disk_to_dev(disk)); alloc_disk_node() 1295 return disk; alloc_disk_node() 1299 struct kobject *get_disk(struct gendisk *disk) get_disk() argument 1304 if (!disk->fops) get_disk() 1306 owner = disk->fops->owner; get_disk() 1309 kobj = kobject_get(&disk_to_dev(disk)->kobj); get_disk() 1320 void put_disk(struct gendisk *disk) put_disk() argument 1322 if (disk) put_disk() 1323 kobject_put(&disk_to_dev(disk)->kobj); put_disk() 1345 void set_disk_ro(struct gendisk *disk, int flag) set_disk_ro() argument 1350 if (disk->part0.policy != flag) { set_disk_ro() 1351 set_disk_ro_uevent(disk, flag); set_disk_ro() 1352 disk->part0.policy = flag; set_disk_ro() 1355 disk_part_iter_init(&piter, disk, DISK_PITER_INCL_EMPTY); set_disk_ro() 1372 int invalidate_partition(struct gendisk *disk, int partno) invalidate_partition() argument 1375 struct block_device *bdev = bdget_disk(disk, partno); invalidate_partition() 1387 * Disk events - monitor disk events like media change and eject request. 1391 struct gendisk *disk; /* the associated disk */ member in struct:disk_events 1420 static unsigned long disk_events_poll_jiffies(struct gendisk *disk) disk_events_poll_jiffies() argument 1422 struct disk_events *ev = disk->ev; disk_events_poll_jiffies() 1432 else if (disk->events & ~disk->async_events) disk_events_poll_jiffies() 1439 * disk_block_events - block and flush disk event checking 1440 * @disk: disk to block events for 1453 void disk_block_events(struct gendisk *disk) disk_block_events() argument 1455 struct disk_events *ev = disk->ev; disk_block_events() 1473 cancel_delayed_work_sync(&disk->ev->dwork); disk_block_events() 1478 static void __disk_unblock_events(struct gendisk *disk, bool check_now) __disk_unblock_events() argument 1480 struct disk_events *ev = disk->ev; __disk_unblock_events() 1496 intv = disk_events_poll_jiffies(disk); __disk_unblock_events() 1509 * disk_unblock_events - unblock disk event checking 1510 * @disk: disk to unblock events for 1518 void disk_unblock_events(struct gendisk *disk) disk_unblock_events() argument 1520 if (disk->ev) disk_unblock_events() 1521 __disk_unblock_events(disk, false); disk_unblock_events() 1526 * @disk: disk to check and flush events for 1529 * Schedule immediate event checking on @disk if not blocked. Events in 1531 * doesn't clear the events from @disk->ev. 1536 void disk_flush_events(struct gendisk *disk, unsigned int mask) disk_flush_events() argument 1538 struct disk_events *ev = disk->ev; disk_flush_events() 1553 * @disk: disk to fetch and clear events from 1562 unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask) disk_clear_events() argument 1564 const struct block_device_operations *bdops = disk->fops; disk_clear_events() 1565 struct disk_events *ev = disk->ev; disk_clear_events() 1572 bdops->media_changed && bdops->media_changed(disk)) disk_clear_events() 1577 disk_block_events(disk); disk_clear_events() 1594 __disk_unblock_events(disk, ev->clearing ? true : false); disk_clear_events() 1621 struct gendisk *disk = ev->disk; disk_check_events() local 1629 events = disk->fops->check_events(disk, clearing); disk_check_events() 1638 intv = disk_events_poll_jiffies(disk); disk_check_events() 1647 * @disk->events are reported. Unlisted events are processed the disk_check_events() 1651 if (events & disk->events & (1 << i)) disk_check_events() 1655 kobject_uevent_env(&disk_to_dev(disk)->kobj, KOBJ_CHANGE, envp); disk_check_events() 1659 * A disk events enabled device has the following sysfs nodes under 1686 struct gendisk *disk = dev_to_disk(dev); disk_events_show() local 1688 return __disk_events_show(disk->events, buf); disk_events_show() 1694 struct gendisk *disk = dev_to_disk(dev); disk_events_async_show() local 1696 return __disk_events_show(disk->async_events, buf); disk_events_async_show() 1703 struct gendisk *disk = dev_to_disk(dev); disk_events_poll_msecs_show() local 1705 return sprintf(buf, "%ld\n", disk->ev->poll_msecs); disk_events_poll_msecs_show() 1712 struct gendisk *disk = dev_to_disk(dev); disk_events_poll_msecs_store() local 1721 disk_block_events(disk); disk_events_poll_msecs_store() 1722 disk->ev->poll_msecs = intv; disk_events_poll_msecs_store() 1723 __disk_unblock_events(disk, true); disk_events_poll_msecs_store() 1760 disk_flush_events(ev->disk, 0); disk_events_set_dfl_poll_msecs() 1781 static void disk_alloc_events(struct gendisk *disk) disk_alloc_events() argument 1785 if (!disk->fops->check_events) disk_alloc_events() 1790 pr_warn("%s: failed to initialize events\n", disk->disk_name); disk_alloc_events() 1795 ev->disk = disk; disk_alloc_events() 1802 disk->ev = ev; disk_alloc_events() 1805 static void disk_add_events(struct gendisk *disk) disk_add_events() argument 1807 if (!disk->ev) disk_add_events() 1811 if (sysfs_create_files(&disk_to_dev(disk)->kobj, disk_events_attrs) < 0) disk_add_events() 1813 disk->disk_name); disk_add_events() 1816 list_add_tail(&disk->ev->node, &disk_events); disk_add_events() 1823 __disk_unblock_events(disk, true); disk_add_events() 1826 static void disk_del_events(struct gendisk *disk) disk_del_events() argument 1828 if (!disk->ev) disk_del_events() 1831 disk_block_events(disk); disk_del_events() 1834 list_del_init(&disk->ev->node); disk_del_events() 1837 sysfs_remove_files(&disk_to_dev(disk)->kobj, disk_events_attrs); disk_del_events() 1840 static void disk_release_events(struct gendisk *disk) disk_release_events() argument 1843 WARN_ON_ONCE(disk->ev && disk->ev->block != 1); disk_release_events() 1844 kfree(disk->ev); disk_release_events()
|
H A D | partition-generic.c | 29 * It formats the devicename of the indicated disk into 241 void delete_partition(struct gendisk *disk, int partno) delete_partition() argument 243 struct disk_part_tbl *ptbl = disk->part_tbl; delete_partition() 269 struct hd_struct *add_partition(struct gendisk *disk, int partno, add_partition() argument 275 struct device *ddev = disk_to_dev(disk); add_partition() 281 err = disk_expand_part_tbl(disk, partno); add_partition() 284 ptbl = disk->part_tbl; add_partition() 303 queue_limit_alignment_offset(&disk->queue->limits, start); add_partition() 305 queue_limit_discard_alignment(&disk->queue->limits, start); add_partition() 308 p->policy = get_disk_ro(disk); add_partition() 311 struct partition_meta_info *pinfo = alloc_part_info(disk); add_partition() 355 /* suppress uevent if the disk suppresses it */ add_partition() 378 static bool disk_unlock_native_capacity(struct gendisk *disk) disk_unlock_native_capacity() argument 380 const struct block_device_operations *bdops = disk->fops; disk_unlock_native_capacity() 383 !(disk->flags & GENHD_FL_NATIVE_CAPACITY)) { disk_unlock_native_capacity() 385 bdops->unlock_native_capacity(disk); disk_unlock_native_capacity() 386 disk->flags |= GENHD_FL_NATIVE_CAPACITY; disk_unlock_native_capacity() 394 static int drop_partitions(struct gendisk *disk, struct block_device *bdev) drop_partitions() argument 402 res = invalidate_partition(disk, 0); drop_partitions() 406 disk_part_iter_init(&piter, disk, DISK_PITER_INCL_EMPTY); drop_partitions() 408 delete_partition(disk, part->partno); drop_partitions() 414 int rescan_partitions(struct gendisk *disk, struct block_device *bdev) rescan_partitions() argument 425 res = drop_partitions(disk, bdev); rescan_partitions() 429 if (disk->fops->revalidate_disk) rescan_partitions() 430 disk->fops->revalidate_disk(disk); rescan_partitions() 431 check_disk_size_change(disk, bdev); rescan_partitions() 433 if (!get_capacity(disk) || !(state = check_partition(disk, bdev))) rescan_partitions() 443 disk->disk_name); rescan_partitions() 444 if (disk_unlock_native_capacity(disk)) rescan_partitions() 457 disk->disk_name); rescan_partitions() 458 if (disk_unlock_native_capacity(disk)) rescan_partitions() 463 kobject_uevent(&disk_to_dev(disk)->kobj, KOBJ_CHANGE); rescan_partitions() 466 * disk->part_tbl. This is an optimization and not strictly rescan_partitions() 473 disk_expand_part_tbl(disk, highest); rescan_partitions() 485 if (from >= get_capacity(disk)) { rescan_partitions() 488 disk->disk_name, p, (unsigned long long) from); rescan_partitions() 489 if (disk_unlock_native_capacity(disk)) rescan_partitions() 494 if (from + size > get_capacity(disk)) { rescan_partitions() 497 disk->disk_name, p, (unsigned long long) size); rescan_partitions() 499 if (disk_unlock_native_capacity(disk)) { rescan_partitions() 506 * we limit them to the end of the disk to avoid rescan_partitions() 509 size = get_capacity(disk) - from; rescan_partitions() 515 part = add_partition(disk, p, from, size, rescan_partitions() 520 disk->disk_name, p, -PTR_ERR(part)); rescan_partitions() 532 int invalidate_partitions(struct gendisk *disk, struct block_device *bdev) invalidate_partitions() argument 539 res = drop_partitions(disk, bdev); invalidate_partitions() 543 set_capacity(disk, 0); invalidate_partitions() 544 check_disk_size_change(disk, bdev); invalidate_partitions() 547 kobject_uevent(&disk_to_dev(disk)->kobj, KOBJ_CHANGE); invalidate_partitions()
|
H A D | blk-integrity.c | 396 bool blk_integrity_is_initialized(struct gendisk *disk) blk_integrity_is_initialized() argument 398 struct blk_integrity *bi = blk_get_integrity(disk); blk_integrity_is_initialized() 406 * @disk: struct gendisk pointer to make integrity-aware 416 int blk_integrity_register(struct gendisk *disk, struct blk_integrity *template) blk_integrity_register() argument 420 BUG_ON(disk == NULL); blk_integrity_register() 422 if (disk->integrity == NULL) { blk_integrity_register() 429 &disk_to_dev(disk)->kobj, blk_integrity_register() 438 bi->interval = queue_logical_block_size(disk->queue); blk_integrity_register() 439 disk->integrity = bi; blk_integrity_register() 441 bi = disk->integrity; blk_integrity_register() 454 disk->queue->backing_dev_info.capabilities |= BDI_CAP_STABLE_WRITES; blk_integrity_register() 462 * @disk: disk whose integrity profile to deallocate 467 void blk_integrity_unregister(struct gendisk *disk) blk_integrity_unregister() argument 471 if (!disk || !disk->integrity) blk_integrity_unregister() 474 disk->queue->backing_dev_info.capabilities &= ~BDI_CAP_STABLE_WRITES; blk_integrity_unregister() 476 bi = disk->integrity; blk_integrity_unregister() 481 disk->integrity = NULL; blk_integrity_unregister()
|
H A D | ioctl.c | 15 struct gendisk *disk; blkpg_ioctl() local 29 disk = bdev->bd_disk; blkpg_ioctl() 51 disk_part_iter_init(&piter, disk, blkpg_ioctl() 64 part = add_partition(disk, partno, start, length, blkpg_ioctl() 69 part = disk_get_part(disk, partno); blkpg_ioctl() 89 delete_partition(disk, partno); blkpg_ioctl() 107 part = disk_get_part(disk, partno); blkpg_ioctl() 125 disk_part_iter_init(&piter, disk, blkpg_ioctl() 155 struct gendisk *disk = bdev->bd_disk; blkdev_reread_part() local 158 if (!disk_part_scan_enabled(disk) || bdev != bdev->bd_contains) blkdev_reread_part() 164 res = rescan_partitions(disk, bdev); blkdev_reread_part() 237 struct gendisk *disk = bdev->bd_disk; __blkdev_driver_ioctl() local 239 if (disk->fops->ioctl) __blkdev_driver_ioctl() 240 return disk->fops->ioctl(bdev, mode, cmd, arg); __blkdev_driver_ioctl() 277 struct gendisk *disk = bdev->bd_disk; blkdev_ioctl() local 337 if (!disk->fops->getgeo) blkdev_ioctl() 346 ret = disk->fops->getgeo(bdev, &geo); blkdev_ioctl()
|
H A D | blk-timeout.c | 43 struct gendisk *disk = dev_to_disk(dev); part_timeout_show() local 44 int set = test_bit(QUEUE_FLAG_FAIL_IO, &disk->queue->queue_flags); part_timeout_show() 52 struct gendisk *disk = dev_to_disk(dev); part_timeout_store() local 56 struct request_queue *q = disk->queue; part_timeout_store()
|
H A D | blk-mq-sysfs.c | 377 void blk_mq_unregister_disk(struct gendisk *disk) blk_mq_unregister_disk() argument 379 struct request_queue *q = disk->queue; blk_mq_unregister_disk() 397 kobject_put(&disk_to_dev(disk)->kobj); 421 int blk_mq_register_disk(struct gendisk *disk) blk_mq_register_disk() argument 423 struct device *dev = disk_to_dev(disk); blk_mq_register_disk() 424 struct request_queue *q = disk->queue; blk_mq_register_disk() 444 blk_mq_unregister_disk(disk);
|
H A D | blk-sysfs.c | 540 int blk_register_queue(struct gendisk *disk) blk_register_queue() argument 543 struct device *dev = disk_to_dev(disk); blk_register_queue() 544 struct request_queue *q = disk->queue; blk_register_queue() 578 blk_mq_register_disk(disk); blk_register_queue() 595 void blk_unregister_queue(struct gendisk *disk) blk_unregister_queue() argument 597 struct request_queue *q = disk->queue; blk_unregister_queue() 603 blk_mq_unregister_disk(disk); blk_unregister_queue() 610 blk_trace_remove_sysfs(disk_to_dev(disk)); blk_unregister_queue() 611 kobject_put(&disk_to_dev(disk)->kobj); blk_unregister_queue()
|
H A D | blk-cgroup.c | 489 /* some drivers (floppy) instantiate a queue w/o disk registered */ blkg_dev_name() 707 __acquires(rcu) __acquires(disk->queue->queue_lock) __acquires() 709 struct gendisk *disk; __acquires() local 718 disk = get_gendisk(MKDEV(major, minor), &part); __acquires() 719 if (!disk) __acquires() 722 put_disk(disk); __acquires() 727 spin_lock_irq(disk->queue->queue_lock); __acquires() 729 if (blkcg_policy_enabled(disk->queue, pol)) __acquires() 730 blkg = blkg_lookup_create(blkcg, disk->queue); __acquires() 737 spin_unlock_irq(disk->queue->queue_lock); __acquires() 738 put_disk(disk); __acquires() 752 ctx->disk = disk; __acquires() 767 __releases(ctx->disk->queue->queue_lock) __releases(rcu) __releases() 769 spin_unlock_irq(ctx->disk->queue->queue_lock); __releases() 771 put_disk(ctx->disk); __releases()
|
/linux-4.1.27/drivers/block/paride/ |
H A D | pd.c | 233 int changed; /* Have we seen a disk change ? */ 250 static inline int status_reg(struct pd_unit *disk) status_reg() argument 252 return pi_read_regr(disk->pi, 1, 6); status_reg() 255 static inline int read_reg(struct pd_unit *disk, int reg) read_reg() argument 257 return pi_read_regr(disk->pi, 0, reg); read_reg() 260 static inline void write_status(struct pd_unit *disk, int val) write_status() argument 262 pi_write_regr(disk->pi, 1, 6, val); write_status() 265 static inline void write_reg(struct pd_unit *disk, int reg, int val) write_reg() argument 267 pi_write_regr(disk->pi, 0, reg, val); write_reg() 270 static inline u8 DRIVE(struct pd_unit *disk) DRIVE() argument 272 return 0xa0+0x10*disk->drive; DRIVE() 277 static void pd_print_error(struct pd_unit *disk, char *msg, int status) pd_print_error() argument 281 printk("%s: %s: status = 0x%x =", disk->name, msg, status); pd_print_error() 288 static void pd_reset(struct pd_unit *disk) pd_reset() argument 290 write_status(disk, 4); pd_reset() 292 write_status(disk, 0); pd_reset() 298 static int pd_wait_for(struct pd_unit *disk, int w, char *msg) pd_wait_for() argument 304 r = status_reg(disk); pd_wait_for() 310 e = (read_reg(disk, 1) << 8) + read_reg(disk, 7); pd_wait_for() 314 pd_print_error(disk, msg, e); pd_wait_for() 318 static void pd_send_command(struct pd_unit *disk, int n, int s, int h, int c0, int c1, int func) pd_send_command() argument 320 write_reg(disk, 6, DRIVE(disk) + h); pd_send_command() 321 write_reg(disk, 1, 0); /* the IDE task file */ pd_send_command() 322 write_reg(disk, 2, n); pd_send_command() 323 write_reg(disk, 3, s); pd_send_command() 324 write_reg(disk, 4, c0); pd_send_command() 325 write_reg(disk, 5, c1); pd_send_command() 326 write_reg(disk, 7, func); pd_send_command() 331 static void pd_ide_command(struct pd_unit *disk, int func, int block, int count) pd_ide_command() argument 335 if (disk->can_lba) { pd_ide_command() 341 s = (block % disk->sectors) + 1; pd_ide_command() 342 h = (block /= disk->sectors) % disk->heads; pd_ide_command() 343 c0 = (block /= disk->heads) % 256; pd_ide_command() 346 pd_send_command(disk, count, s, h, c0, c1, func); pd_ide_command() 587 static void pd_init_dev_parms(struct pd_unit *disk) pd_init_dev_parms() argument 589 pd_wait_for(disk, 0, DBMSG("before init_dev_parms")); pd_init_dev_parms() 590 pd_send_command(disk, disk->sectors, 0, disk->heads - 1, 0, 0, pd_init_dev_parms() 593 pd_wait_for(disk, 0, "Initialise device parameters"); pd_init_dev_parms() 596 static enum action pd_door_lock(struct pd_unit *disk) pd_door_lock() argument 598 if (!(pd_wait_for(disk, STAT_READY, "Lock") & STAT_ERR)) { pd_door_lock() 599 pd_send_command(disk, 1, 0, 0, 0, 0, IDE_DOORLOCK); pd_door_lock() 600 pd_wait_for(disk, STAT_READY, "Lock done"); pd_door_lock() 605 static enum action pd_door_unlock(struct pd_unit *disk) pd_door_unlock() argument 607 if (!(pd_wait_for(disk, STAT_READY, "Lock") & STAT_ERR)) { pd_door_unlock() 608 pd_send_command(disk, 1, 0, 0, 0, 0, IDE_DOORUNLOCK); pd_door_unlock() 609 pd_wait_for(disk, STAT_READY, "Lock done"); pd_door_unlock() 614 static enum action pd_eject(struct pd_unit *disk) pd_eject() argument 616 pd_wait_for(disk, 0, DBMSG("before unlock on eject")); pd_eject() 617 pd_send_command(disk, 1, 0, 0, 0, 0, IDE_DOORUNLOCK); pd_eject() 618 pd_wait_for(disk, 0, DBMSG("after unlock on eject")); pd_eject() 619 pd_wait_for(disk, 0, DBMSG("before eject")); pd_eject() 620 pd_send_command(disk, 0, 0, 0, 0, 0, IDE_EJECT); pd_eject() 621 pd_wait_for(disk, 0, DBMSG("after eject")); pd_eject() 625 static enum action pd_media_check(struct pd_unit *disk) pd_media_check() argument 627 int r = pd_wait_for(disk, STAT_READY, DBMSG("before media_check")); pd_media_check() 629 pd_send_command(disk, 1, 1, 0, 0, 0, IDE_READ_VRFY); pd_media_check() 630 r = pd_wait_for(disk, STAT_READY, DBMSG("RDY after READ_VRFY")); pd_media_check() 632 disk->changed = 1; /* say changed if other error */ pd_media_check() 634 disk->changed = 1; pd_media_check() 635 pd_send_command(disk, 1, 0, 0, 0, 0, IDE_ACKCHANGE); pd_media_check() 636 pd_wait_for(disk, STAT_READY, DBMSG("RDY after ACKCHANGE")); pd_media_check() 637 pd_send_command(disk, 1, 1, 0, 0, 0, IDE_READ_VRFY); pd_media_check() 638 r = pd_wait_for(disk, STAT_READY, DBMSG("RDY after VRFY")); pd_media_check() 643 static void pd_standby_off(struct pd_unit *disk) pd_standby_off() argument 645 pd_wait_for(disk, 0, DBMSG("before STANDBY")); pd_standby_off() 646 pd_send_command(disk, 0, 0, 0, 0, 0, IDE_STANDBY); pd_standby_off() 647 pd_wait_for(disk, 0, DBMSG("after STANDBY")); pd_standby_off() 650 static enum action pd_identify(struct pd_unit *disk) pd_identify() argument 661 if (disk->drive == 0) pd_identify() 662 pd_reset(disk); pd_identify() 664 write_reg(disk, 6, DRIVE(disk)); pd_identify() 665 pd_wait_for(disk, 0, DBMSG("before IDENT")); pd_identify() 666 pd_send_command(disk, 1, 0, 0, 0, 0, IDE_IDENTIFY); pd_identify() 668 if (pd_wait_for(disk, STAT_DRQ, DBMSG("IDENT DRQ")) & STAT_ERR) pd_identify() 670 pi_read_block(disk->pi, pd_scratch, 512); pd_identify() 671 disk->can_lba = pd_scratch[99] & 2; pd_identify() 672 disk->sectors = le16_to_cpu(*(__le16 *) (pd_scratch + 12)); pd_identify() 673 disk->heads = le16_to_cpu(*(__le16 *) (pd_scratch + 6)); pd_identify() 674 disk->cylinders = le16_to_cpu(*(__le16 *) (pd_scratch + 2)); pd_identify() 675 if (disk->can_lba) pd_identify() 676 disk->capacity = le32_to_cpu(*(__le32 *) (pd_scratch + 120)); pd_identify() 678 disk->capacity = disk->sectors * disk->heads * disk->cylinders; pd_identify() 688 disk->removable = pd_scratch[0] & 0x80; pd_identify() 691 disk->name, id, pd_identify() 692 disk->drive ? "slave" : "master", pd_identify() 693 disk->capacity, disk->capacity / 2048, pd_identify() 694 disk->cylinders, disk->heads, disk->sectors, pd_identify() 695 disk->removable ? "removable" : "fixed"); pd_identify() 697 if (disk->capacity) pd_identify() 698 pd_init_dev_parms(disk); pd_identify() 699 if (!disk->standby) pd_identify() 700 pd_standby_off(disk); pd_identify() 718 static int pd_special_command(struct pd_unit *disk, pd_special_command() argument 719 enum action (*func)(struct pd_unit *disk)) pd_special_command() 724 rq = blk_get_request(disk->gd->queue, READ, __GFP_WAIT); pd_special_command() 731 err = blk_execute_rq(disk->gd->queue, disk->gd, rq, 0); pd_special_command() 741 struct pd_unit *disk = bdev->bd_disk->private_data; pd_open() local 744 disk->access++; pd_open() 746 if (disk->removable) { pd_open() 747 pd_special_command(disk, pd_media_check); pd_open() 748 pd_special_command(disk, pd_door_lock); pd_open() 756 struct pd_unit *disk = bdev->bd_disk->private_data; pd_getgeo() local 758 if (disk->alt_geom) { pd_getgeo() 761 geo->cylinders = disk->capacity / (geo->heads * geo->sectors); pd_getgeo() 763 geo->heads = disk->heads; pd_getgeo() 764 geo->sectors = disk->sectors; pd_getgeo() 765 geo->cylinders = disk->cylinders; pd_getgeo() 774 struct pd_unit *disk = bdev->bd_disk->private_data; pd_ioctl() local 779 if (disk->access == 1) pd_ioctl() 780 pd_special_command(disk, pd_eject); pd_ioctl() 790 struct pd_unit *disk = p->private_data; pd_release() local 793 if (!--disk->access && disk->removable) pd_release() 794 pd_special_command(disk, pd_door_unlock); pd_release() 800 struct pd_unit *disk = p->private_data; pd_check_events() local 802 if (!disk->removable) pd_check_events() 804 pd_special_command(disk, pd_media_check); pd_check_events() 805 r = disk->changed; pd_check_events() 806 disk->changed = 0; pd_check_events() 812 struct pd_unit *disk = p->private_data; pd_revalidate() local 813 if (pd_special_command(disk, pd_identify) == 0) pd_revalidate() 814 set_capacity(p, disk->capacity); pd_revalidate() 832 static void pd_probe_drive(struct pd_unit *disk) pd_probe_drive() argument 837 strcpy(p->disk_name, disk->name); pd_probe_drive() 840 p->first_minor = (disk - pd) << PD_BITS; pd_probe_drive() 841 disk->gd = p; pd_probe_drive() 842 p->private_data = disk; pd_probe_drive() 845 if (disk->drive == -1) { pd_probe_drive() 846 for (disk->drive = 0; disk->drive <= 1; disk->drive++) pd_probe_drive() 847 if (pd_special_command(disk, pd_identify) == 0) pd_probe_drive() 849 } else if (pd_special_command(disk, pd_identify) == 0) pd_probe_drive() 851 disk->gd = NULL; pd_probe_drive() 858 struct pd_unit *disk; pd_detect() local 862 struct pd_unit *disk = pd + unit; pd_detect() local 863 disk->pi = &disk->pia; pd_detect() 864 disk->access = 0; pd_detect() 865 disk->changed = 1; pd_detect() 866 disk->capacity = 0; pd_detect() 867 disk->drive = parm[D_SLV]; pd_detect() 868 snprintf(disk->name, PD_NAMELEN, "%s%c", name, 'a'+unit); pd_detect() 869 disk->alt_geom = parm[D_GEO]; pd_detect() 870 disk->standby = parm[D_SBY]; pd_detect() 876 disk = pd; pd_detect() 877 if (pi_init(disk->pi, 1, -1, -1, -1, -1, -1, pd_scratch, pd_detect() 878 PI_PD, verbose, disk->name)) { pd_detect() 879 pd_probe_drive(disk); pd_detect() 880 if (!disk->gd) pd_detect() 881 pi_release(disk->pi); pd_detect() 885 for (unit = 0, disk = pd; unit < PD_UNITS; unit++, disk++) { pd_detect() 889 if (pi_init(disk->pi, 0, parm[D_PRT], parm[D_MOD], pd_detect() 891 pd_scratch, PI_PD, verbose, disk->name)) { pd_detect() 892 pd_probe_drive(disk); pd_detect() 893 if (!disk->gd) pd_detect() 894 pi_release(disk->pi); pd_detect() 898 for (unit = 0, disk = pd; unit < PD_UNITS; unit++, disk++) { pd_detect() 899 if (disk->gd) { pd_detect() 900 set_capacity(disk->gd, disk->capacity); pd_detect() 901 add_disk(disk->gd); pd_detect() 941 struct pd_unit *disk; pd_exit() local 944 for (unit = 0, disk = pd; unit < PD_UNITS; unit++, disk++) { pd_exit() 945 struct gendisk *p = disk->gd; pd_exit() 947 disk->gd = NULL; pd_exit() 950 pi_release(disk->pi); pd_exit()
|
H A D | pcd.c | 201 struct gendisk *disk; member in struct:pcd_unit 239 static void pcd_block_release(struct gendisk *disk, fmode_t mode) pcd_block_release() argument 241 struct pcd_unit *cd = disk->private_data; pcd_block_release() 260 static unsigned int pcd_block_check_events(struct gendisk *disk, pcd_block_check_events() argument 263 struct pcd_unit *cd = disk->private_data; pcd_block_check_events() 299 struct gendisk *disk = alloc_disk(1); pcd_init_units() local 300 if (!disk) pcd_init_units() 302 cd->disk = disk; pcd_init_units() 318 disk->major = major; pcd_init_units() 319 disk->first_minor = unit; pcd_init_units() 320 strcpy(disk->disk_name, cd->name); /* umm... */ pcd_init_units() 321 disk->fops = &pcd_bdops; pcd_init_units() 322 disk->flags = GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE; pcd_init_units() 698 if (!pcd_probe(cd, -1, id) && cd->disk) { pcd_detect() 713 if (!pcd_probe(cd, conf[D_SLV], id) && cd->disk) { pcd_detect() 725 put_disk(cd->disk); pcd_detect() 948 put_disk(cd->disk); pcd_init() 956 put_disk(cd->disk); pcd_init() 963 cd->disk->private_data = cd; pcd_init() 964 cd->disk->queue = pcd_queue; pcd_init() 965 add_disk(cd->disk); pcd_init() 979 del_gendisk(cd->disk); pcd_exit() 983 put_disk(cd->disk); pcd_exit()
|
H A D | pf.c | 5 This is the high-level driver for parallel port ATAPI disk 9 port ATAPI disk drive, but if their individual parameters are 214 static void pf_release(struct gendisk *disk, fmode_t mode); 240 struct gendisk *disk; member in struct:pf_unit 248 static unsigned int pf_check_events(struct gendisk *disk, 286 struct gendisk *disk = alloc_disk(1); pf_init_units() local 287 if (!disk) pf_init_units() 289 pf->disk = disk; pf_init_units() 295 disk->major = major; pf_init_units() 296 disk->first_minor = unit; pf_init_units() 297 strcpy(disk->disk_name, pf->name); pf_init_units() 298 disk->fops = &pf_fops; pf_init_units() 332 sector_t capacity = get_capacity(pf->disk); pf_getgeo() 363 static void pf_release(struct gendisk *disk, fmode_t mode) pf_release() argument 365 struct pf_unit *pf = disk->private_data; pf_release() 382 static unsigned int pf_check_events(struct gendisk *disk, unsigned int clearing) pf_check_events() argument 613 set_capacity(pf->disk, xl(buf, 0) + 1); pf_get_capacity() 616 set_capacity(pf->disk, 0); pf_get_capacity() 666 (unsigned long long)get_capacity(pf->disk)); pf_identify() 710 if (!pf_probe(pf) && pf->disk) { pf_detect() 725 if (pf->disk && !pf_probe(pf)) { pf_detect() 735 printk("%s: No ATAPI disk detected\n", name); pf_detect() 737 put_disk(pf->disk); pf_detect() 965 put_disk(pf->disk); pf_init() 972 put_disk(pf->disk); pf_init() 979 struct gendisk *disk = pf->disk; pf_init() local 983 disk->private_data = pf; pf_init() 984 disk->queue = pf_queue; pf_init() 985 add_disk(disk); pf_init() 998 del_gendisk(pf->disk); pf_exit() 999 put_disk(pf->disk); pf_exit()
|
/linux-4.1.27/arch/powerpc/include/uapi/asm/ |
H A D | fcntl.h | 7 #define O_DIRECT 0400000 /* direct disk access hint */
|
/linux-4.1.27/drivers/md/bcache/ |
H A D | writeback.c | 23 struct cache_set *c = dc->disk.c; __update_writeback_rate() 33 int64_t dirty = bcache_dev_sectors_dirty(&dc->disk); __update_writeback_rate() 34 int64_t derivative = dirty - dc->disk.sectors_dirty_last; __update_writeback_rate() 38 dc->disk.sectors_dirty_last = dirty; __update_writeback_rate() 47 derivative = ewma_add(dc->disk.sectors_dirty_derivative, derivative, __update_writeback_rate() 92 if (test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags) || writeback_delay() 151 atomic_inc(&PTR_BUCKET(dc->disk.c, &w->key, i)->pin); write_dirty_finish() 153 ret = bch_btree_insert(dc->disk.c, &keys, NULL, &w->key); write_dirty_finish() 159 ? &dc->disk.c->writeback_keys_failed write_dirty_finish() 160 : &dc->disk.c->writeback_keys_done); write_dirty_finish() 191 closure_bio_submit(&io->bio, cl, &io->dc->disk); write_dirty() 201 bch_count_io_errors(PTR_CACHE(io->dc->disk.c, &w->key, 0), read_dirty_endio() 211 closure_bio_submit(&io->bio, cl, &io->dc->disk); read_dirty_submit() 237 BUG_ON(ptr_stale(dc->disk.c, &w->key, 0)); read_dirty() 257 io->bio.bi_bdev = PTR_CACHE(dc->disk.c, read_dirty() 328 BUG_ON(KEY_INODE(k) != dc->disk.id); dirty_pred() 339 stripe = offset_to_stripe(&dc->disk, KEY_OFFSET(&buf->last_scanned)); refill_full_stripes() 341 if (stripe >= dc->disk.nr_stripes) refill_full_stripes() 347 stripe = find_next_bit(dc->disk.full_dirty_stripes, refill_full_stripes() 348 dc->disk.nr_stripes, stripe); refill_full_stripes() 350 if (stripe == dc->disk.nr_stripes) refill_full_stripes() 353 next_stripe = find_next_zero_bit(dc->disk.full_dirty_stripes, refill_full_stripes() 354 dc->disk.nr_stripes, stripe); refill_full_stripes() 356 buf->last_scanned = KEY(dc->disk.id, refill_full_stripes() 357 stripe * dc->disk.stripe_size, 0); refill_full_stripes() 359 bch_refill_keybuf(dc->disk.c, buf, refill_full_stripes() 360 &KEY(dc->disk.id, refill_full_stripes() 361 next_stripe * dc->disk.stripe_size, 0), refill_full_stripes() 372 if (stripe == dc->disk.nr_stripes) { refill_full_stripes() 380 * Returns true if we scanned the entire disk 385 struct bkey start = KEY(dc->disk.id, 0, 0); refill_dirty() 386 struct bkey end = KEY(dc->disk.id, MAX_KEY_OFFSET, 0); refill_dirty() 390 * make sure keybuf pos is inside the range for this disk - at bringup refill_dirty() 391 * we might not be attached yet so this disk's inode nr isn't refill_dirty() 405 bch_refill_keybuf(dc->disk.c, buf, &end, dirty_pred); refill_dirty() 415 bch_refill_keybuf(dc->disk.c, buf, &start_pos, dirty_pred); refill_dirty() 428 (!test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags) && bch_writeback_thread() 461 !test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags)) bch_writeback_thread() 496 op.inode = dc->disk.id; bch_sectors_dirty_init() 498 bch_btree_map_keys(&op.op, dc->disk.c, &KEY(op.inode, 0, 0), bch_sectors_dirty_init() 501 dc->disk.sectors_dirty_last = bcache_dev_sectors_dirty(&dc->disk); bch_sectors_dirty_init()
|
H A D | writeback.h | 28 unsigned stripe = offset_to_stripe(&dc->disk, offset); bcache_dev_stripe_dirty() 31 if (atomic_read(dc->disk.stripe_sectors_dirty + stripe)) bcache_dev_stripe_dirty() 34 if (nr_sectors <= dc->disk.stripe_size) bcache_dev_stripe_dirty() 37 nr_sectors -= dc->disk.stripe_size; bcache_dev_stripe_dirty() 45 unsigned in_use = dc->disk.c->gc_stats.in_use; should_writeback() 48 test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags) || should_writeback()
|
H A D | super.c | 491 * For each bucket, we store on disk its 504 * On disk they're stored in a packed array, and in as many buckets are required 512 * disk. 692 bd_unlink_disk_holder(ca->bdev, d->disk); bcache_device_unlink() 703 bd_link_disk_holder(ca->bdev, d->disk); bcache_device_link() 749 pr_info("%s stopped", d->disk->disk_name); bcache_device_free() 753 if (d->disk && d->disk->flags & GENHD_FL_UP) bcache_device_free() 754 del_gendisk(d->disk); bcache_device_free() 755 if (d->disk && d->disk->queue) bcache_device_free() 756 blk_cleanup_queue(d->disk->queue); bcache_device_free() 757 if (d->disk) { bcache_device_free() 758 ida_simple_remove(&bcache_minor, d->disk->first_minor); bcache_device_free() 759 put_disk(d->disk); bcache_device_free() 816 !(d->disk = alloc_disk(1))) { bcache_device_init() 821 set_capacity(d->disk, sectors); bcache_device_init() 822 snprintf(d->disk->disk_name, DISK_NAME_LEN, "bcache%i", minor); bcache_device_init() 824 d->disk->major = bcache_major; bcache_device_init() 825 d->disk->first_minor = minor; bcache_device_init() 826 d->disk->fops = &bcache_ops; bcache_device_init() 827 d->disk->private_data = d; bcache_device_init() 834 d->disk->queue = q; bcache_device_init() 846 set_bit(QUEUE_FLAG_NONROT, &d->disk->queue->queue_flags); bcache_device_init() 847 clear_bit(QUEUE_FLAG_ADD_RANDOM, &d->disk->queue->queue_flags); bcache_device_init() 848 set_bit(QUEUE_FLAG_DISCARD, &d->disk->queue->queue_flags); bcache_device_init() 870 struct bcache_device *d = &dc->disk; bch_cached_dev_run() 899 add_disk(d->disk); bch_cached_dev_run() 900 bd_link_disk_holder(dc->bdev, dc->disk.disk); bch_cached_dev_run() 903 kobject_uevent_env(&disk_to_dev(d->disk)->kobj, KOBJ_CHANGE, env); bch_cached_dev_run() 907 if (sysfs_create_link(&d->kobj, &disk_to_dev(d->disk)->kobj, "dev") || bch_cached_dev_run() 908 sysfs_create_link(&disk_to_dev(d->disk)->kobj, &d->kobj, "bcache")) bch_cached_dev_run() 919 BUG_ON(!test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags)); cached_dev_detach_finish() 930 bcache_device_detach(&dc->disk); cached_dev_detach_finish() 933 clear_bit(BCACHE_DEV_DETACHING, &dc->disk.flags); cached_dev_detach_finish() 934 clear_bit(BCACHE_DEV_UNLINK_DONE, &dc->disk.flags); cached_dev_detach_finish() 941 closure_put(&dc->disk.cl); cached_dev_detach_finish() 948 if (test_bit(BCACHE_DEV_CLOSING, &dc->disk.flags)) bch_cached_dev_detach() 951 if (test_and_set_bit(BCACHE_DEV_DETACHING, &dc->disk.flags)) bch_cached_dev_detach() 958 closure_get(&dc->disk.cl); bch_cached_dev_detach() 975 if (dc->disk.c) { bch_cached_dev_attach() 1038 bcache_device_attach(&dc->disk, c, u - c->uuids); bch_cached_dev_attach() 1064 bcache_device_link(&dc->disk, c, "bdev"); bch_cached_dev_attach() 1070 bdevname(dc->bdev, buf), dc->disk.disk->disk_name, bch_cached_dev_attach() 1071 dc->disk.c->sb.set_uuid); bch_cached_dev_attach() 1078 disk.kobj); bch_cached_dev_release() 1085 struct cached_dev *dc = container_of(cl, struct cached_dev, disk.cl); cached_dev_free() 1094 bd_unlink_disk_holder(dc->bdev, dc->disk.disk); cached_dev_free() 1095 bcache_device_free(&dc->disk); cached_dev_free() 1105 kobject_put(&dc->disk.kobj); cached_dev_free() 1110 struct cached_dev *dc = container_of(cl, struct cached_dev, disk.cl); cached_dev_flush() 1111 struct bcache_device *d = &dc->disk; cached_dev_flush() 1131 closure_init(&dc->disk.cl, NULL); cached_dev_init() 1132 set_closure_fn(&dc->disk.cl, cached_dev_flush, system_wq); cached_dev_init() 1133 kobject_init(&dc->disk.kobj, &bch_cached_dev_ktype); cached_dev_init() 1138 bch_cache_accounting_init(&dc->accounting, &dc->disk.cl); cached_dev_init() 1147 dc->disk.stripe_size = q->limits.io_opt >> 9; cached_dev_init() 1149 if (dc->disk.stripe_size) cached_dev_init() 1153 ret = bcache_device_init(&dc->disk, block_size, cached_dev_init() 1158 set_capacity(dc->disk.disk, cached_dev_init() 1161 dc->disk.disk->queue->backing_dev_info.ra_pages = cached_dev_init() 1162 max(dc->disk.disk->queue->backing_dev_info.ra_pages, cached_dev_init() 1194 if (kobject_add(&dc->disk.kobj, &part_to_dev(bdev->bd_part)->kobj, register_bdev() 1197 if (bch_cache_accounting_add_kobjs(&dc->accounting, &dc->disk.kobj)) register_bdev() 1213 bcache_device_stop(&dc->disk); register_bdev() 1262 add_disk(d->disk); flash_dev_run() 1264 if (kobject_add(&d->kobj, &disk_to_dev(d->disk)->kobj, "bcache")) flash_dev_run() 1455 struct cached_dev, disk); __cache_set_unregister() 2064 bcache_device_stop(&dc->disk); bcache_reboot()
|
H A D | sysfs.c | 112 disk.kobj); SHOW() 122 sysfs_printf(data_csum, "%i", dc->disk.data_csum); SHOW() 145 bch_hprint(dirty, bcache_dev_sectors_dirty(&dc->disk) << 9); SHOW() 167 bcache_dev_sectors_dirty(&dc->disk) << 9); SHOW() 169 sysfs_hprint(stripe_size, dc->disk.stripe_size << 9); SHOW() 193 disk.kobj); SHOW_LOCKED() 202 sysfs_strtoul(data_csum, dc->disk.data_csum); SHOW_LOCKED() 249 if (dc->disk.c) { SHOW_LOCKED() 250 memcpy(dc->disk.c->uuids[dc->disk.id].label, SHOW_LOCKED() 252 bch_uuid_write(dc->disk.c); SHOW_LOCKED() 261 &disk_to_dev(dc->disk.disk)->kobj, KOBJ_CHANGE, env->envp); SHOW_LOCKED() 279 if (attr == &sysfs_detach && dc->disk.c) SHOW_LOCKED() 283 bcache_device_stop(&dc->disk); SHOW_LOCKED() 291 disk.kobj); STORE() 374 set_capacity(d->disk, u->sectors); STORE()
|
H A D | request.c | 367 struct cache_set *c = dc->disk.c; check_should_bypass() 373 if (test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags) || check_should_bypass() 605 &s->d->disk->part0, s->start_time); bio_complete() 673 struct cached_dev *dc = container_of(s->d, struct cached_dev, disk); cached_dev_bio_complete() 722 struct cached_dev *dc = container_of(s->d, struct cached_dev, disk); cached_dev_read_done() 762 struct cached_dev *dc = container_of(s->d, struct cached_dev, disk); cached_dev_read_done_bh() 781 struct cached_dev *dc = container_of(s->d, struct cached_dev, disk); cached_dev_cache_miss() 815 dc->disk.bio_split); cached_dev_cache_miss() 861 struct cached_dev *dc = container_of(s->d, struct cached_dev, disk); cached_dev_write_complete() 871 struct bkey start = KEY(dc->disk.id, bio->bi_iter.bi_sector, 0); cached_dev_write() 872 struct bkey end = KEY(dc->disk.id, bio_end_sector(bio), 0); cached_dev_write() 917 dc->disk.bio_split); cached_dev_write() 927 s->iop.bio = bio_clone_fast(bio, GFP_NOIO, dc->disk.bio_split); cached_dev_write() 956 struct cached_dev *dc = container_of(d, struct cached_dev, disk); cached_dev_make_request() 959 generic_start_io_acct(rw, bio_sectors(bio), &d->disk->part0); cached_dev_make_request() 996 struct cached_dev *dc = container_of(d, struct cached_dev, disk); cached_dev_ioctl() 1003 struct cached_dev *dc = container_of(d, struct cached_dev, disk); cached_dev_congested() 1027 struct gendisk *g = dc->disk.disk; bch_cached_dev_request_init() 1031 dc->disk.cache_miss = cached_dev_cache_miss; bch_cached_dev_request_init() 1032 dc->disk.ioctl = cached_dev_ioctl; bch_cached_dev_request_init() 1071 generic_start_io_acct(rw, bio_sectors(bio), &d->disk->part0); flash_dev_make_request() 1128 struct gendisk *g = d->disk; bch_flash_dev_request_init()
|
H A D | stats.c | 201 struct cached_dev *dc = container_of(d, struct cached_dev, disk); bch_mark_cache_accounting() 208 struct cached_dev *dc = container_of(d, struct cached_dev, disk); bch_mark_cache_readahead() 215 struct cached_dev *dc = container_of(d, struct cached_dev, disk); bch_mark_cache_miss_collision()
|
H A D | debug.c | 84 printk(KERN_ERR "*** on disk block %u:\n", block); for_each_written_bset() 129 dc->disk.c, bio_for_each_segment()
|
/linux-4.1.27/fs/quota/ |
H A D | quotaio_v1.h | 16 * The following structure defines the format of the disk quota file 17 * (as it appears on disk) - the file is an array of these structures 21 __u32 dqb_bhardlimit; /* absolute limit on disk blks alloc */ 22 __u32 dqb_bsoftlimit; /* preferred limit on disk blks */ 27 time_t dqb_btime; /* time limit for excessive disk use */
|
H A D | quotaio_v2.h | 33 * The following structure defines the format of the disk quota file 34 * (as it appears on disk) - the file is a radix tree whose leaves point 42 __le32 dqb_bhardlimit; /* absolute limit on disk space (in QUOTABLOCK_SIZE) */ 43 __le32 dqb_bsoftlimit; /* preferred limit on disk space (in QUOTABLOCK_SIZE) */ 45 __le64 dqb_btime; /* time limit for excessive disk use */ 55 __le64 dqb_bhardlimit; /* absolute limit on disk space (in QUOTABLOCK_SIZE) */ 56 __le64 dqb_bsoftlimit; /* preferred limit on disk space (in QUOTABLOCK_SIZE) */ 58 __le64 dqb_btime; /* time limit for excessive disk use */
|
/linux-4.1.27/arch/powerpc/sysdev/ |
H A D | axonram.c | 63 struct gendisk *disk; member in struct:axon_ram_bank 214 bank->disk = alloc_disk(AXON_RAM_MINORS_PER_DISK); axon_ram_probe() 215 if (bank->disk == NULL) { axon_ram_probe() 216 dev_err(&device->dev, "Cannot register disk\n"); axon_ram_probe() 221 bank->disk->major = azfs_major; axon_ram_probe() 222 bank->disk->first_minor = azfs_minor; axon_ram_probe() 223 bank->disk->fops = &axon_ram_devops; axon_ram_probe() 224 bank->disk->private_data = bank; axon_ram_probe() 225 bank->disk->driverfs_dev = &device->dev; axon_ram_probe() 227 sprintf(bank->disk->disk_name, "%s%d", axon_ram_probe() 230 bank->disk->queue = blk_alloc_queue(GFP_KERNEL); axon_ram_probe() 231 if (bank->disk->queue == NULL) { axon_ram_probe() 232 dev_err(&device->dev, "Cannot register disk queue\n"); axon_ram_probe() 237 set_capacity(bank->disk, bank->size >> AXON_RAM_SECTOR_SHIFT); axon_ram_probe() 238 blk_queue_make_request(bank->disk->queue, axon_ram_make_request); axon_ram_probe() 239 blk_queue_logical_block_size(bank->disk->queue, AXON_RAM_SECTOR_SIZE); axon_ram_probe() 240 add_disk(bank->disk); axon_ram_probe() 250 AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device); axon_ram_probe() 265 azfs_minor += bank->disk->minors; axon_ram_probe() 273 if (bank->disk != NULL) { axon_ram_probe() 274 if (bank->disk->major > 0) axon_ram_probe() 275 unregister_blkdev(bank->disk->major, axon_ram_probe() 276 bank->disk->disk_name); axon_ram_probe() 277 del_gendisk(bank->disk); axon_ram_probe() 297 BUG_ON(!bank || !bank->disk); axon_ram_remove() 301 del_gendisk(bank->disk); axon_ram_remove()
|
/linux-4.1.27/drivers/block/ |
H A D | nbd.c | 56 struct gendisk *disk; member in struct:nbd_device 84 return disk_to_dev(nbd->disk); nbd_to_dev() 121 dev_warn(disk_to_dev(nbd->disk), "shutting down socket\n"); sock_shutdown() 152 dev_err(disk_to_dev(nbd->disk), sock_xmit() 250 dev_err(disk_to_dev(nbd->disk), nbd_send_req() 270 dev_err(disk_to_dev(nbd->disk), rq_for_each_segment() 323 dev_err(disk_to_dev(nbd->disk), nbd_read_stat() 329 dev_err(disk_to_dev(nbd->disk), "Wrong magic (0x%lx)\n", nbd_read_stat() 341 dev_err(disk_to_dev(nbd->disk), "Unexpected reply (%p)\n", nbd_read_stat() 348 dev_err(disk_to_dev(nbd->disk), "Other side returned error (%d)\n", nbd_read_stat() 362 dev_err(disk_to_dev(nbd->disk), "Receive data failed (result %d)\n", rq_for_each_segment() 380 struct gendisk *disk = dev_to_disk(dev); pid_show() local 383 (long) ((struct nbd_device *)disk->private_data)->pid); pid_show() 400 ret = device_create_file(disk_to_dev(nbd->disk), &pid_attr); nbd_do_it() 402 dev_err(disk_to_dev(nbd->disk), "device_create_file failed!\n"); nbd_do_it() 410 device_remove_file(disk_to_dev(nbd->disk), &pid_attr); nbd_do_it() 463 dev_err(disk_to_dev(nbd->disk), nbd_handle_req() 479 dev_err(disk_to_dev(nbd->disk), nbd_handle_req() 487 dev_err(disk_to_dev(nbd->disk), "Request send failed\n"); nbd_handle_req() 560 dev_err(disk_to_dev(nbd->disk), 587 dev_info(disk_to_dev(nbd->disk), "NBD_DISCONNECT\n"); __nbd_ioctl() 641 set_capacity(nbd->disk, nbd->bytesize >> 9); __nbd_ioctl() 648 set_capacity(nbd->disk, nbd->bytesize >> 9); __nbd_ioctl() 663 set_capacity(nbd->disk, nbd->bytesize >> 9); __nbd_ioctl() 682 nbd->disk->queue); __nbd_ioctl() 684 blk_queue_flush(nbd->disk->queue, REQ_FLUSH); __nbd_ioctl() 686 blk_queue_flush(nbd->disk->queue, 0); __nbd_ioctl() 689 nbd->disk->disk_name); __nbd_ioctl() 705 dev_warn(disk_to_dev(nbd->disk), "queue cleared\n"); __nbd_ioctl() 707 queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, nbd->disk->queue); __nbd_ioctl() 714 set_capacity(nbd->disk, 0); __nbd_ioctl() 730 dev_info(disk_to_dev(nbd->disk), __nbd_ioctl() 791 * for the whole disk. nbd_init() 807 struct gendisk *disk = alloc_disk(1 << part_shift); nbd_init() local 808 if (!disk) nbd_init() 810 nbd_dev[i].disk = disk; nbd_init() 816 disk->queue = blk_init_queue(do_nbd_request, &nbd_lock); nbd_init() 817 if (!disk->queue) { nbd_init() 818 put_disk(disk); nbd_init() 824 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, disk->queue); nbd_init() 825 queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, disk->queue); nbd_init() 826 disk->queue->limits.discard_granularity = 512; nbd_init() 827 disk->queue->limits.max_discard_sectors = UINT_MAX; nbd_init() 828 disk->queue->limits.discard_zeroes_data = 0; nbd_init() 829 blk_queue_max_hw_sectors(disk->queue, 65536); nbd_init() 830 disk->queue->limits.max_sectors = 256; nbd_init() 841 struct gendisk *disk = nbd_dev[i].disk; nbd_init() local 851 disk->major = NBD_MAJOR; nbd_init() 852 disk->first_minor = i << part_shift; nbd_init() 853 disk->fops = &nbd_fops; nbd_init() 854 disk->private_data = &nbd_dev[i]; nbd_init() 855 sprintf(disk->disk_name, "nbd%d", i); nbd_init() 856 set_capacity(disk, 0); nbd_init() 857 add_disk(disk); nbd_init() 863 blk_cleanup_queue(nbd_dev[i].disk->queue); nbd_init() 864 put_disk(nbd_dev[i].disk); nbd_init() 874 struct gendisk *disk = nbd_dev[i].disk; nbd_cleanup() local 876 if (disk) { nbd_cleanup() 877 del_gendisk(disk); nbd_cleanup() 878 blk_cleanup_queue(disk->queue); nbd_cleanup() 879 put_disk(disk); nbd_cleanup()
|
H A D | hd.c | 304 static void hd_out(struct hd_i_struct *disk, hd_out() argument 320 if (!controller_ready(disk->unit, head)) { hd_out() 325 outb_p(disk->ctl, HD_CMD); hd_out() 327 outb_p(disk->wpcom >> 2, ++port); hd_out() 332 outb_p(0xA0 | (disk->unit << 4) | head, ++port); hd_out() 381 struct hd_i_struct *disk = &hd_info[i]; reset_hd() local 382 disk->special_op = disk->recalibrate = 1; reset_hd() 383 hd_out(disk, disk->sect, disk->sect, disk->head-1, reset_hd() 384 disk->cyl, ATA_CMD_INIT_DEV_PARAMS, &reset_hd); reset_hd() 420 struct hd_i_struct *disk = req->rq_disk->private_data; bad_rw_intr() local 423 disk->special_op = disk->recalibrate = 1; bad_rw_intr() 427 disk->special_op = disk->recalibrate = 1; bad_rw_intr() 554 static int do_special_op(struct hd_i_struct *disk, struct request *req) do_special_op() argument 556 if (disk->recalibrate) { do_special_op() 557 disk->recalibrate = 0; do_special_op() 558 hd_out(disk, disk->sect, 0, 0, 0, ATA_CMD_RESTORE, &recal_intr); do_special_op() 561 if (disk->head > 16) { do_special_op() 565 disk->special_op = 0; do_special_op() 582 struct hd_i_struct *disk; hd_request() local 603 disk = req->rq_disk->private_data; hd_request() 614 if (disk->special_op) { hd_request() 615 if (do_special_op(disk, req)) hd_request() 619 sec = block % disk->sect + 1; hd_request() 620 track = block / disk->sect; hd_request() 621 head = track % disk->head; hd_request() 622 cyl = track / disk->head; hd_request() 632 hd_out(disk, nsect, sec, head, cyl, ATA_CMD_PIO_READ, hd_request() 638 hd_out(disk, nsect, sec, head, cyl, ATA_CMD_PIO_WRITE, hd_request() 663 struct hd_i_struct *disk = bdev->bd_disk->private_data; hd_getgeo() local 665 geo->heads = disk->head; hd_getgeo() 666 geo->sectors = disk->sect; hd_getgeo() 667 geo->cylinders = disk->cyl; hd_getgeo() 736 struct gendisk *disk = alloc_disk(64); hd_init() local 738 if (!disk) hd_init() 740 disk->major = HD_MAJOR; hd_init() 741 disk->first_minor = drive << 6; hd_init() 742 disk->fops = &hd_fops; hd_init() 743 sprintf(disk->disk_name, "hd%c", 'a'+drive); hd_init() 744 disk->private_data = p; hd_init() 745 set_capacity(disk, p->head * p->sect * p->cyl); hd_init() 746 disk->queue = hd_queue; hd_init() 748 hd_gendisk[drive] = disk; hd_init() 750 disk->disk_name, (unsigned long)get_capacity(disk)/2048, hd_init() 755 printk("hd: unable to get IRQ%d for the hard disk driver\n", hd_init()
|
H A D | virtio_blk.c | 34 /* The disk structure for the kernel. */ 35 struct gendisk *disk; member in struct:virtio_blk 156 blk_mq_start_stopped_hw_queues(vblk->disk->queue, true); virtblk_done() 234 /* return id (s/n) string for *disk to *id_str 236 static int virtblk_get_id(struct gendisk *disk, char *id_str) virtblk_get_id() argument 238 struct virtio_blk *vblk = disk->private_data; virtblk_get_id() 243 bio = bio_map_kern(vblk->disk->queue, id_str, VIRTIO_BLK_ID_BYTES, virtblk_get_id() 248 req = blk_make_request(vblk->disk->queue, bio, GFP_KERNEL); virtblk_get_id() 255 err = blk_execute_rq(vblk->disk->queue, vblk->disk, req, false); virtblk_get_id() 264 struct gendisk *disk = bdev->bd_disk; virtblk_ioctl() local 265 struct virtio_blk *vblk = disk->private_data; virtblk_ioctl() 318 struct gendisk *disk = dev_to_disk(dev); virtblk_serial_show() local 325 err = virtblk_get_id(disk, buf); virtblk_serial_show() 342 struct request_queue *q = vblk->disk->queue; virtblk_config_changed_work() 368 set_capacity(vblk->disk, capacity); virtblk_config_changed_work() 369 revalidate_disk(vblk->disk); virtblk_config_changed_work() 370 kobject_uevent_env(&disk_to_dev(vblk->disk)->kobj, KOBJ_CHANGE, envp); virtblk_config_changed_work() 493 blk_queue_flush(vblk->disk->queue, REQ_FLUSH); virtblk_update_cache_mode() 495 blk_queue_flush(vblk->disk->queue, 0); virtblk_update_cache_mode() 497 revalidate_disk(vblk->disk); virtblk_update_cache_mode() 508 struct gendisk *disk = dev_to_disk(dev); virtblk_cache_type_store() local 509 struct virtio_blk *vblk = disk->private_data; virtblk_cache_type_store() 530 struct gendisk *disk = dev_to_disk(dev); virtblk_cache_type_show() local 531 struct virtio_blk *vblk = disk->private_data; virtblk_cache_type_show() 616 vblk->disk = alloc_disk(1 << PART_BITS); virtblk_probe() 617 if (!vblk->disk) { virtblk_probe() 645 q = vblk->disk->queue = blk_mq_init_queue(&vblk->tag_set); virtblk_probe() 653 virtblk_name_format("vd", index, vblk->disk->disk_name, DISK_NAME_LEN); virtblk_probe() 655 vblk->disk->major = major; virtblk_probe() 656 vblk->disk->first_minor = index_to_minor(index); virtblk_probe() 657 vblk->disk->private_data = vblk; virtblk_probe() 658 vblk->disk->fops = &virtblk_fops; virtblk_probe() 659 vblk->disk->driverfs_dev = &vdev->dev; virtblk_probe() 665 /* If disk is read-only in the host, the guest should obey */ virtblk_probe() 667 set_disk_ro(vblk->disk, 1); virtblk_probe() 678 set_capacity(vblk->disk, cap); virtblk_probe() 735 add_disk(vblk->disk); virtblk_probe() 736 err = device_create_file(disk_to_dev(vblk->disk), &dev_attr_serial); virtblk_probe() 741 err = device_create_file(disk_to_dev(vblk->disk), virtblk_probe() 744 err = device_create_file(disk_to_dev(vblk->disk), virtblk_probe() 751 del_gendisk(vblk->disk); virtblk_probe() 752 blk_cleanup_queue(vblk->disk->queue); virtblk_probe() 756 put_disk(vblk->disk); virtblk_probe() 776 del_gendisk(vblk->disk); virtblk_remove() 777 blk_cleanup_queue(vblk->disk->queue); virtblk_remove() 784 refc = atomic_read(&disk_to_dev(vblk->disk)->kobj.kref.refcount); virtblk_remove() 785 put_disk(vblk->disk); virtblk_remove() 806 blk_mq_stop_hw_queues(vblk->disk->queue); virtblk_freeze() 823 blk_mq_start_stopped_hw_queues(vblk->disk->queue, true); virtblk_restore()
|
H A D | osdblk.c | 106 struct gendisk *disk; /* blkdev's gendisk and rq */ member in struct:osdblk_device 383 struct gendisk *disk = osdev->disk; osdblk_free_disk() local 385 if (!disk) osdblk_free_disk() 388 if (disk->flags & GENHD_FL_UP) osdblk_free_disk() 389 del_gendisk(disk); osdblk_free_disk() 390 if (disk->queue) osdblk_free_disk() 391 blk_cleanup_queue(disk->queue); osdblk_free_disk() 392 put_disk(disk); osdblk_free_disk() 397 struct gendisk *disk; osdblk_init_disk() local 408 disk = alloc_disk(OSDBLK_MINORS_PER_MAJOR); osdblk_init_disk() 409 if (!disk) osdblk_init_disk() 412 sprintf(disk->disk_name, DRV_NAME "%d", osdev->id); osdblk_init_disk() 413 disk->major = osdev->major; osdblk_init_disk() 414 disk->first_minor = 0; osdblk_init_disk() 415 disk->fops = &osdblk_bd_ops; osdblk_init_disk() 416 disk->private_data = osdev; osdblk_init_disk() 421 put_disk(disk); osdblk_init_disk() 429 put_disk(disk); osdblk_init_disk() 442 disk->queue = q; osdblk_init_disk() 446 osdev->disk = disk; osdblk_init_disk() 449 /* finally, announce the disk to the world */ osdblk_init_disk() 450 set_capacity(disk, obj_size / 512ULL); osdblk_init_disk() 451 add_disk(disk); osdblk_init_disk() 454 disk->disk_name, (unsigned long long)obj_size); osdblk_init_disk()
|
H A D | pmem.c | 124 struct gendisk *disk; pmem_alloc() local 158 disk = alloc_disk(PMEM_MINORS); pmem_alloc() 159 if (!disk) pmem_alloc() 164 disk->major = pmem_major; pmem_alloc() 165 disk->first_minor = PMEM_MINORS * idx; pmem_alloc() 166 disk->fops = &pmem_fops; pmem_alloc() 167 disk->private_data = pmem; pmem_alloc() 168 disk->queue = pmem->pmem_queue; pmem_alloc() 169 disk->flags = GENHD_FL_EXT_DEVT; pmem_alloc() 170 sprintf(disk->disk_name, "pmem%d", idx); pmem_alloc() 171 disk->driverfs_dev = dev; pmem_alloc() 172 set_capacity(disk, pmem->size >> 9); pmem_alloc() 173 pmem->pmem_disk = disk; pmem_alloc() 175 add_disk(disk); pmem_alloc()
|
H A D | ataflop.c | 13 * - Autodetection of disk format (DD/HD); untested yet, because I 32 * the FDC will otherwise wait forever when no disk is inserted... 36 * - more/other disk formats 41 * - Make disk format numbering independent from minors 47 * - disk formatting 60 * - Maybe a better strategy for disk change detection (does anyone 99 { "D820", 10,1640, 0, 0}, /* 3: DD disk with 82 tracks/10 sectors */ 147 /* Array for translating minors into disk formats */ 189 * Maximum disk size (in kilobytes). This default is used whenever the 190 * current disk size is unknown. 203 * restored upon disk change by floppy_revalidate() if valid (as seen by 213 struct atari_disk_type *disktype; /* current type of disk */ 219 disk change detection) */ 221 struct gendisk *disk; member in struct:atari_floppy_struct 259 * of the disk to save read operations. These are two separate buffers 372 static void floppy_release(struct gendisk *disk, fmode_t mode); 426 * clock speed for this disk's type. 504 /* Test again later; if tested too often, it seems there is no disk fd_motor_off_timer() 506 * at least until a disk is inserted). So we'll test only twice fd_motor_off_timer() 514 /* This function is repeatedly called to detect disk changes (as good 955 /* If reading a whole track, wait about one disk rotation and fd_rwsec() 1074 /* try another disk type */ fd_rwsec_done1() 1076 set_capacity(unit[SelectedDrive].disk, fd_rwsec_done1() 1091 set_capacity(unit[SelectedDrive].disk, fd_rwsec_done1() 1262 * FDC status register accessible for check_change. If the last disk 1296 /* If the check for a disk change is done too early after this finish_fdc_done() 1313 /* The detection of disk changes is a dark chapter in Atari history :-( 1320 * filesystem used on the disk and thus the contents of block 0. I've 1321 * chosen the method to always say "The disk was changed" if it is 1323 * invalidates the disk buffers if you work with write protected 1325 * due to unrecognised disk changes. 1328 static unsigned int floppy_check_events(struct gendisk *disk, floppy_check_events() argument 1331 struct atari_floppy_struct *p = disk->private_data; floppy_check_events() 1351 static int floppy_revalidate(struct gendisk *disk) floppy_revalidate() argument 1353 struct atari_floppy_struct *p = disk->private_data; floppy_revalidate() 1407 q = unit[fdc_queue].disk->queue; set_next_request() 1454 set_capacity(floppy->disk, UDT->blocks); redo_fd_request() 1459 /* user supplied disk type */ redo_fd_request() 1461 printk(KERN_WARNING "fd%d: invalid disk format", drive ); redo_fd_request() 1466 printk(KERN_WARNING "fd%d: unsupported disk format", drive ); redo_fd_request() 1472 set_capacity(floppy->disk, UDT->blocks); redo_fd_request() 1512 struct gendisk *disk = bdev->bd_disk; fd_locked_ioctl() local 1513 struct atari_floppy_struct *floppy = disk->private_data; fd_locked_ioctl() 1559 * disk change and subsequent revalidate()! simple fd_locked_ioctl() 1574 if (floppy_check_events(disk, 0)) fd_locked_ioctl() 1575 floppy_revalidate(disk); fd_locked_ioctl() 1612 set_capacity(floppy->disk, UDT->blocks); fd_locked_ioctl() 1628 /* no matching disk type found above - setting user_params */ fd_locked_ioctl() 1634 /* set user type (reset by disk change!) */ fd_locked_ioctl() 1658 set_capacity(floppy->disk, UDT->blocks); fd_locked_ioctl() 1681 set_capacity(floppy->disk, MAX_DISK_SIZE * 2); fd_locked_ioctl() 1743 * whether a disk is inserted). This is done by issuing a restore 1745 * head across the whole disk) and looking at the state of the "TR00" 1795 * floppies, additionally start the disk-change and motor-off timers. 1889 static void floppy_release(struct gendisk *disk, fmode_t mode) floppy_release() argument 1891 struct atari_floppy_struct *p = disk->private_data; floppy_release() 1918 return get_disk(unit[drive].disk); floppy_find() 1933 unit[i].disk = alloc_disk(1); atari_floppy_init() 1934 if (!unit[i].disk) atari_floppy_init() 1962 unit[i].disk->major = FLOPPY_MAJOR; atari_floppy_init() 1963 unit[i].disk->first_minor = i; atari_floppy_init() 1964 sprintf(unit[i].disk->disk_name, "fd%d", i); atari_floppy_init() 1965 unit[i].disk->fops = &floppy_fops; atari_floppy_init() 1966 unit[i].disk->private_data = &unit[i]; atari_floppy_init() 1967 unit[i].disk->queue = blk_init_queue(do_fd_request, atari_floppy_init() 1969 if (!unit[i].disk->queue) atari_floppy_init() 1971 set_capacity(unit[i].disk, MAX_DISK_SIZE * 2); atari_floppy_init() 1972 add_disk(unit[i].disk); atari_floppy_init() 1986 struct request_queue *q = unit[i].disk->queue; atari_floppy_init() 1988 put_disk(unit[i].disk); atari_floppy_init() 2041 struct request_queue *q = unit[i].disk->queue; atari_floppy_exit() 2043 del_gendisk(unit[i].disk); atari_floppy_exit() 2044 put_disk(unit[i].disk); atari_floppy_exit()
|
H A D | null_blk.c | 34 struct gendisk *disk; member in struct:nullb 401 del_gendisk(nullb->disk); null_del_dev() 405 put_disk(nullb->disk); null_del_dev() 414 static void null_release(struct gendisk *disk, fmode_t mode) null_release() argument 499 struct gendisk *disk; null_add_dev() local 564 disk = nullb->disk = alloc_disk_node(1, home_node); null_add_dev() 565 if (!disk) { null_add_dev() 580 set_capacity(disk, size); null_add_dev() 582 disk->flags |= GENHD_FL_EXT_DEVT | GENHD_FL_SUPPRESS_PARTITION_INFO; null_add_dev() 583 disk->major = null_major; null_add_dev() 584 disk->first_minor = nullb->index; null_add_dev() 585 disk->fops = &null_fops; null_add_dev() 586 disk->private_data = nullb; null_add_dev() 587 disk->queue = nullb->q; null_add_dev() 588 sprintf(disk->disk_name, "nullb%d", nullb->index); null_add_dev() 589 add_disk(disk); null_add_dev()
|
H A D | swim.c | 192 struct gendisk *disk; member in struct:floppy_state 676 static void floppy_release(struct gendisk *disk, fmode_t mode) floppy_release() argument 678 struct floppy_state *fs = disk->private_data; floppy_release() 741 static unsigned int floppy_check_events(struct gendisk *disk, floppy_check_events() argument 744 struct floppy_state *fs = disk->private_data; floppy_check_events() 749 static int floppy_revalidate(struct gendisk *disk) floppy_revalidate() argument 751 struct floppy_state *fs = disk->private_data; floppy_revalidate() 786 return get_disk(swd->unit[drive].disk); floppy_find() 837 swd->unit[drive].disk = alloc_disk(1); swim_floppy_init() 838 if (swd->unit[drive].disk == NULL) { swim_floppy_init() 853 swd->unit[drive].disk->flags = GENHD_FL_REMOVABLE; swim_floppy_init() 854 swd->unit[drive].disk->major = FLOPPY_MAJOR; swim_floppy_init() 855 swd->unit[drive].disk->first_minor = drive; swim_floppy_init() 856 sprintf(swd->unit[drive].disk->disk_name, "fd%d", drive); swim_floppy_init() 857 swd->unit[drive].disk->fops = &floppy_fops; swim_floppy_init() 858 swd->unit[drive].disk->private_data = &swd->unit[drive]; swim_floppy_init() 859 swd->unit[drive].disk->queue = swd->queue; swim_floppy_init() 860 set_capacity(swd->unit[drive].disk, 2880); swim_floppy_init() 861 add_disk(swd->unit[drive].disk); swim_floppy_init() 872 put_disk(swd->unit[drive].disk); swim_floppy_init() 945 del_gendisk(swd->unit[drive].disk); swim_remove() 946 put_disk(swd->unit[drive].disk); swim_remove()
|
H A D | swim3.c | 193 int secpercyl; /* disk geometry information */ 255 static void floppy_release(struct gendisk *disk, fmode_t mode); 256 static unsigned int floppy_check_events(struct gendisk *disk, 258 static int floppy_revalidate(struct gendisk *disk); 357 swim3_dbg("%s", " disk ejected\n"); start_request() 366 swim3_dbg("%s", " try to write, disk write protected\n"); start_request() 1024 static void floppy_release(struct gendisk *disk, fmode_t mode) floppy_release() argument 1026 struct floppy_state *fs = disk->private_data; floppy_release() 1038 static unsigned int floppy_check_events(struct gendisk *disk, floppy_check_events() argument 1041 struct floppy_state *fs = disk->private_data; floppy_check_events() 1045 static int floppy_revalidate(struct gendisk *disk) floppy_revalidate() argument 1047 struct floppy_state *fs = disk->private_data; floppy_revalidate() 1206 struct gendisk *disk; swim3_attach() local 1217 /* Now register that disk. Same comment about failure handling */ swim3_attach() 1218 disk = disks[index] = alloc_disk(1); swim3_attach() 1219 if (disk == NULL) swim3_attach() 1221 disk->queue = blk_init_queue(do_fd_request, &swim3_lock); swim3_attach() 1222 if (disk->queue == NULL) { swim3_attach() 1223 put_disk(disk); swim3_attach() 1226 disk->queue->queuedata = &floppy_states[index]; swim3_attach() 1236 disk->major = FLOPPY_MAJOR; swim3_attach() 1237 disk->first_minor = index; swim3_attach() 1238 disk->fops = &floppy_fops; swim3_attach() 1239 disk->private_data = &floppy_states[index]; swim3_attach() 1240 disk->flags |= GENHD_FL_REMOVABLE; swim3_attach() 1241 sprintf(disk->disk_name, "fd%d", index); swim3_attach() 1242 set_capacity(disk, 2880); swim3_attach() 1243 add_disk(disk); swim3_attach()
|
H A D | amiflop.c | 33 * needed for the disk mechanic. 35 * february 1996 fixed error recovery and multiple disk access 97 #define FD_NOTREADY 4 /* unit is not ready (motor not on/no disk) */ 170 #define RAW_BUF_SIZE 30000 /* size of raw disk data */ 531 /* loop and read disk ID */ fd_get_drive_id() 658 * written to disk and vice versa. 814 static unsigned long *putsec(int disk, unsigned long *raw, int cnt) putsec() argument 819 disk&=3; putsec() 825 hdr.track = unit[disk].track; putsec() 827 hdr.ord = unit[disk].dtype->sects * unit[disk].type->sect_mult - cnt; putsec() 832 hdr.datachk = checksum((ulong *)(unit[disk].trackbuf+cnt*512), 512); putsec() 842 encode_block(raw, (ulong *)(unit[disk].trackbuf+cnt*512), 512); putsec() 848 static void amiga_write(int disk) amiga_write() argument 853 disk&=3; amiga_write() 855 for (cnt = 0; cnt < 415 * unit[disk].type->sect_mult; cnt++) amiga_write() 859 for (cnt = 0; cnt < unit[disk].dtype->sects * unit[disk].type->sect_mult; cnt++) amiga_write() 860 ptr = putsec (disk, ptr, cnt); amiga_write() 1095 "%d, unit %d for sector%d, disk sector %d\n", dos_read() 1205 static void dos_write(int disk) dos_write() argument 1211 disk&=3; dos_write() 1217 if (unit[disk].type->sect_mult==2) /* check for HD-Disks */ dos_write() 1232 for(cnt = 0; cnt < unit[disk].dtype->sects * unit[disk].type->sect_mult; cnt++) dos_write() 1233 ptr=ms_putsec(disk,ptr,cnt); dos_write() 1261 printk (KERN_NOTICE "floppy disk write protected\n"); flush_track_callback() 1286 printk (KERN_NOTICE "floppy disk write protected " non_int_flush_track() 1576 unit[drive].disk = -1; fd_probe() 1630 printk(KERN_INFO "fd%d: accessing %s-disk with %s-layout\n",drive, floppy_open() 1637 static void floppy_release(struct gendisk *disk, fmode_t mode) floppy_release() argument 1639 struct amiga_floppy_struct *p = disk->private_data; floppy_release() 1665 static unsigned amiga_check_events(struct gendisk *disk, unsigned int clearing) amiga_check_events() argument 1667 struct amiga_floppy_struct *p = disk->private_data; amiga_check_events() 1710 struct gendisk *disk; fd_probe_drives() local 1714 disk = alloc_disk(1); fd_probe_drives() 1715 if (!disk) { fd_probe_drives() 1719 unit[drive].gendisk = disk; fd_probe_drives() 1721 disk->queue = blk_init_queue(do_fd_request, &amiflop_lock); fd_probe_drives() 1722 if (!disk->queue) { fd_probe_drives() 1735 disk->major = FLOPPY_MAJOR; fd_probe_drives() 1736 disk->first_minor = drive; fd_probe_drives() 1737 disk->fops = &floppy_fops; fd_probe_drives() 1738 sprintf(disk->disk_name, "fd%d", drive); fd_probe_drives() 1739 disk->private_data = &unit[drive]; fd_probe_drives() 1740 set_capacity(disk, 880*2); fd_probe_drives() 1741 add_disk(disk); fd_probe_drives() 1822 /* make sure that disk DMA is enabled */ amiga_floppy_probe()
|
H A D | brd.c | 447 MODULE_PARM_DESC(rd_size, "Size of each RAM disk in kbytes."); 477 struct gendisk *disk; brd_alloc() local 507 disk = brd->brd_disk = alloc_disk(max_part); brd_alloc() 508 if (!disk) brd_alloc() 510 disk->major = RAMDISK_MAJOR; brd_alloc() 511 disk->first_minor = i * max_part; brd_alloc() 512 disk->fops = &brd_fops; brd_alloc() 513 disk->private_data = brd; brd_alloc() 514 disk->queue = brd->brd_queue; brd_alloc() 515 disk->flags = GENHD_FL_EXT_DEVT; brd_alloc() 516 sprintf(disk->disk_name, "ram%d", i); brd_alloc() 517 set_capacity(disk, rd_size * 2); brd_alloc()
|
H A D | cciss.c | 170 static void cciss_release(struct gendisk *disk, fmode_t mode); 175 static int cciss_revalidate(struct gendisk *disk); 1065 static inline ctlr_info_t *get_host(struct gendisk *disk) get_host() argument 1067 return disk->queue->queuedata; get_host() 1070 static inline drive_info_struct *get_drv(struct gendisk *disk) get_drv() argument 1072 return disk->private_data; get_drv() 1090 * disk information. I don't think I really like this cciss_open() 1127 static void cciss_release(struct gendisk *disk, fmode_t mode) cciss_release() argument 1133 h = get_host(disk); cciss_release() 1134 drv = get_drv(disk); cciss_release() 1135 dev_dbg(&h->pdev->dev, "cciss_release %s\n", disk->disk_name); cciss_release() 1446 struct gendisk *disk, void __user *argp) cciss_getluninfo() 1449 drive_info_struct *drv = get_drv(disk); cciss_getluninfo() 1703 struct gendisk *disk = bdev->bd_disk; cciss_ioctl() local 1704 ctlr_info_t *h = get_host(disk); cciss_ioctl() 1733 return cciss_getluninfo(h, disk, argp); cciss_ioctl() 1786 /* make sure the disk has been added and the drive is real cciss_check_queues() 1931 static int cciss_add_disk(ctlr_info_t *h, struct gendisk *disk, cciss_add_disk() argument 1934 disk->queue = blk_init_queue(do_cciss_request, &h->lock); cciss_add_disk() 1935 if (!disk->queue) cciss_add_disk() 1937 sprintf(disk->disk_name, "cciss/c%dd%d", h->ctlr, drv_index); cciss_add_disk() 1938 disk->major = h->major; cciss_add_disk() 1939 disk->first_minor = drv_index << NWD_SHIFT; cciss_add_disk() 1940 disk->fops = &cciss_fops; cciss_add_disk() 1943 disk->private_data = h->drv[drv_index]; cciss_add_disk() 1944 disk->driverfs_dev = &h->drv[drv_index]->dev; cciss_add_disk() 1947 blk_queue_bounce_limit(disk->queue, h->pdev->dma_mask); cciss_add_disk() 1950 blk_queue_max_segments(disk->queue, h->maxsgentries); cciss_add_disk() 1952 blk_queue_max_hw_sectors(disk->queue, h->cciss_max_sectors); cciss_add_disk() 1954 blk_queue_softirq_done(disk->queue, cciss_softirq_done); cciss_add_disk() 1956 disk->queue->queuedata = h; cciss_add_disk() 1958 blk_queue_logical_block_size(disk->queue, cciss_add_disk() 1965 h->drv[drv_index]->queue = disk->queue; cciss_add_disk() 1966 add_disk(disk); cciss_add_disk() 1970 blk_cleanup_queue(disk->queue); cciss_add_disk() 1971 disk->queue = NULL; cciss_add_disk() 1979 * then the drive information will be updated and the disk will be 1982 * is disk 0 which will always be left registered with the kernel since it 1983 * is also the controller node. Any changes to disk 0 will show up on 1989 struct gendisk *disk; cciss_update_drive_info() local 1997 /* Get information about the disk and modify the driver structure */ cciss_update_drive_info() 2033 /* Save the lunid in case we deregister the disk, below. */ cciss_update_drive_info() 2037 /* Is it the same disk we already know, and nothing's changed? */ cciss_update_drive_info() 2046 /* The disk is unchanged, nothing to update */ cciss_update_drive_info() 2049 /* If we get here it's not the same disk, or something's changed, cciss_update_drive_info() 2052 * If the disk already exists then deregister it before proceeding cciss_update_drive_info() 2053 * (unless it's the first disk (for the controller node). cciss_update_drive_info() 2056 dev_warn(&h->pdev->dev, "disk %d has changed.\n", drv_index); cciss_update_drive_info() 2068 /* If the disk is in use return */ cciss_update_drive_info() 2073 * and serial number inquiry. If the disk was deregistered cciss_update_drive_info() 2096 disk = h->gendisk[drv_index]; cciss_update_drive_info() 2097 set_capacity(disk, h->drv[drv_index]->nr_blocks); cciss_update_drive_info() 2099 /* If it's not disk 0 (drv_index != 0) cciss_update_drive_info() 2100 * or if it was disk 0, but there was previously cciss_update_drive_info() 2106 if (cciss_add_disk(h, disk, drv_index) != 0) { cciss_update_drive_info() 2109 dev_warn(&h->pdev->dev, "could not update disk %d\n", cciss_update_drive_info() 2147 * disk is configured there, skip it. cciss_alloc_drive_info() 2159 /* If adding a real disk at cxd0, and it's already alloc'ed */ cciss_alloc_drive_info() 2194 * count this disk, or if it's only being added to provide 2213 "could not allocate a new disk %d\n", cciss_add_gendisk() 2223 /* else knows about this disk yet to contend */ cciss_add_gendisk() 2238 * to register a disk so the controller can be accessed 2243 struct gendisk *disk; cciss_add_controller_node() local 2259 disk = h->gendisk[drv_index]; cciss_add_controller_node() 2260 if (cciss_add_disk(h, disk, drv_index) == 0) cciss_add_controller_node() 2265 dev_warn(&h->pdev->dev, "could not add disk 0.\n"); cciss_add_controller_node() 2413 /* zero out the disk size info */ cciss_clear_drive_info() 2430 /* This function will deregister the disk and it's queue from the 2434 * disk = This is the disk to be deregistered 2435 * drv = This is the drive_info_struct associated with the disk to be 2436 * deregistered. It contains information about the disk used 2438 * clear_all = This flag determines whether or not the disk information 2441 * the disk in preparation for re-adding it. In this case 2455 struct gendisk *disk; deregister_disk() local 2463 disk = h->gendisk[drv_index]; deregister_disk() 2466 if (clear_all || (h->gendisk[0] == disk)) { deregister_disk() 2474 /* invalidate the devices and deregister the disk. If it is disk deregister_disk() 2476 * allows us to delete disk zero but keep the controller registered. deregister_disk() 2478 if (h->gendisk[0] != disk) { deregister_disk() 2479 struct request_queue *q = disk->queue; deregister_disk() 2480 if (disk->flags & GENHD_FL_UP) { deregister_disk() 2482 del_gendisk(disk); deregister_disk() 2488 * other than disk 0 we will call put_disk. We do not deregister_disk() 2489 * do this for disk 0 as we need it to be able to deregister_disk() 2494 * disk in our array and NULL our the pointer. deregister_disk() 2499 if (h->gendisk[i] == disk) { deregister_disk() 2504 put_disk(disk); deregister_disk() 2507 set_capacity(disk, 0); deregister_disk() 2513 /* if it was the last disk, find the new hightest lun */ deregister_disk() 2517 /* if the disk has size > 0, it is available */ deregister_disk() 2943 static int cciss_revalidate(struct gendisk *disk) cciss_revalidate() argument 2945 ctlr_info_t *h = get_host(disk); cciss_revalidate() 2946 drive_info_struct *drv = get_drv(disk); cciss_revalidate() 2982 set_capacity(disk, drv->nr_blocks); cciss_revalidate() 5214 /* write all data in the battery backed cache to disk */ cciss_shutdown() 5269 /* remove it from the disk list */ cciss_remove_one() 5271 struct gendisk *disk = h->gendisk[j]; cciss_remove_one() local 5272 if (disk) { cciss_remove_one() 5273 struct request_queue *q = disk->queue; cciss_remove_one() 5275 if (disk->flags & GENHD_FL_UP) { cciss_remove_one() 5277 del_gendisk(disk); cciss_remove_one() 1445 cciss_getluninfo(ctlr_info_t *h, struct gendisk *disk, void __user *argp) cciss_getluninfo() argument
|
H A D | sunvdc.c | 32 MODULE_DESCRIPTION("Sun LDOM virtual disk client driver"); 52 struct gendisk *disk; member in struct:vdc_port 69 /* The server fills these in for us in the disk attribute 112 struct gendisk *disk = bdev->bd_disk; vdc_getgeo() local 113 sector_t nsect = get_capacity(disk); vdc_getgeo() 134 struct gendisk *disk; vdc_ioctl() local 145 disk = bdev->bd_disk; vdc_ioctl() 147 if (bdev->bd_disk && (disk->flags & GENHD_FL_CD)) vdc_ioctl() 169 * allocated a disk. vdc_blk_queue_start() 171 if (port->disk && blk_queue_stopped(port->disk->queue) && vdc_blk_queue_start() 173 blk_start_queue(port->disk->queue); vdc_blk_queue_start() 759 * then the underlying disk is reserved by another system probe_disk() 792 port->disk = g; probe_disk() 828 pr_info(PFX "Virtual Hard disk %s\n", port->disk_name); probe_disk() 959 blk_stop_queue(port->disk->queue); vdc_port_remove() 966 del_gendisk(port->disk); vdc_port_remove() 967 blk_cleanup_queue(port->disk->queue); vdc_port_remove() 968 put_disk(port->disk); vdc_port_remove() 969 port->disk = NULL; vdc_port_remove() 1002 blk_requeue_request(port->disk->queue, req); vdc_requeue_inflight() 1010 while ((req = blk_fetch_request(port->disk->queue)) != NULL) vdc_queue_drain() 1051 blk_stop_queue(port->disk->queue); vdc_ldc_reset()
|
H A D | cpqarray.c | 163 static void ida_release(struct gendisk *disk, fmode_t mode); 177 static int ida_revalidate(struct gendisk *disk); 187 static inline drv_info_t *get_drv(struct gendisk *disk) get_drv() argument 189 return disk->private_data; get_drv() 192 static inline ctlr_info_t *get_host(struct gendisk *disk) get_host() argument 194 return disk->queue->queuedata; get_host() 465 struct gendisk *disk = ida_gendisk[i][j]; cpqarray_register_ctlr() local 467 sprintf(disk->disk_name, "ida/c%dd%d", i, j); cpqarray_register_ctlr() 468 disk->major = COMPAQ_SMART2_MAJOR + i; cpqarray_register_ctlr() 469 disk->first_minor = j<<NWD_SHIFT; cpqarray_register_ctlr() 470 disk->fops = &ida_fops; cpqarray_register_ctlr() 474 set_capacity(disk, drv->nr_blks); cpqarray_register_ctlr() 475 disk->queue = hba[i]->queue; cpqarray_register_ctlr() 476 disk->private_data = drv; cpqarray_register_ctlr() 477 add_disk(disk); cpqarray_register_ctlr() 859 static void ida_release(struct gendisk *disk, fmode_t mode) ida_release() argument 864 host = get_host(disk); ida_release() 1510 * (through an ioctl) to make the driver zap any previous disk structs for 1540 struct gendisk *disk = ida_gendisk[ctlr][i]; revalidate_allvol() local 1541 if (disk->flags & GENHD_FL_UP) revalidate_allvol() 1542 del_gendisk(disk); revalidate_allvol() 1556 struct gendisk *disk = ida_gendisk[ctlr][i]; revalidate_allvol() local 1561 set_capacity(disk, drv->nr_blks); revalidate_allvol() 1562 disk->queue = host->queue; revalidate_allvol() 1563 disk->private_data = drv; revalidate_allvol() 1565 add_disk(disk); revalidate_allvol() 1572 static int ida_revalidate(struct gendisk *disk) ida_revalidate() argument 1574 drv_info_t *drv = disk->private_data; ida_revalidate() 1575 set_capacity(disk, drv->nr_blks); ida_revalidate()
|
H A D | sx8.c | 245 struct gendisk *disk; member in struct:carm_port 1018 /* TODO: scan and support non-disk devices */ carm_handle_scan_chan() 1020 if (msg_data[i] == 0) { /* direct-access device (disk) */ carm_handle_scan_chan() 1334 struct gendisk *disk = port->disk; carm_fsm_task() local 1336 set_capacity(disk, port->capacity); carm_fsm_task() 1337 add_disk(disk); carm_fsm_task() 1497 struct gendisk *disk; carm_init_disks() local 1505 disk = alloc_disk(CARM_MINORS_PER_MAJOR); carm_init_disks() 1506 if (!disk) { carm_init_disks() 1511 port->disk = disk; carm_init_disks() 1512 sprintf(disk->disk_name, DRV_NAME "/%u", carm_init_disks() 1514 disk->major = host->major; carm_init_disks() 1515 disk->first_minor = i * CARM_MINORS_PER_MAJOR; carm_init_disks() 1516 disk->fops = &carm_bd_ops; carm_init_disks() 1517 disk->private_data = port; carm_init_disks() 1524 disk->queue = q; carm_init_disks() 1539 struct gendisk *disk = host->port[i].disk; carm_free_disks() local 1540 if (disk) { carm_free_disks() 1541 struct request_queue *q = disk->queue; carm_free_disks() 1543 if (disk->flags & GENHD_FL_UP) carm_free_disks() 1544 del_gendisk(disk); carm_free_disks() 1547 put_disk(disk); carm_free_disks()
|
H A D | nvme-core.c | 525 ts = ns->disk->integrity->tuple_size; nvme_dif_remap() 568 blk_integrity_register(ns->disk, &integrity); nvme_init_integrity() 1962 static void nvme_release(struct gendisk *disk, fmode_t mode) nvme_release() argument 1964 struct nvme_ns *ns = disk->private_data; nvme_release() 1989 static int nvme_revalidate_disk(struct gendisk *disk) nvme_revalidate_disk() argument 1991 struct nvme_ns *ns = disk->private_data; nvme_revalidate_disk() 2031 if (blk_get_integrity(disk) && (ns->pi_type != pi_type || nvme_revalidate_disk() 2033 bs != queue_logical_block_size(disk->queue) || nvme_revalidate_disk() 2035 blk_integrity_unregister(disk); nvme_revalidate_disk() 2040 if (ns->ms && !blk_get_integrity(disk) && (disk->flags & GENHD_FL_UP) && nvme_revalidate_disk() 2044 if (id->ncap == 0 || (ns->ms && !blk_get_integrity(disk))) nvme_revalidate_disk() 2045 set_capacity(disk, 0); nvme_revalidate_disk() 2047 set_capacity(disk, le64_to_cpup(&id->nsze) << (ns->lba_shift - 9)); nvme_revalidate_disk() 2110 struct gendisk *disk; nvme_alloc_ns() local 2126 disk = alloc_disk_node(0, node); nvme_alloc_ns() 2127 if (!disk) nvme_alloc_ns() 2131 ns->disk = disk; nvme_alloc_ns() 2132 ns->lba_shift = 9; /* set to a default value for 512 until disk is validated */ nvme_alloc_ns() 2143 disk->major = nvme_major; nvme_alloc_ns() 2144 disk->first_minor = 0; nvme_alloc_ns() 2145 disk->fops = &nvme_fops; nvme_alloc_ns() 2146 disk->private_data = ns; nvme_alloc_ns() 2147 disk->queue = ns->queue; nvme_alloc_ns() 2148 disk->driverfs_dev = dev->device; nvme_alloc_ns() 2149 disk->flags = GENHD_FL_EXT_DEVT; nvme_alloc_ns() 2150 sprintf(disk->disk_name, "nvme%dn%d", dev->instance, nsid); nvme_alloc_ns() 2158 set_capacity(disk, 0); nvme_alloc_ns() 2159 nvme_revalidate_disk(ns->disk); nvme_alloc_ns() 2160 add_disk(ns->disk); nvme_alloc_ns() 2162 revalidate_disk(ns->disk); nvme_alloc_ns() 2646 if (ns->disk->flags & GENHD_FL_UP) { nvme_dev_remove() 2647 if (blk_get_integrity(ns->disk)) nvme_dev_remove() 2648 blk_integrity_unregister(ns->disk); nvme_dev_remove() 2649 del_gendisk(ns->disk); nvme_dev_remove() 2719 ns->disk->private_data = NULL; nvme_free_namespaces() 2722 put_disk(ns->disk); nvme_free_namespaces()
|
H A D | umem.c | 18 * 10/22/01: Phap Nguyen - v2.1 Added disk partitioning 20 * - use stand disk partitioning (so fdisk works). 760 static int mm_revalidate(struct gendisk *disk) mm_revalidate() argument 762 struct cardinfo *card = disk->private_data; mm_revalidate() 763 set_capacity(disk, card->mm_size << 1); mm_revalidate() 1090 struct gendisk *disk = mm_gendisk[i]; mm_init() local 1091 sprintf(disk->disk_name, "umem%c", 'a'+i); mm_init() 1093 disk->major = major_nr; mm_init() 1094 disk->first_minor = i << MM_SHIFT; mm_init() 1095 disk->fops = &mm_fops; mm_init() 1096 disk->private_data = &cards[i]; mm_init() 1097 disk->queue = cards[i].queue; mm_init() 1098 set_capacity(disk, cards[i].mm_size << 1); mm_init() 1099 add_disk(disk); mm_init()
|
H A D | loop.c | 546 struct gendisk *disk = dev_to_disk(dev); loop_attr_show() local 547 struct loop_device *lo = disk->private_data; loop_attr_show() 1341 static void lo_release(struct gendisk *disk, fmode_t mode) lo_release() argument 1343 struct loop_device *lo = disk->private_data; lo_release() 1533 struct gendisk *disk; loop_add() local 1578 disk = lo->lo_disk = alloc_disk(1 << part_shift); loop_add() 1579 if (!disk) loop_add() 1601 disk->flags |= GENHD_FL_NO_PART_SCAN; loop_add() 1602 disk->flags |= GENHD_FL_EXT_DEVT; loop_add() 1606 disk->major = LOOP_MAJOR; loop_add() 1607 disk->first_minor = i << part_shift; loop_add() 1608 disk->fops = &lo_fops; loop_add() 1609 disk->private_data = lo; loop_add() 1610 disk->queue = lo->lo_queue; loop_add() 1611 sprintf(disk->disk_name, "loop%d", i); loop_add() 1612 add_disk(disk); loop_add() 1780 * for the whole disk. loop_init()
|
H A D | floppy.c | 74 * disk types. 88 * opposite side of the disk, leaving the sector IDs alone (i.e. Commodore's 156 #define DCL_DEBUG /* debug disk change line */ 336 * Maximum disk size (in kilobytes). 337 * This default is used whenever the current disk size is unknown. 374 | | | | | | | Spindown offset (where disk stops) 404 * Frequency of disk change checks */ 422 * tells if the disk is in Commodore 1581 format, which means side 0 sectors 423 * are located on side 1 of the disk but with a side 0 ID, and vice-versa. 424 * This is the same as the Sharp MZ-80 5.25" CP/M disk format, except that the 709 * disk change. 713 * last_checked is the date of the last check which showed 'no disk change' 717 * 2. No floppy disk is in the drive. This is done in order to ensure that 718 * requests are quickly flushed in case there is no disk in the drive. It 719 * follows that FD_DISK_CHANGE can only be cleared if there is a disk in 724 * each seek. If a disk is present, the disk change line should also be 725 * cleared on each seek. Thus, if FD_DISK_NEWCHANGE is clear, but the disk 726 * change line is set, this means either that no disk is in the drive, or 738 DPRINT("WARNING disk change called early\n"); disk_change() 741 DPRINT("probing disk change on unselected drive\n"); disk_change() 747 "checking disk change line for drive %d\n", drive); disk_change() 749 debug_dcl(UDP->flags, "disk change line=%x\n", fd_inb(FD_DIR) & 0x80); disk_change() 765 DPRINT("Disk type is undefined after disk change\n"); disk_change() 806 "calling disk change from set_dor\n"); set_dor() 932 * cycle through all N_DRIVE floppy drives, for disk change testing. 934 * be sure to have up to date disk change information. 997 /* this function makes sure that the disk stays in the drive during the 1001 debug_dcl(DP->flags, "calling disk change from watchdog\n"); fd_watchdog() 1004 DPRINT("disk removed during i/o\n"); fd_watchdog() 1547 "checking whether disk is write protected\n"); check_wp() 1562 debug_dcl(DP->flags, "calling disk change from %s\n", __func__); seek_floppy() 1567 * If it isn't, this means that there is really no disk in seek_floppy() 1894 debug_dcl(DP->flags, "calling disk change from floppy_ready\n"); floppy_ready() 2851 DPRINT("disk absent or changed during operation\n"); redo_fd_request() 3207 debug_dcl(DP->flags, "calling disk change from raw_cmd ioctl\n"); raw_cmd_ioctl() 3269 /* notice a disk change immediately, else set_geometry() 3287 * mtools often changes the geometry of the disk after set_geometry() 3621 static void floppy_release(struct gendisk *disk, fmode_t mode) floppy_release() argument 3623 int drive = (long)disk->private_data; floppy_release() 3738 * Check if the disk has been changed or if a change has been faked. 3740 static unsigned int floppy_check_events(struct gendisk *disk, floppy_check_events() argument 3743 int drive = (long)disk->private_data; floppy_check_events() 3766 * a disk in the drive, and whether that disk is writable. 3830 /* revalidate the floppy disk, i.e. trigger format autodetection by reading 3832 * there is a disk in the drive at all... Thus we also do it for fixed 3834 static int floppy_revalidate(struct gendisk *disk) floppy_revalidate() argument 3836 int drive = (long)disk->private_data; floppy_revalidate() 3872 set_capacity(disk, floppy_sizes[UDRS->fd_device]); floppy_revalidate() 3891 /* Determine the floppy disk controller type */ 4618 /* eject disk, if any */ floppy_module_exit()
|
/linux-4.1.27/drivers/md/persistent-data/ |
H A D | Makefile | 7 dm-space-map-disk.o \
|
H A D | dm-array.h | 15 * more efficiently than a btree which will result in less disk space use, 39 * disk that holds a particular instance of an array. You may have a 98 * root - the root block of the array on disk 126 * value - the value to be read. Will be in on-disk format of course. 139 * value - value to be written to disk. Make sure you confirm the value is 140 * in on-disk format with__dm_bless_for_disk() before calling.
|
H A D | dm-transaction-manager.h | 19 * of the on-disk data structures by limiting access to writeable blocks. 42 * Then call dm_tm_pre_commit() to flush them to disk. 122 * Returns a tm that has an open transaction to write the new disk sm.
|
H A D | dm-block-manager.h | 71 * written back to the disk sometime after dm_bm_unlock is called. 91 * overwrite the block completely. It saves a disk read.
|
/linux-4.1.27/arch/blackfin/include/uapi/asm/ |
H A D | fcntl.h | 12 #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
|
/linux-4.1.27/arch/m68k/include/uapi/asm/ |
H A D | fcntl.h | 6 #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
|
/linux-4.1.27/arch/arm/include/uapi/asm/ |
H A D | fcntl.h | 6 #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
|
/linux-4.1.27/include/linux/ |
H A D | dqblk_qtree.h | 21 void (*mem2disk_dqblk)(void *disk, struct dquot *dquot); /* Convert given entry from in memory format to disk one */ 22 void (*disk2mem_dqblk)(struct dquot *dquot, void *disk); /* Convert given entry from disk format to in memory one */ 23 int (*is_id)(void *disk, struct dquot *dquot); /* Is this structure for given id? */ 44 int qtree_entry_unused(struct qtree_mem_dqinfo *info, char *disk); qtree_depth()
|
H A D | genhd.h | 6 * Generic hard disk header file by 21 #define disk_to_dev(disk) (&(disk)->part0.__dev) 240 static inline int disk_max_parts(struct gendisk *disk) disk_max_parts() argument 242 if (disk->flags & GENHD_FL_EXT_DEVT) disk_max_parts() 244 return disk->minors; disk_max_parts() 247 static inline bool disk_part_scan_enabled(struct gendisk *disk) disk_part_scan_enabled() argument 249 return disk_max_parts(disk) > 1 && disk_part_scan_enabled() 250 !(disk->flags & GENHD_FL_NO_PART_SCAN); disk_part_scan_enabled() 253 static inline dev_t disk_devt(struct gendisk *disk) disk_devt() argument 255 return disk_to_dev(disk)->devt; disk_devt() 263 extern struct hd_struct *disk_get_part(struct gendisk *disk, int partno); 280 struct gendisk *disk; member in struct:disk_part_iter 287 struct gendisk *disk, unsigned int flags); 291 extern struct hd_struct *disk_map_sector_rcu(struct gendisk *disk, 295 * Macros to operate on percpu disk statistics: 297 * {disk|part|all}_stat_{add|sub|inc|dec}() modify the stat counters 402 static inline struct partition_meta_info *alloc_part_info(struct gendisk *disk) alloc_part_info() argument 404 if (disk) alloc_part_info() 406 GFP_KERNEL, disk->node_id); alloc_part_info() 419 extern void add_disk(struct gendisk *disk); 422 extern struct block_device *bdget_disk(struct gendisk *disk, int partno); 425 extern void set_disk_ro(struct gendisk *disk, int flag); 427 static inline int get_disk_ro(struct gendisk *disk) get_disk_ro() argument 429 return disk->part0.policy; get_disk_ro() 432 extern void disk_block_events(struct gendisk *disk); 433 extern void disk_unblock_events(struct gendisk *disk); 434 extern void disk_flush_events(struct gendisk *disk, unsigned int mask); 435 extern unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask); 438 extern void add_disk_randomness(struct gendisk *disk); 439 extern void rand_initialize_disk(struct gendisk *disk); 445 static inline sector_t get_capacity(struct gendisk *disk) get_capacity() argument 447 return disk->part0.nr_sects; get_capacity() 449 static inline void set_capacity(struct gendisk *disk, sector_t size) set_capacity() argument 451 disk->part0.nr_sects = size; set_capacity() 490 #define BSD_DISKMAGIC (0x82564557UL) /* The disk magic number */ 545 #define UNIXWARE_DISKMAGIC (0xCA5E600DUL) /* The disk magic number */ 606 extern int disk_expand_part_tbl(struct gendisk *disk, int target); 607 extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); 608 extern int invalidate_partitions(struct gendisk *disk, struct block_device *bdev); 609 extern struct hd_struct * __must_check add_partition(struct gendisk *disk, 620 extern struct kobject *get_disk(struct gendisk *disk); 621 extern void put_disk(struct gendisk *disk);
|
H A D | amifd.h | 50 int blocks; /* total # blocks on disk */ 53 int disk; /* disk in drive (-1 == unknown) */ member in struct:amiga_floppy_struct 56 int dirty; /* true when trackbuf is not on disk */
|
H A D | amifdreg.h | 8 #define DSKRDY (0x1<<5) /* disk ready when low */ 10 #define DSKPROT (0x1<<3) /* disk protected when low */ 11 #define DSKCHANGE (0x1<<2) /* low when disk removed */ 31 #define DMAON (1<<14) /* disk DMA enabled */ 32 #define DISKWRITE (1<<13) /* disk write bit in DSKLEN enabled */
|
H A D | adfs_fs.h | 9 * the disk size is non-zero!!!
|
H A D | task_io_accounting.h | 32 * written to disk.
|
H A D | mg_disk.h | 35 /* disk resource */
|
H A D | sysv_fs.h | 25 /* Xenix super-block data on disk */ 65 /* SystemV4 super-block data on disk */ 97 /* SystemV2 super-block data on disk */ 125 /* V7 super-block data on disk */ 158 /* The disk addresses are three-byte (despite direct block addresses being 163 /* Coherent super-block data on disk */ 190 /* SystemV/Coherent inode data on disk */ 204 /* SystemV/Coherent directory entry on disk */
|
H A D | nilfs2_fs.h | 2 * nilfs2_fs.h - NILFS2 on-disk structures and common declarations. 49 * struct nilfs_inode - structure of an inode on disk 143 * struct nilfs_super_block - structure of super block on disk 162 __le64 s_first_data_block; /* 1st seg disk block number */ 167 /*40*/ __le64 s_last_pseg; /* disk block addr pseg written last */ 474 * struct nilfs_dat_entry - disk address translation entry 522 To keep the compatibility of the disk format, 841 * @vi_blocknr: disk block number 856 * @vd_blocknr: disk block number 873 * struct nilfs_bdesc - descriptor of disk block number 875 * @bd_oblocknr: disk block address (for skipping dead blocks) 876 * @bd_blocknr: disk block address
|
H A D | drbd_limits.h | 60 /* If backing disk takes longer than disk_timeout, mark the disk as failed */ 132 * If you use >= 292 kB on-disk ring buffer,
|
H A D | edd.h | 17 * information is used to identify BIOS boot disk. The code in setup.S
|
H A D | ioprio.h | 24 * is only served when no one else is using the disk.
|
H A D | lru_cache.h | 51 We replicate IO (more or less synchronously) to local and remote disk. 60 This is known as "write intent log", and can be implemented as on-disk 65 in-flight WRITE IO, e.g. by only lazily clearing the on-disk write-intent 88 The on-disk "dirty bitmap" may be re-used as "write-intent" bitmap as well. 91 on-disk bitmap, while keeping the in-memory "dirty" bitmap as clean as 92 possible, flushing it to disk again when a previously "hot" (and on-disk
|
/linux-4.1.27/drivers/ide/ |
H A D | ide-gd.c | 19 #include "ide-disk.h" 33 static struct ide_disk_obj *ide_disk_get(struct gendisk *disk) ide_disk_get() argument 38 idkp = ide_drv_g(disk, ide_disk_obj); ide_disk_get() 69 struct gendisk *g = idkp->disk; ide_gd_remove() 85 struct gendisk *g = idkp->disk; ide_disk_release() 96 * reinitialized on resume otherwise the disk 125 spin down the disk in this case, especially since Alpha 131 the disk to expire its write cache. */ 185 struct gendisk *disk = bdev->bd_disk; ide_gd_open() local 190 idkp = ide_disk_get(disk); ide_gd_open() 204 ret = drive->disk_ops->init_media(drive, disk); ide_gd_open() 207 * Allow O_NDELAY to open a drive without a disk, or with an ide_gd_open() 208 * unreadable disk, so that we can get the format capacity ide_gd_open() 226 drive->disk_ops->set_doorlock(drive, disk, 1); ide_gd_open() 253 static void ide_gd_release(struct gendisk *disk, fmode_t mode) ide_gd_release() argument 255 struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj); ide_gd_release() 265 drive->disk_ops->set_doorlock(drive, disk, 0); ide_gd_release() 286 static unsigned int ide_gd_check_events(struct gendisk *disk, ide_gd_check_events() argument 289 struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj); ide_gd_check_events() 302 * genhd->events is 0. This is intended as removeable ide disk ide_gd_check_events() 311 static void ide_gd_unlock_native_capacity(struct gendisk *disk) ide_gd_unlock_native_capacity() argument 313 struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj); ide_gd_unlock_native_capacity() 321 static int ide_gd_revalidate_disk(struct gendisk *disk) ide_gd_revalidate_disk() argument 323 struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj); ide_gd_revalidate_disk() 326 if (ide_gd_check_events(disk, 0)) ide_gd_revalidate_disk() 329 set_capacity(disk, ide_gd_capacity(drive)); ide_gd_revalidate_disk() 382 printk(KERN_ERR PFX "%s: can't allocate a disk structure\n", ide_gd_probe() 402 idkp->disk = g; ide_gd_probe() 442 MODULE_ALIAS("ide:*m-disk*"); 443 MODULE_ALIAS("ide-disk"); 449 MODULE_DESCRIPTION("generic ATA/ATAPI disk driver");
|
H A D | ide-gd.h | 19 struct gendisk *disk; member in struct:ide_disk_obj 36 /* Copy of the flexible disk page */
|
H A D | ide-disk.h | 7 /* ide-disk.c */
|
H A D | ide-disk_ioctl.c | 6 #include "ide-disk.h"
|
H A D | ide-floppy.c | 306 * Look at the flexible disk page parameters. We ignore the CHS capacity 313 struct gendisk *disk = floppy->disk; ide_floppy_get_flexible_disk_page() local 321 if (ide_queue_pc_tail(drive, disk, pc, buf, pc->req_xfer)) { ide_floppy_get_flexible_disk_page() 322 printk(KERN_ERR PFX "Can't get flexible disk page params\n"); ide_floppy_get_flexible_disk_page() 331 set_disk_ro(disk, !!(drive->dev_flags & IDE_DFLAG_WP)); ide_floppy_get_flexible_disk_page() 357 printk(KERN_NOTICE PFX "%s: The disk reports a capacity of %d " ide_floppy_get_flexible_disk_page() 375 struct gendisk *disk = floppy->disk; ide_floppy_get_capacity() local 390 if (ide_queue_pc_tail(drive, disk, &pc, pc_buf, pc.req_xfer)) { ide_floppy_get_capacity() 455 printk(KERN_ERR PFX "%s: No disk in drive\n", ide_floppy_get_capacity() 459 printk(KERN_ERR PFX "%s: Invalid capacity for disk " ide_floppy_get_capacity() 467 /* Clik! disk does not support get_flexible_disk_page */ ide_floppy_get_capacity() 519 static int ide_floppy_init_media(ide_drive_t *drive, struct gendisk *disk) ide_floppy_init_media() argument 523 if (ide_do_test_unit_ready(drive, disk)) ide_floppy_init_media() 524 ide_do_start_stop(drive, disk, 1); ide_floppy_init_media() 528 set_capacity(disk, ide_gd_capacity(drive)); ide_floppy_init_media()
|
H A D | ide-floppy_ioctl.c | 53 if (ide_queue_pc_tail(drive, floppy->disk, pc, pc_buf, pc->req_xfer)) { ide_floppy_get_format_capacities() 129 if (ide_queue_pc_tail(drive, floppy->disk, pc, buf, pc->req_xfer)) ide_floppy_get_sfrp_bit() 146 /* Don't format if someone is using the disk */ ide_floppy_format_unit() 178 if (ide_queue_pc_tail(drive, floppy->disk, pc, buf, pc->req_xfer)) ide_floppy_format_unit() 207 if (ide_queue_pc_tail(drive, floppy->disk, pc, sense_buf, ide_floppy_get_format_progress() 239 struct gendisk *disk = floppy->disk; ide_floppy_lockdoor() local 245 ide_set_media_lock(drive, disk, prevent); ide_floppy_lockdoor() 248 ide_do_start_stop(drive, disk, 2); ide_floppy_lockdoor()
|
H A D | ide-tape.c | 143 struct gendisk *disk; member in struct:ide_tape_obj 231 static struct ide_tape_obj *ide_tape_get(struct gendisk *disk, bool cdev, ide_tape_get() argument 241 tape = ide_drv_g(disk, ide_tape_obj); ide_tape_get() 684 struct gendisk *disk = tape->disk; idetape_wait_ready() local 691 if (ide_do_test_unit_ready(drive, disk) == 0) idetape_wait_ready() 698 ide_do_start_stop(drive, disk, IDETAPE_LU_LOAD_MASK); idetape_wait_ready() 716 rc = ide_queue_pc_tail(drive, tape->disk, &pc, NULL, 0); idetape_flush_tape_buffers() 736 if (ide_queue_pc_tail(drive, tape->disk, &pc, buf, pc.req_xfer)) ide_tape_read_position() 804 struct gendisk *disk = tape->disk; idetape_position_tape() local 812 ret = ide_queue_pc_tail(drive, disk, &pc, NULL, 0); idetape_position_tape() 858 rq->rq_disk = tape->disk; idetape_queue_rw_tail() 868 blk_execute_rq(drive->queue, tape->disk, rq, 0); idetape_queue_rw_tail() 1010 struct gendisk *disk = tape->disk; idetape_rewind_tape() local 1017 ret = ide_queue_pc_tail(drive, disk, &pc, NULL, 0); idetape_rewind_tape() 1065 struct gendisk *disk = tape->disk; idetape_space_over_filemarks() local 1094 return ide_queue_pc_tail(drive, disk, &pc, NULL, 0); idetape_space_over_filemarks() 1232 if (ide_queue_pc_tail(drive, tape->disk, &pc, NULL, 0)) { idetape_write_filemark() 1255 struct gendisk *disk = tape->disk; idetape_mtioctop() local 1292 return ide_do_start_stop(drive, disk, IDETAPE_LU_LOAD_MASK); idetape_mtioctop() 1300 if (!ide_set_media_lock(drive, disk, 0)) idetape_mtioctop() 1304 retval = ide_do_start_stop(drive, disk, !IDETAPE_LU_LOAD_MASK); idetape_mtioctop() 1314 return ide_do_start_stop(drive, disk, idetape_mtioctop() 1318 return ide_queue_pc_tail(drive, disk, &pc, NULL, 0); idetape_mtioctop() 1322 return ide_queue_pc_tail(drive, disk, &pc, NULL, 0); idetape_mtioctop() 1345 retval = ide_set_media_lock(drive, disk, 1); idetape_mtioctop() 1351 retval = ide_set_media_lock(drive, disk, 0); idetape_mtioctop() 1444 if (ide_queue_pc_tail(drive, tape->disk, &pc, buf, pc.req_xfer)) { ide_tape_get_bsize_from_bdesc() 1530 if (!ide_set_media_lock(drive, tape->disk, 1)) { idetape_chrdev_open() 1589 if (!ide_set_media_lock(drive, tape->disk, 0)) idetape_chrdev_release() 1609 if (ide_queue_pc_tail(drive, tape->disk, &pc, pc_buf, pc.req_xfer)) { idetape_get_inquiry_results() 1638 if (ide_queue_pc_tail(drive, tape->disk, &pc, buf, pc.req_xfer)) { idetape_get_mode_sense_results() 1812 ide_unregister_region(tape->disk); ide_tape_remove() 1823 struct gendisk *g = tape->disk; ide_tape_release() 1921 static void idetape_release(struct gendisk *disk, fmode_t mode) idetape_release() argument 1923 struct ide_tape_obj *tape = ide_drv_g(disk, ide_tape_obj); idetape_release() 1995 tape->disk = g; ide_tape_probe()
|
H A D | ide-cd.h | 42 /* Space to hold the disk TOC. */ 82 struct gendisk *disk; member in struct:cdrom_info
|
H A D | ide-cd.c | 58 static struct cdrom_info *ide_cd_get(struct gendisk *disk) ide_cd_get() argument 63 cd = ide_drv_g(disk, cdrom_info); ide_cd_get() 201 if (sector < get_capacity(info->disk) && cdrom_analyze_sense_data() 203 set_capacity(info->disk, sector); cdrom_analyze_sense_data() 364 /* disk appears blank? */ cdrom_decode_status() 460 error = blk_execute_rq(drive->queue, info->disk, rq, 0); ide_cd_queue_pc() 485 * a disk. Retry, but wait a little to give ide_cd_queue_pc() 714 /* disk has become write protected */ cdrom_start_rw() 715 if (get_disk_ro(cd->disk)) cdrom_start_rw() 949 /* Try to read the entire TOC for the disk into our internal buffer. */ ide_cd_read_toc() 991 set_capacity(info->disk, toc->capacity * sectors_per_frame); ide_cd_read_toc() 1108 set_capacity(info->disk, toc->capacity * sectors_per_frame); ide_cd_read_toc() 1201 devinfo->disk = info->disk; ide_cdrom_register() 1547 del_gendisk(info->disk); ide_cd_remove() 1559 struct gendisk *g = info->disk; ide_cd_release() 1609 static void idecd_release(struct gendisk *disk, fmode_t mode) idecd_release() argument 1611 struct cdrom_info *info = ide_drv_g(disk, cdrom_info); idecd_release() 1694 static unsigned int idecd_check_events(struct gendisk *disk, idecd_check_events() argument 1697 struct cdrom_info *info = ide_drv_g(disk, cdrom_info); idecd_check_events() 1701 static int idecd_revalidate_disk(struct gendisk *disk) idecd_revalidate_disk() argument 1703 struct cdrom_info *info = ide_drv_g(disk, cdrom_info); idecd_revalidate_disk() 1766 info->disk = g; ide_cd_probe()
|
H A D | ide-probe.c | 399 * (e.g. crw9624 as drive0 with disk as slave) do_probe() 578 * - The firmware hard reset the disk before booting the kernel, 610 * I know of at least one disk who takes 31 seconds, I use 35 ide_port_wait_ready() 893 request_module("ide-disk"); ata_probe() 920 void ide_register_region(struct gendisk *disk) ide_register_region() argument 922 blk_register_region(MKDEV(disk->major, disk->first_minor), ide_register_region() 923 disk->minors, NULL, exact_match, exact_lock, disk); ide_register_region() local 928 void ide_unregister_region(struct gendisk *disk) ide_unregister_region() argument 930 blk_unregister_region(MKDEV(disk->major, disk->first_minor), ide_unregister_region() 931 disk->minors); ide_unregister_region() 936 void ide_init_disk(struct gendisk *disk, ide_drive_t *drive) ide_init_disk() argument 941 disk->major = hwif->major; ide_init_disk() 942 disk->first_minor = unit << PARTN_BITS; ide_init_disk() 943 sprintf(disk->disk_name, "hd%c", 'a' + hwif->index * MAX_DRIVES + unit); ide_init_disk() 944 disk->queue = drive->queue; ide_init_disk()
|
H A D | dtc2278.c | 31 * get the full speed. You better get the disk interrupts disabled ( hdparm -u0 33 * filesystem corrupted with -u1, but under heavy disk load only :-)
|
H A D | ide-atapi.c | 89 int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk, ide_queue_pc_tail() argument 109 error = blk_execute_rq(drive->queue, disk, rq, 0); ide_queue_pc_tail() 116 int ide_do_test_unit_ready(ide_drive_t *drive, struct gendisk *disk) ide_do_test_unit_ready() argument 123 return ide_queue_pc_tail(drive, disk, &pc, NULL, 0); ide_do_test_unit_ready() 127 int ide_do_start_stop(ide_drive_t *drive, struct gendisk *disk, int start) ide_do_start_stop() argument 138 return ide_queue_pc_tail(drive, disk, &pc, NULL, 0); ide_do_start_stop() 142 int ide_set_media_lock(ide_drive_t *drive, struct gendisk *disk, int on) ide_set_media_lock() argument 153 return ide_queue_pc_tail(drive, disk, &pc, NULL, 0); ide_set_media_lock()
|
/linux-4.1.27/drivers/scsi/ |
H A D | sd_dif.c | 44 struct gendisk *disk = sdkp->disk; sd_dif_config_host() local 61 blk_integrity_register(disk, &t10_pi_type3_ip); sd_dif_config_host() 63 blk_integrity_register(disk, &t10_pi_type1_ip); sd_dif_config_host() 65 disk->integrity->flags |= BLK_INTEGRITY_IP_CHECKSUM; sd_dif_config_host() 68 blk_integrity_register(disk, &t10_pi_type3_crc); sd_dif_config_host() 70 blk_integrity_register(disk, &t10_pi_type1_crc); sd_dif_config_host() 73 "Enabling DIX %s protection\n", disk->integrity->name); sd_dif_config_host() 78 disk->integrity->flags |= BLK_INTEGRITY_DEVICE_CAPABLE; sd_dif_config_host() 84 disk->integrity->tag_size = sizeof(u16) + sizeof(u32); sd_dif_config_host() 86 disk->integrity->tag_size = sizeof(u16); sd_dif_config_host() 89 disk->integrity->tag_size); sd_dif_config_host() 104 * (we could be reading from real disk as opposed to MD/DM device. So
|
H A D | sr.c | 7 * Linux scsi disk driver by 138 static inline struct scsi_cd *scsi_cd(struct gendisk *disk) scsi_cd() argument 140 return container_of(disk->private_data, struct scsi_cd, driver); scsi_cd() 160 static inline struct scsi_cd *scsi_cd_get(struct gendisk *disk) scsi_cd_get() argument 165 if (disk->private_data == NULL) scsi_cd_get() 167 cd = scsi_cd(disk); scsi_cd_get() 369 if (error_sector < get_capacity(cd->disk) && sr_done() 371 set_capacity(cd->disk, error_sector); sr_done() 536 static void sr_block_release(struct gendisk *disk, fmode_t mode) sr_block_release() argument 538 struct scsi_cd *cd = scsi_cd(disk); sr_block_release() 582 static unsigned int sr_block_check_events(struct gendisk *disk, sr_block_check_events() argument 585 struct scsi_cd *cd = scsi_cd(disk); sr_block_check_events() 593 static int sr_block_revalidate_disk(struct gendisk *disk) sr_block_revalidate_disk() argument 595 struct scsi_cd *cd = scsi_cd(disk); sr_block_revalidate_disk() 654 struct gendisk *disk; sr_probe() local 670 disk = alloc_disk(1); sr_probe() 671 if (!disk) sr_probe() 684 disk->major = SCSI_CDROM_MAJOR; sr_probe() 685 disk->first_minor = minor; sr_probe() 686 sprintf(disk->disk_name, "sr%d", minor); sr_probe() 687 disk->fops = &sr_bdops; sr_probe() 688 disk->flags = GENHD_FL_CD | GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE; sr_probe() 689 disk->events = DISK_EVENT_MEDIA_CHANGE | DISK_EVENT_EJECT_REQUEST; sr_probe() 694 cd->disk = disk; sr_probe() 696 cd->disk = disk; sr_probe() 716 disk->driverfs_dev = &sdev->sdev_gendev; sr_probe() 717 set_capacity(disk, cd->capacity); sr_probe() 718 disk->private_data = &cd->driver; sr_probe() 719 disk->queue = sdev->request_queue; sr_probe() 720 cd->cdi.disk = disk; sr_probe() 732 disk->flags |= GENHD_FL_REMOVABLE; sr_probe() 733 add_disk(disk); sr_probe() 742 put_disk(disk); sr_probe() 823 set_capacity(cd->disk, cd->capacity); get_sectorsize() 969 struct gendisk *disk = cd->disk; sr_kref_release() local 972 clear_bit(MINOR(disk_devt(disk)), sr_index_bits); sr_kref_release() 977 disk->private_data = NULL; sr_kref_release() 979 put_disk(disk); sr_kref_release() 990 del_gendisk(cd->disk); sr_remove()
|
H A D | sd.h | 66 struct gendisk *disk; member in struct:scsi_disk 82 unsigned ATO : 1; /* state of disk ATO bit */ 84 unsigned WCE : 1; /* state of disk WCE bit */ 85 unsigned RCD : 1; /* state of disk RCD bit, unused */ 86 unsigned DPOFUA : 1; /* state of disk DPOFUA bit */ 99 static inline struct scsi_disk *scsi_disk(struct gendisk *disk) scsi_disk() argument 101 return container_of(disk->private_data, struct scsi_disk, driver); scsi_disk() 105 (sdsk)->disk ? \ 107 (sdsk)->disk->disk_name, fmt, ##a) : \ 253 static inline void sd_dif_config_host(struct scsi_disk *disk) sd_dif_config_host() argument
|
H A D | sr.h | 3 * CD-ROM disk driver header file 7 * SCSI disk driver header file by 56 struct gendisk *disk; member in struct:scsi_cd
|
H A D | sd.c | 5 * Linux scsi disk driver 72 MODULE_DESCRIPTION("SCSI disk (sd) driver"); 104 static void sd_unlock_native_capacity(struct gendisk *disk); 147 blk_queue_flush(sdkp->disk->queue, flush); sd_set_flush_flag() 214 revalidate_disk(sdkp->disk); cache_type_store() 539 * Device no to disk mapping: 547 * ones with major1, ... Disk 256 is for major0 again, disk 272 567 static struct scsi_disk *scsi_disk_get(struct gendisk *disk) scsi_disk_get() argument 573 if (disk->private_data) { scsi_disk_get() 574 sdkp = scsi_disk(disk); scsi_disk_get() 634 struct request_queue *q = sdkp->disk->queue; sd_config_discard() 764 * discarded on disk. This allows us to report completion on the full sd_setup_discard_cmnd() 779 struct request_queue *q = sdkp->disk->queue; sd_config_write_same() 887 struct gendisk *disk = rq->rq_disk; sd_setup_read_write_cmnd() local 900 sdkp = scsi_disk(disk); sd_setup_read_write_cmnd() 912 block + blk_rq_sectors(rq) > get_capacity(disk)) { sd_setup_read_write_cmnd() 926 /* printk("SCSI disk has been changed or is not present. Prohibiting further I/O.\n"); */ sd_setup_read_write_cmnd() 934 threshold = get_capacity(disk) - SD_LAST_BUGGY_SECTORS * sd_setup_read_write_cmnd() 958 * and not force the scsi disk driver to use bounce buffers sd_setup_read_write_cmnd() 1150 * sd_open - open a scsi disk device 1204 * It is possible that the disk changing stuff resulted in sd_open() 1227 * scsi disk. 1234 * on this disk. 1238 static void sd_release(struct gendisk *disk, fmode_t mode) sd_release() argument 1240 struct scsi_disk *sdkp = scsi_disk(disk); sd_release() 1300 struct gendisk *disk = bdev->bd_disk; sd_ioctl() local 1301 struct scsi_disk *sdkp = scsi_disk(disk); sd_ioctl() 1306 SCSI_LOG_IOCTL(1, sd_printk(KERN_INFO, sdkp, "sd_ioctl: disk=%s, " sd_ioctl() 1307 "cmd=0x%x\n", disk->disk_name, cmd)); sd_ioctl() 1377 * @disk: kernel device descriptor 1378 * @clearing: disk events currently being cleared 1384 static unsigned int sd_check_events(struct gendisk *disk, unsigned int clearing) sd_check_events() argument 1386 struct scsi_disk *sdkp = scsi_disk(disk); sd_check_events() 1431 * For removable scsi disk we have to recognise the presence sd_check_events() 1432 * of a disk in the drive. sd_check_events() 1510 revalidate_disk(sdkp->disk); sd_rescan() 1591 "Medium access timeout failure. Offlining disk!\n"); sd_eh_action() 1742 * spinup disk - called only in sd_revalidate_disk() 1813 sd_printk(KERN_NOTICE, sdkp, "Spinning up disk..."); sd_spinup_disk() 1867 * Determine whether disk supports Data Integrity Field. 1889 " protection type %u. Disabling disk!\n", sd_read_protection_type() 2117 * read disk capacity 2262 set_disk_ro(sdkp->disk, 0); sd_read_write_protect_flag() 2300 set_disk_ro(sdkp->disk, sdkp->write_prot); sd_read_write_protect_flag() 2534 * sd_read_block_limits - Query disk device for preferred I/O sizes. 2535 * @disk: disk to query 2553 blk_queue_io_min(sdkp->disk->queue, sd_read_block_limits() 2555 blk_queue_io_opt(sdkp->disk->queue, sd_read_block_limits() 2605 * @disk: disk to query 2623 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, sdkp->disk->queue); sd_read_block_characteristics() 2624 queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, sdkp->disk->queue); sd_read_block_characteristics() 2633 * @disk: disk to query 2706 * sd_revalidate_disk - called the first time a new disk is seen, 2707 * performs disk spin up, read_capacity, etc. 2708 * @disk: struct gendisk we care about 2710 static int sd_revalidate_disk(struct gendisk *disk) sd_revalidate_disk() argument 2712 struct scsi_disk *sdkp = scsi_disk(disk); sd_revalidate_disk() 2766 sdkp->disk->queue->limits.max_sectors = sd_revalidate_disk() 2767 min_not_zero(queue_max_hw_sectors(sdkp->disk->queue), max_xfer); sd_revalidate_disk() 2769 set_capacity(disk, logical_to_sectors(sdp, sdkp->capacity)); sd_revalidate_disk() 2779 * @disk: struct gendisk to set capacity for 2782 * on @disk reach beyond the end of the device. If the SCSI host 2789 static void sd_unlock_native_capacity(struct gendisk *disk) sd_unlock_native_capacity() argument 2791 struct scsi_device *sdev = scsi_disk(disk)->device; sd_unlock_native_capacity() 2798 * sd_format_disk_name - format disk name 2800 * @index: index of the disk to format name for 2804 * SCSI disk names starts at sda. The 26th device is sdz and the 2855 gd = sdkp->disk; sd_probe_async() 2960 sdev_printk(KERN_WARNING, sdp, "SCSI disk (sd) name length exceeded.\n"); sd_probe() 2966 sdkp->disk = gd; sd_probe() 3009 * sd_remove - called whenever a scsi disk (previously recognized by 3025 devt = disk_devt(sdkp->disk); sd_remove() 3031 del_gendisk(sdkp->disk); sd_remove() 3057 struct gendisk *disk = sdkp->disk; scsi_disk_release() local 3063 blk_integrity_unregister(disk); scsi_disk_release() 3064 disk->private_data = NULL; scsi_disk_release() 3065 put_disk(disk); scsi_disk_release() 3127 sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n"); sd_shutdown() 3152 sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n"); sd_suspend_common() 3183 sd_printk(KERN_NOTICE, sdkp, "Starting disk\n"); sd_resume() 3279 sdkp->disk ? sdkp->disk->disk_name : NULL, sshdr); sd_print_sense_hdr()
|
H A D | scsicam.c | 55 * scsicam_bios_param - Determine geometry of a disk in cylinders/heads/sectors. 57 * @capacity: size of the disk in sectors 114 * @capacity: size of the disk in sectors 201 * SCSI disk in terms of lost space of size capacity, storing 226 * of the disk while allowing for very large disks to be
|
H A D | imm.h | 31 * Have mounted disk, copied file, dismounted disk, remount disk, diff file
|
H A D | hpsa_cmd.h | 201 u32 ioaccel_handle; /**< Handle to access this disk via the 214 * disk blocks */ 218 __le16 strip_size; /* blocks used on each disk / stripe */ 219 __le64 disk_starting_blk; /* First disk block used in volume */ 220 __le64 disk_blk_cnt; /* disk blocks used by volume / disk */ 221 __le16 data_disks_per_row; /* data disk entries / row in the map */ 222 __le16 metadata_disks_per_row;/* mirror/parity disk entries / row 416 * bypass the RAID stack and go directly to the physical disk
|
/linux-4.1.27/arch/m68k/emu/ |
H A D | nfblock.c | 59 struct gendisk *disk; member in struct:nfhd_device 128 dev->disk = alloc_disk(16); nfhd_init_one() 129 if (!dev->disk) nfhd_init_one() 132 dev->disk->major = major_num; nfhd_init_one() 133 dev->disk->first_minor = dev_id * 16; nfhd_init_one() 134 dev->disk->fops = &nfhd_ops; nfhd_init_one() 135 dev->disk->private_data = dev; nfhd_init_one() 136 sprintf(dev->disk->disk_name, "nfhd%u", dev_id); nfhd_init_one() 137 set_capacity(dev->disk, (sector_t)blocks * (bsize / 512)); nfhd_init_one() 138 dev->disk->queue = dev->queue; nfhd_init_one() 140 add_disk(dev->disk); nfhd_init_one() 184 del_gendisk(dev->disk); nfhd_exit() 185 put_disk(dev->disk); nfhd_exit()
|
/linux-4.1.27/init/ |
H A D | do_mounts_rd.c | 27 int __initdata rd_prompt = 1;/* 1 = prompt for RAM disk, 0 = don't prompt */ 48 * This routine tries to find a RAM disk image to load, and returns the 176 "RAMDISK: Couldn't find valid RAM disk image starting at %d.\n", identify_ramdisk_image() 190 int nblocks, i, disk; rd_load_image() local 260 printk(KERN_NOTICE "RAMDISK: Loading %dKiB [%ld disk%s] into ram disk... ", rd_load_image() 262 for (i = 0, disk = 1; i < nblocks; i++) { rd_load_image() 264 printk("done disk #%d.\n", disk++); rd_load_image() 267 printk("Error closing the disk.\n"); rd_load_image() 270 change_floppy("disk #%d", disk); rd_load_image() 273 printk("Error opening disk.\n"); rd_load_image() 276 printk("Loading disk #%d... ", disk); rd_load_image() 304 change_floppy("root floppy disk to be loaded into RAM disk"); rd_load_disk()
|
H A D | do_mounts.c | 38 int __initdata rd_doload; /* 1 = load RAM disk, 0 = don't load */ 121 struct gendisk *disk; devt_from_partuuid() local 161 disk = part_to_disk(dev_to_part(dev)); devt_from_partuuid() 162 part = disk_get_part(disk, dev_to_part(dev)->partno + offset); devt_from_partuuid() 188 * 3) /dev/<disk_name> represents the device number of disk 190 * of partition - device number of disk plus the partition number 192 * used when disk name of partitioned disk ends on a digit. 197 * filled hex representation of the 32-bit "NT disk signature", and PP 205 * block_class is used to check if something is a disk name. If the disk 264 * after revalidating the disk, like partitioned md devices name_to_dev_t() 271 /* try disk name without <part number> */ name_to_dev_t() 278 /* try disk name without p<part number> */ name_to_dev_t()
|
H A D | do_mounts_initrd.c | 69 * In case that a resume from disk is carried out by linuxrc or one of handle_initrd() 126 * in that case the ram disk is just set up here, and gets initrd_load()
|
/linux-4.1.27/Documentation/laptops/ |
H A D | dslm.c | 26 /* Check if the disk is in powersave-mode 128 puts("usage: dslm [-w <time>] <disk>"); usage() 135 char *disk = 0; main() local 140 disk = argv[1]; main() 143 disk = argv[3]; main() 147 if (!(fd = open(disk, O_RDONLY|O_NONBLOCK))) { main() 148 printf("Can't open %s, because: %s\n", disk, strerror(errno)); main()
|
/linux-4.1.27/drivers/md/ |
H A D | dm-era-target.c | 37 * disk. 43 * This does not free off the on disk bitset as this will normally be done 85 * Wipes the in-core bitset, and creates a new on disk bitset. 150 * On disk metadata layout 194 struct superblock_disk *disk = dm_block_data(b); sb_prepare_for_write() local 196 disk->blocknr = cpu_to_le64(dm_block_location(b)); sb_prepare_for_write() 197 disk->csum = cpu_to_le32(dm_bm_checksum(&disk->flags, sb_prepare_for_write() 202 static int check_metadata_version(struct superblock_disk *disk) check_metadata_version() argument 204 uint32_t metadata_version = le32_to_cpu(disk->version); check_metadata_version() 218 struct superblock_disk *disk = dm_block_data(b); sb_check() local 221 if (dm_block_location(b) != le64_to_cpu(disk->blocknr)) { sb_check() 223 le64_to_cpu(disk->blocknr), sb_check() 228 if (le64_to_cpu(disk->magic) != SUPERBLOCK_MAGIC) { sb_check() 230 le64_to_cpu(disk->magic), sb_check() 235 csum_le = cpu_to_le32(dm_bm_checksum(&disk->flags, sb_check() 238 if (csum_le != disk->csum) { sb_check() 240 le32_to_cpu(csum_le), le32_to_cpu(disk->csum)); sb_check() 244 return check_metadata_version(disk); sb_check() 351 static void ws_pack(const struct writeset_metadata *core, struct writeset_disk *disk) ws_pack() argument 353 disk->nr_bits = cpu_to_le32(core->nr_bits); ws_pack() 354 disk->root = cpu_to_le64(core->root); ws_pack() 357 static void ws_unpack(const struct writeset_disk *disk, struct writeset_metadata *core) ws_unpack() argument 359 core->nr_bits = le32_to_cpu(disk->nr_bits); ws_unpack() 360 core->root = le64_to_cpu(disk->root); ws_unpack() 475 static void copy_sm_root(struct era_metadata *md, struct superblock_disk *disk) copy_sm_root() argument 477 memcpy(&disk->metadata_space_map_root, copy_sm_root() 487 static void prepare_superblock(struct era_metadata *md, struct superblock_disk *disk) prepare_superblock() argument 489 disk->magic = cpu_to_le64(SUPERBLOCK_MAGIC); prepare_superblock() 490 disk->flags = cpu_to_le32(0ul); prepare_superblock() 493 memset(disk->uuid, 0, sizeof(disk->uuid)); prepare_superblock() 494 disk->version = cpu_to_le32(MAX_ERA_VERSION); prepare_superblock() 496 copy_sm_root(md, disk); prepare_superblock() 498 disk->data_block_size = cpu_to_le32(md->block_size); prepare_superblock() 499 disk->metadata_block_size = cpu_to_le32(DM_ERA_METADATA_BLOCK_SIZE >> SECTOR_SHIFT); prepare_superblock() 500 disk->nr_blocks = cpu_to_le32(md->nr_blocks); prepare_superblock() 501 disk->current_era = cpu_to_le32(md->current_era); prepare_superblock() 503 ws_pack(&md->current_writeset->md, &disk->current_writeset); prepare_superblock() 504 disk->writeset_tree_root = cpu_to_le64(md->writeset_tree_root); prepare_superblock() 505 disk->era_array_root = cpu_to_le64(md->era_array_root); prepare_superblock() 506 disk->metadata_snap = cpu_to_le64(md->metadata_snap); prepare_superblock() 513 struct superblock_disk *disk; write_superblock() local 525 disk = dm_block_data(sblock); write_superblock() 526 prepare_superblock(md, disk); write_superblock() 556 struct superblock_disk *disk; open_metadata() local 564 disk = dm_block_data(sblock); open_metadata() 566 disk->metadata_space_map_root, open_metadata() 567 sizeof(disk->metadata_space_map_root), open_metadata() 576 md->block_size = le32_to_cpu(disk->data_block_size); open_metadata() 577 md->nr_blocks = le32_to_cpu(disk->nr_blocks); open_metadata() 578 md->current_era = le32_to_cpu(disk->current_era); open_metadata() 580 md->writeset_tree_root = le64_to_cpu(disk->writeset_tree_root); open_metadata() 581 md->era_array_root = le64_to_cpu(disk->era_array_root); open_metadata() 582 md->metadata_snap = le64_to_cpu(disk->metadata_snap); open_metadata() 722 struct writeset_disk disk; metadata_digest_lookup_writeset() local 732 md->writeset_tree_root, &key, &disk); metadata_digest_lookup_writeset() 743 ws_unpack(&disk, &d->writeset); metadata_digest_lookup_writeset() 1064 struct superblock_disk *disk; metadata_drop_snap() local 1083 disk = dm_block_data(clone); metadata_drop_snap() 1085 le64_to_cpu(disk->writeset_tree_root)); metadata_drop_snap() 1092 r = dm_array_del(&md->era_array_info, le64_to_cpu(disk->era_array_root)); metadata_drop_snap()
|
H A D | dm-bufio.h | 44 * Read a given block from disk. Returns pointer to data. Returns a 59 * Like dm_bufio_read, but don't read anything from the disk. It is 84 * dm_bufio_write_dirty_buffers guarantees that the buffer is on-disk but 96 * to this call are on disk when this call exits. 101 * Send an empty write barrier to the device to flush hardware disk cache.
|
H A D | dm-log.c | 60 * For example, if type_name was "clustered-disk", it would search 61 * 'dm-log-clustered-disk' then 'dm-log-clustered'. 195 * The on-disk version of the metadata. 280 static void header_to_disk(struct log_header_core *core, struct log_header_disk *disk) header_to_disk() argument 282 disk->magic = cpu_to_le32(core->magic); header_to_disk() 283 disk->version = cpu_to_le32(core->version); header_to_disk() 284 disk->nr_regions = cpu_to_le64(core->nr_regions); header_to_disk() 287 static void header_from_disk(struct log_header_core *core, struct log_header_disk *disk) header_from_disk() argument 289 core->magic = le32_to_cpu(disk->magic); header_from_disk() 290 core->version = le32_to_cpu(disk->version); header_from_disk() 291 core->nr_regions = le64_to_cpu(disk->nr_regions); header_from_disk() 337 DMWARN("incompatible disk log version"); read_header() 462 DMWARN("couldn't allocate disk io client"); create_log_context() 469 DMWARN("couldn't allocate disk log buffer"); create_log_context() 536 * disk log constructor/destructor 547 DMWARN("wrong number of arguments to disk dirty region log"); disk_ctr() 590 /* read the disk header */ disk_resume() 692 * re-reading the log off disk). So mark all of them disk_flush() 842 .name = "disk", 870 DMWARN("couldn't register disk type"); dm_dirty_log_init()
|
H A D | raid1.c | 286 * Update disk head position estimator based on IRQ completion info. 288 static inline void update_head_pos(int disk, struct r1bio *r1_bio) update_head_pos() argument 292 conf->mirrors[disk].head_position = update_head_pos() 297 * Find the disk number which triggered given bio 498 * This routine returns the disk from which the requested read should 500 * number - if this matches on the next IO then we use the last disk. 501 * There is also a per-disk 'last know head position' sector that is 504 * perfect sequential match then we pick the disk whose head is closest. 518 int disk; read_balance() local 529 * We take the first readable disk when above the resync window. read_balance() 550 for (disk = 0 ; disk < conf->raid_disks * 2 ; disk++) { read_balance() 557 rdev = rcu_dereference(conf->mirrors[disk].rdev); read_balance() 558 if (r1_bio->bios[disk] == IO_BLOCKED read_balance() 578 best_dist_disk = disk; read_balance() 579 best_pending_disk = disk; read_balance() 606 best_disk = disk; read_balance() 618 dist = abs(this_sector - conf->mirrors[disk].head_position); read_balance() 620 best_disk = disk; read_balance() 623 /* Don't change to another disk for sequential reads */ read_balance() 624 if (conf->mirrors[disk].next_seq_sect == this_sector read_balance() 627 struct raid1_info *mirror = &conf->mirrors[disk]; read_balance() 629 best_disk = disk; read_balance() 632 * iosize, check if there is idle disk. If yes, choose read_balance() 633 * the idle disk. read_balance could already choose an read_balance() 634 * idle disk before noticing it's a sequential IO in read_balance() 635 * this disk. This doesn't matter because this disk read_balance() 637 * first disk has IO size exceeds optimal iosize. In read_balance() 638 * this way, iosize of the first disk will be optimal read_balance() 639 * iosize at least. iosize of the second disk might be read_balance() 640 * small, but not a big deal since when the second disk read_balance() 641 * starts IO, the first disk is likely still busy. read_balance() 655 best_disk = disk; read_balance() 664 best_pending_disk = disk; read_balance() 669 best_dist_disk = disk; read_balance() 674 * If all disks are rotational, choose the closest disk. If any disk is read_balance() 675 * non-rotational, choose the disk with less pending request even the read_balance() 676 * disk is rotational, which might/might not be optimal for raids with read_balance() 720 int disk; raid1_mergeable_bvec() local 722 for (disk = 0; disk < conf->raid_disks * 2; disk++) { raid1_mergeable_bvec() 724 conf->mirrors[disk].rdev); raid1_mergeable_bvec() 786 * disk before proceeding w/ I/O */ flush_pending_writes() 1304 * only applies if the disk is make_request() 1534 printk(KERN_DEBUG " disk %d, wo:%d, o:%d, dev:%s\n", print_conf() 2319 int disk; handle_read_error() local 2347 disk = read_balance(conf, r1_bio, &max_sectors); handle_read_error() 2348 if (disk == -1) { handle_read_error() 2361 r1_bio->read_disk = disk; handle_read_error() 2366 rdev = conf->mirrors[disk].rdev; handle_read_error() 2491 int disk = -1; sync_request() local 2594 if (disk < 0) sync_request() 2595 disk = i; sync_request() 2622 if (disk < 0) sync_request() 2623 disk = wonly; sync_request() 2624 r1_bio->read_disk = disk; sync_request() 2726 } while (r1_bio->bios[disk]->bi_vcnt < RESYNC_PAGES); sync_request() 2765 struct raid1_info *disk; setup_conf() local 2804 disk = conf->mirrors + mddev->raid_disks + disk_idx; rdev_for_each() 2806 disk = conf->mirrors + disk_idx; rdev_for_each() 2808 if (disk->rdev) rdev_for_each() 2810 disk->rdev = rdev; rdev_for_each() 2815 disk->head_position = 0; rdev_for_each() 2816 disk->seq_start = MaxSector; rdev_for_each() 2835 disk = conf->mirrors + i; 2838 disk[conf->raid_disks].rdev) { 2840 if (!disk->rdev) { 2844 disk->rdev = 2845 disk[conf->raid_disks].rdev; 2846 disk[conf->raid_disks].rdev = NULL; 2847 } else if (!test_bit(In_sync, &disk->rdev->flags)) 2852 if (!disk->rdev || 2853 !test_bit(In_sync, &disk->rdev->flags)) { 2854 disk->head_position = 0; 2855 if (disk->rdev && 2856 (disk->rdev->saved_raid_disk < 0))
|
H A D | bitmap.h | 44 * The counter counts pending write requests, plus the on-disk bit. 45 * When the counter is '1' and the resync bits are clear, the on-disk 48 * 0, we first set the disk bit and set the counter to 1. 50 * If the counter is 0, the on-disk bit is clear and the stipe is clean 52 * and sets the on-disk bit (lazily). 54 * If the sweep find the counter at 1, the on-disk bit is cleared and the 129 __le32 daemon_sleep; /* 56 seconds between disk flushes */ 198 struct file *file; /* backing disk file */ 218 * file, cleaning up bits and flushing out pages to disk as necessary
|
H A D | linear.c | 142 struct dev_info *disk = conf->disks + j; rdev_for_each() local 145 if (j < 0 || j >= raid_disks || disk->rdev) { rdev_for_each() 146 printk(KERN_ERR "md/linear:%s: disk numbering problem. Aborting!\n", rdev_for_each() 151 disk->rdev = rdev; rdev_for_each()
|
H A D | multipath.c | 40 * now we use the first available disk. multipath_map() 200 * Mark disk as unusable multipath_error() 235 printk(" disk%d, o:%d, dev:%s\n", print_multipath_conf() 302 printk(KERN_ERR "hot-remove-disk, slot %d is identified" multipath_remove_disk() 389 struct multipath_info *disk; multipath_run() local 432 disk = conf->multipaths + disk_idx; rdev_for_each() 433 disk->rdev = rdev; rdev_for_each()
|
/linux-4.1.27/drivers/block/drbd/ |
H A D | drbd_state.c | 74 if (device->state.disk != D_DISKLESS || conn_all_vols_unconf() 146 disk_state = max_t(enum drbd_disk_state, disk_state, device->state.disk); conn_highest_disk() 162 disk_state = min_t(enum drbd_disk_state, disk_state, device->state.disk); conn_lowest_disk() 244 (os.disk != D_FAILED && ns.disk == D_FAILED))) || cl_wide_st_chg() 448 drbd_disk_str(ns.disk), print_st() 488 if (ns.disk != os.disk && flags & CS_DC_DISK) print_state_change() 489 pbp += sprintf(pbp, "disk( %s -> %s ) ", print_state_change() 490 drbd_disk_str(os.disk), print_state_change() 491 drbd_disk_str(ns.disk)); print_state_change() 579 else if (ns.role == R_PRIMARY && ns.conn < C_CONNECTED && ns.disk < D_UP_TO_DATE) is_valid_state() 586 else if (ns.role == R_PRIMARY && ns.disk <= D_INCONSISTENT && ns.pdsk <= D_INCONSISTENT) is_valid_state() 589 else if (ns.conn > C_CONNECTED && ns.disk < D_INCONSISTENT) is_valid_state() 595 else if (ns.conn > C_CONNECTED && ns.disk < D_UP_TO_DATE && ns.pdsk < D_UP_TO_DATE) is_valid_state() 602 ns.disk == D_OUTDATED) is_valid_state() 613 else if (ns.role == R_PRIMARY && ns.disk < D_UP_TO_DATE && ns.pdsk < D_UP_TO_DATE) is_valid_state() 648 if (ns.disk > D_ATTACHING && os.disk == D_DISKLESS) is_valid_soft_transition() 654 if (ns.disk == D_OUTDATED && os.disk < D_OUTDATED && os.disk != D_ATTACHING) is_valid_soft_transition() 724 * imposed on DRBD by the environment. E.g. disk broke or network broke down. 737 if (ns.disk == D_FAILED && os.disk == D_DISKLESS) is_valid_transition() 750 [IMPLICITLY_UPGRADED_DISK] = "Implicitly upgraded disk", print_sanitize_warnings() 765 * When we loose connection, we have to set the state of the peers disk (pdsk) 794 if (ns.conn == C_STANDALONE && ns.disk == D_DISKLESS && ns.role == R_SECONDARY) sanitize_state() 797 /* An implication of the disk states onto the connection state */ sanitize_state() 798 /* Abort resync if a disk fails/detaches */ sanitize_state() 799 if (ns.conn > C_CONNECTED && (ns.disk <= D_FAILED || ns.pdsk <= D_FAILED)) { sanitize_state() 807 if (ns.conn < C_CONNECTED && ns.disk == D_NEGOTIATING && sanitize_state() 810 ns.disk = device->new_state_tmp.disk; sanitize_state() 815 ns.disk = D_DISKLESS; sanitize_state() 823 if (ns.disk == D_CONSISTENT || ns.disk == D_OUTDATED) sanitize_state() 824 ns.disk = D_UP_TO_DATE; sanitize_state() 829 /* Implications of the connection stat on the disk states */ sanitize_state() 892 if (ns.disk > disk_max) sanitize_state() 893 ns.disk = disk_max; sanitize_state() 895 if (ns.disk < disk_min) { sanitize_state() 898 ns.disk = disk_min; sanitize_state() 915 (ns.role == R_PRIMARY && ns.disk < D_UP_TO_DATE && ns.pdsk < D_UP_TO_DATE) && sanitize_state() 916 !(os.role == R_PRIMARY && os.disk < D_UP_TO_DATE && os.pdsk < D_UP_TO_DATE)) sanitize_state() 1033 if ((os.disk != D_FAILED && ns.disk == D_FAILED) || __drbd_set_state() 1034 (os.disk != D_DISKLESS && ns.disk == D_DISKLESS)) __drbd_set_state() 1055 if (os.disk == D_ATTACHING && ns.disk >= D_NEGOTIATING) __drbd_set_state() 1133 if (device->state.disk > D_INCONSISTENT) __drbd_set_state() 1135 if (device->state.disk > D_OUTDATED) __drbd_set_state() 1143 if (os.disk < D_CONSISTENT && ns.disk >= D_CONSISTENT) __drbd_set_state() 1149 if (os.disk == D_INCONSISTENT && os.pdsk == D_INCONSISTENT && __drbd_set_state() 1175 if ((os.disk == D_ATTACHING || os.disk == D_NEGOTIATING) && __drbd_set_state() 1176 ns.disk > D_NEGOTIATING) __drbd_set_state() 1267 if ((os.disk != D_UP_TO_DATE || os.pdsk != D_UP_TO_DATE) after_state_ch() 1268 && (ns.disk == D_UP_TO_DATE && ns.pdsk == D_UP_TO_DATE)) { after_state_ch() 1277 if (!(os.role == R_PRIMARY && os.disk < D_UP_TO_DATE && os.pdsk < D_UP_TO_DATE) && after_state_ch() 1278 (ns.role == R_PRIMARY && ns.disk < D_UP_TO_DATE && ns.pdsk < D_UP_TO_DATE)) after_state_ch() 1291 if ((os.disk == D_ATTACHING || os.disk == D_NEGOTIATING) && after_state_ch() 1367 device->ldev->md.uuid[UI_BITMAP] == 0 && ns.disk >= D_UP_TO_DATE) { 1381 device->ldev->md.uuid[UI_BITMAP] == 0 && ns.disk >= D_UP_TO_DATE) { 1409 os.disk == D_ATTACHING && ns.disk == D_NEGOTIATING) { 1444 if (os.disk != D_FAILED && ns.disk == D_FAILED) { 1462 * that waits for completion from the local disk, 1480 if (device->state.disk != D_FAILED) 1482 "ASSERT FAILED: disk is %s during detach\n", 1483 drbd_disk_str(device->state.disk)); 1501 if (os.disk != D_DISKLESS && ns.disk == D_DISKLESS) { 1504 if (device->state.disk != D_DISKLESS) 1506 "ASSERT FAILED: disk is %s while going diskless\n", 1507 drbd_disk_str(device->state.disk)); 1517 if (os.disk == D_UP_TO_DATE && ns.disk == D_INCONSISTENT && ns.conn >= C_CONNECTED) 1521 if (ns.disk > D_NEGOTIATING && ns.pdsk > D_NEGOTIATING && 1535 if (os.disk < D_UP_TO_DATE && os.conn >= C_SYNC_SOURCE && ns.conn == C_CONNECTED) 1546 * if the resync finished cleanly, or aborted because of peer disk 1548 * For resync aborted because of local disk failure, we cannot do 1558 if (ns.disk == D_DISKLESS && 1645 .disk = D_DISKLESS, conn_old_common_state() 1669 if (cs.disk != os.disk) conn_old_common_state() 1697 if (flags & CS_IGN_OUTD_FAIL && ns.disk == D_OUTDATED && os.disk < D_OUTDATED) conn_is_valid_transition() 1698 ns.disk = os.disk; conn_is_valid_transition() 1734 .disk = D_MASK, conn_set_state() 1759 if (flags & CS_IGN_OUTD_FAIL && ns.disk == D_OUTDATED && os.disk < D_OUTDATED) conn_set_state() 1760 ns.disk = os.disk; conn_set_state() 1770 ns_max.disk = max_t(enum drbd_disk_state, ns.disk, ns_max.disk); conn_set_state() 1776 ns_min.disk = min_t(enum drbd_disk_state, ns.disk, ns_min.disk); conn_set_state() 1786 .disk = D_DISKLESS, conn_set_state()
|
H A D | drbd_strings.c | 77 [-SS_NO_LOCAL_DISK] = "Can not resync without local disk", 78 [-SS_NO_REMOTE_DISK] = "Can not resync without remote disk", 84 [-SS_IS_DISKLESS] = "Device is diskless, the requested operation requires a disk",
|
H A D | drbd_protocol.h | 33 P_NEG_ACK = 0x19, /* Sent if local disk is unusable */ 34 P_NEG_DREPLY = 0x1a, /* Local disk is broken... */ 35 P_NEG_RS_DREPLY = 0x1b, /* Local disk is broken... */ 239 u64 d_size; /* size of disk */
|
H A D | drbd_proc.c | 259 ds .. disk state (local/remote) drbd_seq_show() 264 dw .. disk write drbd_seq_show() 265 dr .. disk read drbd_seq_show() 286 state.disk == D_DISKLESS && drbd_seq_show() 302 drbd_disk_str(state.disk), drbd_seq_show()
|
H A D | drbd_actlog.c | 44 * in the on disk ring buffer */ 101 device->state.disk <= D_FAILED); drbd_md_get_buffer() 164 if (!(rw & WRITE) && device->state.disk == D_DISKLESS && device->ldev == NULL) _drbd_md_sync_page_io() 446 /* transaction number, modulo on-disk ring buffer wrap around */ al_tr_number_to_on_disk_sector() 449 /* ... to aligned 4k on disk block */ al_tr_number_to_on_disk_sector() 455 /* ... plus offset to the on disk position */ al_tr_number_to_on_disk_sector() 470 drbd_err(device, "disk is %s, cannot start al transaction\n", al_write_transaction() 471 drbd_disk_str(device->state.disk)); al_write_transaction() 476 if (device->state.disk < D_INCONSISTENT) { al_write_transaction() 478 "disk is %s, cannot write al transaction\n", al_write_transaction() 479 drbd_disk_str(device->state.disk)); al_write_transaction() 487 drbd_err(device, "disk failed while waiting for md_io buffer\n"); al_write_transaction() 647 * TODO will be obsoleted once we have a caching lru of the on disk bitmap 849 return 0; /* no disk, no metadata, no bitmap to manipulate bits in */ __drbd_change_sync()
|
/linux-4.1.27/include/uapi/linux/ |
H A D | romfs_fs.h | 22 /* On-disk "super block" */ 32 /* On disk inode */
|
H A D | bfs_fs.h | 2 * include/linux/bfs_fs.h - BFS data structures on disk. 22 /* BFS inode layout on disk */ 49 /* BFS superblock layout on disk */
|
H A D | blkpg.h | 5 * Partition table and disk geometry handling 11 * find the device number of the encompassing disk) 12 * get_all_partitions() (given the device number of a disk, return the
|
H A D | minix_fs.h | 31 * This is the original minix inode layout on disk. 63 * minix super-block data on disk 79 * V3 minix super-block data on disk
|
H A D | fd.h | 59 /* set/get disk parameters */ 77 /* begin formatting a disk */ 81 /* end formatting a disk */ 141 unsigned char spindown_offset; /* decides in which position the disk 156 * disk changes. 171 * used in succession to try to read the disk. If the FDC cannot lock onto 172 * the disk, the next format is tried. This uses the variable 'probing'. 176 int checkfreq; /* how often should the drive be checked for disk 187 FD_DISK_CHANGED_BIT, /* disk has been changed since last i/o */ 188 FD_DISK_WRITABLE_BIT, /* disk is writable */ 228 unsigned long last_checked; /* when was the drive last checked for a disk 331 #define FD_RAW_DISK_CHANGE 4 /* out: disk change flag was set */ 333 #define FD_RAW_SPIN 0x10 /* spin up the disk for this command */ 336 #define FD_RAW_NEED_DISK 0x40 /* this command needs a disk to be present */ 379 /* eject the disk */
|
H A D | dqblk_xfs.h | 36 #define Q_XGETQUOTA XQM_CMD(3) /* get disk limits and usage */ 37 #define Q_XSETQLIM XQM_CMD(4) /* set disk limits */ 39 #define Q_XQUOTARM XQM_CMD(6) /* free disk space used by dquots */ 56 __u64 d_blk_hardlimit;/* absolute limit on disk blks */ 57 __u64 d_blk_softlimit;/* preferred limit on disk blks */ 60 __u64 d_bcount; /* # disk blocks owned by the user */ 64 __s32 d_btimer; /* similar to above; for disk blocks */ 66 __u16 d_bwarns; /* # warnings issued wrt disk blocks */ 69 __u64 d_rtb_softlimit;/* preferred limit on RT disk blks */ 71 __s32 d_rtbtimer; /* similar to above; for RT disk blks */ 72 __u16 d_rtbwarns; /* # warnings issued wrt RT disk blks */
|
H A D | parport.h | 42 PARPORT_CLASS_HDC, /* Hard disk controller */ 45 PARPORT_CLASS_FDC, /* Floppy disk controller */
|
H A D | bcache.h | 5 * Bcache on disk data structures 53 /* Next time I change the on disk format, KEY_OFFSET() won't be 64 bits */ 260 * On disk format for a journal entry: 265 * flushed to disk yet. 267 * version is for on disk format changes. 345 * On disk a btree node is a list/log of these; within each set the keys are
|
H A D | efs_fs_sb.h | 24 /* efs superblock on disk */
|
H A D | qnx4_fs.h | 41 * This is the original qnx4 inode layout on disk.
|
H A D | resource.h | 69 * and other sensitive information are never written to disk.
|
/linux-4.1.27/block/partitions/ |
H A D | sysv68.c | 11 * Volume ID structure: on first 256-bytes sector of disk 20 * config block: second 256-bytes sector on disk 76 slices -= 1; /* last slice is the whole disk */ sysv68_partition()
|
H A D | efi.c | 34 * - check for first/last_usable_lba outside of size of disk 40 * - On-disk structure and copy in memory is *always* LE now - 55 * thing that keeps EFI GUIDs on disk. 75 * sector of an odd-sized disk from user space. No tools have ever 145 * the part[0] entry for this disk, and is the number of 146 * physical sectors available on the disk. 219 * Protective MBRs take up the lesser of the whole disk is_pmbr_valid() 220 * or 2 TiB (32bit LBA), ignoring the rest of the disk. is_pmbr_valid() 223 * the disk size. is_pmbr_valid() 228 * an image from a smaller disk to a larger disk. is_pmbr_valid() 233 pr_debug("GPT: mbr size in lba (%u) different than whole disk (%u).\n", is_pmbr_valid() 242 * read_lba(): Read bytes from disk, starting at given LBA 243 * @state: disk parsed partitions 279 * alloc_read_gpt_entries(): reads partition entries from disk 280 * @state: disk parsed partitions 314 * alloc_read_gpt_header(): Allocates GPT header, reads into it from disk 315 * @state: disk parsed partitions 343 * @state: disk parsed partitions 410 * within the disk. is_gpt_valid() 465 * @lastlba: last lba of the disk 480 * compare_gpts() - Search disk for valid GPT headers and PTEs 554 pr_warn("GPT:Primary header thinks Alt. header is not at the end of the disk.\n"); compare_gpts() 562 pr_warn("GPT:Alternate GPT header not at the end of the disk.\n"); compare_gpts() 575 * find_valid_gpt() - Search disk for valid GPT headers and PTEs 576 * @state: disk parsed partitions 668 * @state: disk parsed partitions 670 * Description: called from check.c, if the disk contains GPT 673 * If the first block on the disk is a legacy MBR,
|
H A D | atari.h | 29 u32 hd_siz; /* size of disk in blocks */
|
H A D | ldm.c | 167 ldm_error("PRIVHEAD disk size doesn't match real disk size"); ldm_parse_privhead() 322 * Read and compare all three privheads from disk. 324 * The privheads on disk show the size and location of the main disk area and 326 * @hd, which contains the real size of the disk. 377 ldm_crit ("Database extends beyond the end of the disk."); ldm_validate_privheads() 543 * ldm_validate_partition_table - Determine whether bdev might be a dynamic disk 547 * disk or not. It looks for an MS-DOS-style partition table containing at 555 * Return: 'true' @state->bdev is a dynamic disk 556 * 'false' @state->bdev is not a dynamic disk, or an error occurred 585 ldm_debug ("Found W2K dynamic disk partition type."); ldm_validate_partition_table() 597 * The primary PRIVHEAD, at the beginning of the physical disk, tells us 598 * the GUID of this disk. This function searches for the GUID in a linked 612 if (!memcmp (v->vblk.disk.disk_id, ldb->ph.disk_id, GUID_SIZE)) ldm_get_disk_objid() 624 * The database contains ALL the partitions for ALL disk groups, so we need to 625 * filter out this specific disk. Using the disk's object id, we can find all 626 * the partitions in the database that belong to this disk. 641 struct vblk *disk; ldm_create_data_partitions() local 647 disk = ldm_get_disk_objid (ldb); ldm_create_data_partitions() 648 if (!disk) { ldm_create_data_partitions() 649 ldm_crit ("Can't find the ID of this disk in the database."); ldm_create_data_partitions() 660 if (part->disk_id != disk->obj_id) ldm_create_data_partitions() 928 struct vblk_disk *disk; ldm_parse_dsk3() local 944 disk = &vb->vblk.disk; ldm_parse_dsk3() 945 ldm_get_vstr (buffer + 0x18 + r_diskid, disk->alt_name, ldm_parse_dsk3() 946 sizeof (disk->alt_name)); ldm_parse_dsk3() 947 if (!ldm_parse_guid (buffer + 0x19 + r_name, disk->disk_id)) ldm_parse_dsk3() 967 struct vblk_disk *disk; ldm_parse_dsk4() local 981 disk = &vb->vblk.disk; ldm_parse_dsk4() 982 memcpy (disk->disk_id, buffer + 0x18 + r_name, GUID_SIZE); ldm_parse_dsk4() 1410 * ldm_get_vblks - Read the on-disk database of VBLKs into memory 1415 * To use the information from the VBLKs, they need to be read from the disk, 1493 * ldm_partition - Find out whether a device is a dynamic disk and handle it 1496 * This determines whether the device @bdev is a dynamic disk and if so creates 1504 * Return: 1 Success, @state->bdev is a dynamic disk and we handled it 1505 * 0 Success, @state->bdev is not a dynamic disk 1507 * Or @state->bdev is a dynamic disk, but it may be corrupted
|
H A D | ibm.c | 80 * - on an ECKD disk it's block 2 find_label() 81 * - on an FBA disk it's block 1 find_label() 82 * - on an CMS formatted FBA disk it is sector 1, even if the block size find_label() 150 * get start of VTOC from the disk label and then search for format1 find_vol1_partitions() 217 * the disk, otherwise we need additional information find_lnx1_partitions() 253 * VM style CMS1 labeled disk find_cms1_partitions() 260 /* disk is reserved minidisk */ find_cms1_partitions()
|
H A D | aix.c | 75 * the part[0] entry for this disk, and is the number of 76 * physical sectors available on the disk. 86 * read_lba(): Read bytes from disk, starting at given LBA 126 * Allocates space for pvd and fill it with disk blocks at @lba 151 * Allocates space for lvn and fill it with disk blocks at @lba
|
H A D | sgi.c | 64 /* All SGI disk labels have 16 partitions, disks under Linux only sgi_partition()
|
/linux-4.1.27/arch/ia64/dig/ |
H A D | setup.c | 34 * is physical disk 1 partition 1 and the Linux root disk is dig_setup() 35 * physical disk 1 partition 2. dig_setup()
|
/linux-4.1.27/fs/ |
H A D | block_dev.c | 812 struct gendisk *disk; bd_start_claiming() local 822 disk = get_gendisk(bdev->bd_dev, &partno); bd_start_claiming() 823 if (!disk) bd_start_claiming() 835 whole = bdget_disk(disk, 0); bd_start_claiming() 839 module_put(disk->fops->owner); bd_start_claiming() 840 put_disk(disk); bd_start_claiming() 862 struct gendisk *disk; member in struct:bd_holder_disk 867 struct gendisk *disk) bd_find_holder_disk() 872 if (holder->disk == disk) bd_find_holder_disk() 888 * bd_link_disk_holder - create symlinks between holding disk and slave bdev 890 * @disk: the holding disk 896 * - from "slaves" directory of the holder @disk to the claimed @bdev 897 * - from "holders" directory of the @bdev to the holder @disk 899 * For example, if /dev/dm-0 maps to /dev/sda and disk for dm-0 is 906 * ensure that both @bdev and @disk are valid during the creation and 915 int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) bd_link_disk_holder() argument 925 if (WARN_ON(!disk->slave_dir || !bdev->bd_part->holder_dir)) bd_link_disk_holder() 928 holder = bd_find_holder_disk(bdev, disk); bd_link_disk_holder() 941 holder->disk = disk; bd_link_disk_holder() 944 ret = add_symlink(disk->slave_dir, &part_to_dev(bdev->bd_part)->kobj); bd_link_disk_holder() 948 ret = add_symlink(bdev->bd_part->holder_dir, &disk_to_dev(disk)->kobj); bd_link_disk_holder() 961 del_symlink(disk->slave_dir, &part_to_dev(bdev->bd_part)->kobj); bd_link_disk_holder() 973 * @disk: the holding disk 980 void bd_unlink_disk_holder(struct block_device *bdev, struct gendisk *disk) bd_unlink_disk_holder() argument 986 holder = bd_find_holder_disk(bdev, disk); bd_unlink_disk_holder() 989 del_symlink(disk->slave_dir, &part_to_dev(bdev->bd_part)->kobj); bd_unlink_disk_holder() 991 &disk_to_dev(disk)->kobj); bd_unlink_disk_holder() 1003 * flush_disk - invalidates all buffer-cache entries on a disk 1008 * Invalidates all buffer-cache entries on a disk. It should be called 1009 * when a disk has been changed -- either by a media change or online 1020 "resized disk %s\n", name); flush_disk() 1030 * check_disk_size_change - checks for disk size change and adjusts bdev size. 1031 * @disk: struct gendisk to check 1034 * This routine checks to see if the bdev size does not match the disk size 1037 void check_disk_size_change(struct gendisk *disk, struct block_device *bdev) check_disk_size_change() argument 1041 disk_size = (loff_t)get_capacity(disk) << 9; check_disk_size_change() 1046 disk_name(disk, 0, name); check_disk_size_change() 1058 * @disk: struct gendisk to be revalidated 1064 int revalidate_disk(struct gendisk *disk) revalidate_disk() argument 1069 if (disk->fops->revalidate_disk) revalidate_disk() 1070 ret = disk->fops->revalidate_disk(disk); revalidate_disk() 1072 bdev = bdget_disk(disk, 0); revalidate_disk() 1077 check_disk_size_change(disk, bdev); revalidate_disk() 1096 struct gendisk *disk = bdev->bd_disk; check_disk_change() local 1097 const struct block_device_operations *bdops = disk->fops; check_disk_change() 1100 events = disk_clear_events(disk, DISK_EVENT_MEDIA_CHANGE | check_disk_change() 1141 struct gendisk *disk; __blkdev_get() local 1165 disk = get_gendisk(bdev->bd_dev, &partno); __blkdev_get() 1166 if (!disk) __blkdev_get() 1168 owner = disk->fops->owner; __blkdev_get() 1170 disk_block_events(disk); __blkdev_get() 1173 bdev->bd_disk = disk; __blkdev_get() 1174 bdev->bd_queue = disk->queue; __blkdev_get() 1178 bdev->bd_part = disk_get_part(disk, partno); __blkdev_get() 1183 if (disk->fops->open) { __blkdev_get() 1184 ret = disk->fops->open(bdev, mode); __blkdev_get() 1186 /* Lost a race with 'disk' being __blkdev_get() 1195 disk_unblock_events(disk); __blkdev_get() 1196 put_disk(disk); __blkdev_get() 1203 bd_set_size(bdev,(loff_t)get_capacity(disk)<<9); __blkdev_get() 1213 rescan_partitions(disk, bdev); __blkdev_get() 1215 invalidate_partitions(disk, bdev); __blkdev_get() 1221 whole = bdget_disk(disk, 0); __blkdev_get() 1230 bdev->bd_part = disk_get_part(disk, partno); __blkdev_get() 1231 if (!(disk->flags & GENHD_FL_UP) || __blkdev_get() 1260 /* only one opener holds refs to the module and disk */ __blkdev_get() 1261 put_disk(disk); __blkdev_get() 1268 disk_unblock_events(disk); __blkdev_get() 1281 disk_unblock_events(disk); __blkdev_get() 1282 put_disk(disk); __blkdev_get() 1327 struct gendisk *disk = whole->bd_disk; blkdev_get() local 1362 (disk->flags & GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE)) { blkdev_get() 1364 disk_block_events(disk); blkdev_get() 1484 struct gendisk *disk = bdev->bd_disk; __blkdev_put() local 1502 if (disk->fops->release) __blkdev_put() 1503 disk->fops->release(disk, mode); __blkdev_put() 1506 struct module *owner = disk->fops->owner; __blkdev_put() 1515 put_disk(disk); __blkdev_put() 866 bd_find_holder_disk(struct block_device *bdev, struct gendisk *disk) bd_find_holder_disk() argument
|
H A D | sync.c | 96 * writeback. At this point all data is on disk so metadata should be stable 168 * vfs_fsync_range - helper to sync a range of data & metadata to disk 174 * Write back data in range @start..@end and metadata for @file to disk. If 199 * Write back data and metadata for @file to disk. If @datasync is 242 * significant periods due to exhaustion of disk request structures. 254 * are not presently under writeout. This is an asynchronous flush-to-disk 265 * sys_sync_file_range() are committed to disk. 274 * already-instantiated disk blocks, there are no guarantees here that the data
|
H A D | mpage.c | 131 * This is the worker routine which does all the work of mapping the disk 133 * blocks are not contiguous on the disk. 136 * represent the validity of its disk mapping and to decide when to do the next 338 * their disk mappings, and then submits them all. That's fine, but obtaining 339 * the disk mappings may require I/O. Reads of indirect blocks, for example. 353 * This all causes the disk requests to be issued in the correct order. 412 * If the page has buffers then they will be used for obtaining the disk 456 * disk before we reach the platter. clean_buffers() 537 * The page has no buffers: map it to disk __mpage_writepage()
|
/linux-4.1.27/drivers/block/aoe/ |
H A D | aoeblk.c | 37 struct gendisk *disk = dev_to_disk(dev); aoedisk_show_state() local 38 struct aoedev *d = disk->private_data; aoedisk_show_state() 50 struct gendisk *disk = dev_to_disk(dev); aoedisk_show_mac() local 51 struct aoedev *d = disk->private_data; aoedisk_show_mac() 61 struct gendisk *disk = dev_to_disk(dev); aoedisk_show_netif() local 62 struct aoedev *d = disk->private_data; aoedisk_show_netif() 99 struct gendisk *disk = dev_to_disk(dev); aoedisk_show_fwver() local 100 struct aoedev *d = disk->private_data; aoedisk_show_fwver() 107 struct gendisk *disk = dev_to_disk(dev); aoedisk_show_payload() local 108 struct aoedev *d = disk->private_data; aoedisk_show_payload() 262 aoeblk_release(struct gendisk *disk, fmode_t mode) aoeblk_release() argument 264 struct aoedev *d = disk->private_data; aoeblk_release() 302 printk(KERN_ERR "aoe: disk not up\n"); aoeblk_getgeo() 322 pr_err("aoe: disk not up\n"); aoeblk_ioctl() 373 pr_err("aoe: cannot allocate disk structure for %ld.%d\n", aoeblk_gdalloc()
|
/linux-4.1.27/drivers/block/zram/ |
H A D | zram_drv.c | 713 &zram->disk->part0); zram_bvec_rw() 723 generic_end_io_acct(rw, &zram->disk->part0, start_time); zram_bvec_rw() 809 set_capacity(zram->disk, 0); zram_reset_device() 810 part_stat_set_all(&zram->disk->part0, 0); zram_reset_device() 832 meta = zram_meta_alloc(zram->disk->first_minor, disksize); disksize_store() 856 set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT); disksize_store() 860 * Revalidate disk out of the init_lock to avoid lockdep splat. disksize_store() 861 * It's okay because disk's capacity is protected by init_lock disksize_store() 864 revalidate_disk(zram->disk); disksize_store() 885 bdev = bdget_disk(zram->disk, 0); reset_store() 911 revalidate_disk(zram->disk); reset_store() 1170 pr_err("Error allocating disk queue for device %d\n", create_device() 1178 zram->disk = alloc_disk(1); create_device() 1179 if (!zram->disk) { create_device() 1180 pr_warn("Error allocating disk structure for device %d\n", create_device() 1186 zram->disk->major = zram_major; create_device() 1187 zram->disk->first_minor = device_id; create_device() 1188 zram->disk->fops = &zram_devops; create_device() 1189 zram->disk->queue = queue; create_device() 1190 zram->disk->queue->queuedata = zram; create_device() 1191 zram->disk->private_data = zram; create_device() 1192 snprintf(zram->disk->disk_name, 16, "zram%d", device_id); create_device() 1195 set_capacity(zram->disk, 0); create_device() 1197 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, zram->disk->queue); create_device() 1198 queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, zram->disk->queue); create_device() 1203 blk_queue_physical_block_size(zram->disk->queue, PAGE_SIZE); create_device() 1204 blk_queue_logical_block_size(zram->disk->queue, create_device() 1206 blk_queue_io_min(zram->disk->queue, PAGE_SIZE); create_device() 1207 blk_queue_io_opt(zram->disk->queue, PAGE_SIZE); create_device() 1208 zram->disk->queue->limits.discard_granularity = PAGE_SIZE; create_device() 1209 zram->disk->queue->limits.max_discard_sectors = UINT_MAX; create_device() 1219 zram->disk->queue->limits.discard_zeroes_data = 1; create_device() 1221 zram->disk->queue->limits.discard_zeroes_data = 0; create_device() 1222 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, zram->disk->queue); create_device() 1224 add_disk(zram->disk); create_device() 1226 ret = sysfs_create_group(&disk_to_dev(zram->disk)->kobj, create_device() 1238 del_gendisk(zram->disk); create_device() 1239 put_disk(zram->disk); create_device() 1257 sysfs_remove_group(&disk_to_dev(zram->disk)->kobj, destroy_devices() 1262 blk_cleanup_queue(zram->disk->queue); destroy_devices() 1263 del_gendisk(zram->disk); destroy_devices() 1264 put_disk(zram->disk); destroy_devices()
|
H A D | zram_drv.h | 77 /* Allocated for each disk page */ 105 struct gendisk *disk; member in struct:zram 120 * we can store in a disk.
|
/linux-4.1.27/drivers/scsi/osd/ |
H A D | osd_uld.c | 89 struct gendisk *disk; member in struct:osd_uld_device 409 oud->disk ? oud->disk->disk_name : NULL); __remove() 411 if (oud->disk) __remove() 412 put_disk(oud->disk); __remove() 421 struct gendisk *disk; osd_probe() local 451 /* allocate a disk and set it up */ osd_probe() 453 disk = alloc_disk(1); osd_probe() 454 if (!disk) { osd_probe() 458 disk->major = SCSI_OSD_MAJOR; osd_probe() 459 disk->first_minor = oud->minor; osd_probe() 460 sprintf(disk->disk_name, "osd%d", oud->minor); osd_probe() 461 oud->disk = disk; osd_probe() 491 error = dev_set_name(&oud->class_dev, "%s", disk->disk_name); osd_probe() 505 OSD_INFO("osd_probe %s\n", disk->disk_name); osd_probe() 512 put_disk(disk); osd_probe()
|
/linux-4.1.27/fs/jfs/ |
H A D | jfs_dmap.h | 45 * maximum l2 number of disk blocks at the various dmapctl levels. 52 * maximum number of disk blocks at the various dmapctl levels. 75 * convert disk block number to the logical block number of the dmap 76 * describing the disk block. s is the log2(number of logical blocks per page) 89 * convert disk block number to the logical block number of the LEVEL 0 90 * dmapctl describing the disk block. s is the log2(number of logical blocks 104 * convert disk block number to the logical block number of the LEVEL 1 105 * dmapctl describing the disk block. s is the log2(number of logical blocks 119 * convert disk block number to the logical block number of the dmapctl 120 * at the specified level which describes the disk block. 132 /* convert disk block number to allocation group number. 136 /* convert allocation group number to starting disk block 171 * disk map control page per level. 202 * on-disk aggregate disk allocation map descriptor. 241 * in-memory aggregate disk allocation map descriptor. 244 struct dbmap db_bmap; /* on-disk aggregate map descriptor */
|
H A D | jfs_filsys.h | 45 /* mount time flag to disable journaling to disk */ 112 #define DISIZE 512 /* on-disk inode size (in byte) */ 123 #define INOSPERIAG 4096 /* number of disk inodes per iag */ 124 #define L2INOSPERIAG 12 /* l2 number of disk inodes per iag */ 125 #define INOSPEREXT 32 /* number of disk inode per extent */ 126 #define L2INOSPEREXT 5 /* l2 number of disk inode per extent */ 128 #define INOSPERPAGE 8 /* number of disk inodes per 4K page */ 174 * SIZE_OF_SUPER defines the total amount of space reserved on disk for the 186 * SIZE_OF_MAP_PAGE defines the amount of disk space reserved for each page of 214 * The following macro is used to indicate the number of reserved disk blocks at
|
H A D | jfs_extent.c | 83 * -ENOSPC - insufficient disk resources. 127 /* allocate the disk blocks for the extent. initially, extBalloc() extAlloc() 128 * will try to allocate disk blocks for the requested size (xlen). extAlloc() 185 * We need to commit the inode to get the page written disk. extAlloc() 213 * -ENOSPC - insufficient disk resources. 231 /* get the extend (partial) page's disk block address and extRealloc() 270 * and the allocated disk space is for more than one page. if this extRealloc() 276 * disk allocation occurred as an inplace extension. the second extRealloc() 294 /* if we were able to extend the disk allocation in place, extRealloc() 296 * new disk location. extRealloc() 422 * -ENOSPC - insufficient disk resources. 444 * FUNCTION: allocate disk space for a file page that represents 454 * -ENOSPC - insufficient disk resources. 480 * FUNCTION: allocate disk blocks to form an extent. 482 * initially, we will try to allocate disk blocks for the 494 * hint - disk block number to be used as an allocation hint. 506 * -ENOSPC - insufficient disk resources. 576 * will try to allocate disk blocks for the requested size 599 * -ENOSPC - insufficient disk resources.
|
H A D | jfs_umount.c | 108 * Make sure all metadata makes it to disk before we mark jfs_umount() 115 * home blocks on disk (and their in-memory buffer pages are jfs_umount() 152 * Make sure all metadata makes it to disk jfs_umount_rw() 161 * disk. jfs_umount_rw()
|
H A D | jfs_imap.c | 97 * brought in from disk and placed in virtual memory. 124 /* read the on-disk inode map control structure. */ diMount() 134 /* copy the on-disk version to the in-memory version. */ diMount() 180 * FUNCTION: write to disk the incore inode map control structures for 196 * update the on-disk inode map control structure diUnmount() 229 /* read the on-disk inode map control structure */ diSync() 238 /* copy the in-memory version to the on-disk version */ diSync() 274 * FUNCTION: initialize an incore inode from disk. 277 * specify the disk inode number corresponding to the 288 * for regular inodes, the iag describing the disk inode 289 * is read from disk to determine the inode extent address 290 * for the disk inode. with the inode extent address in 291 * hand, the page of the extent that contains the disk 292 * inode is read and the disk inode is copied to the 296 * ip - pointer to incore inode to be initialized from disk. 339 /* determine inode extent that holds the disk inode */ diRead() 349 /* get disk block number of the page within the inode extent diRead() 350 * that holds the disk inode. diRead() 377 /* read the page of disk inode */ diRead() 384 /* locate the disk inode requested */ diRead() 394 /* copy the disk inode to the in-memory inode */ diRead() 410 * FUNCTION: initialize a 'special' inode from disk. 457 /* read the page of fixed disk inode (AIT) in raw mode */ diReadSpecial() 465 /* get the pointer to the disk inode of interest */ diReadSpecial() 469 /* copy on-disk inode to in-memory inode */ diReadSpecial() 508 * FUNCTION: Write the special inode to disk 534 /* read the page of fixed disk inode (AIT) in raw mode */ diWriteSpecial() 542 /* get the pointer to the disk inode of interest */ diWriteSpecial() 546 /* copy on-disk inode to in-memory inode */ diWriteSpecial() 578 * FUNCTION: write the on-disk inode portion of the in-memory inode 579 * to its corresponding on-disk inode. 582 * specify the disk inode number corresponding to the 585 * the inode contains the inode extent address for the disk 587 * page of the extent that contains the disk inode is 588 * read and the disk inode portion of the incore inode 589 * is copied to the disk inode. 633 * read the page of disk inode containing the specified inode: diWrite() 655 /* read the page of disk inode */ diWrite() 661 /* get the pointer to the disk inode */ diWrite() 668 * acquire transaction lock on the on-disk inode; diWrite() 677 * copy btree root from in-memory inode to on-disk inode diWrite() 715 /* reset on-disk (metadata page) xtree XAD_NEW bit */ diWrite() 751 /* reset on-disk (metadata page) xtree XAD_NEW bit */ diWrite() 780 * copy inline symlink from in-memory inode to on-disk inode diWrite() 790 * copy inline data from in-memory inode to on-disk inode: diWrite() 816 /* release the buffer holding the updated on-disk inode. diWrite() 837 * the extent. in this case all the disk resource backing 1328 * FUNCTION: allocate a disk inode from the inode working map 1333 * dir - 'true' if the new disk inode is for a directory. 1338 * -ENOSPC - insufficient disk resources. 1370 * the same iag containing the parent disk inode: diAlloc() 1371 * try to allocate the new disk inode close to the parent disk diAlloc() 1372 * inode, using parent disk inode number + 1 as the allocation diAlloc() 1374 * moving backward on the disk.) compute the hint within the diAlloc() 1416 * has less than 32 free disk inodes and the iag has free extents. diAlloc() 1563 /* if there is no disk space for a diAlloc() 1565 * disk inode from somewhere else. diAlloc() 1622 * FUNCTION: allocate a disk inode from the allocation group. 1638 * dir - 'true' if the new disk inode is for a directory. 1640 * with the disk inode number allocated, its extent address 1645 * -ENOSPC - insufficient disk resources. 1653 /* get the number of free and the number of backed disk diAllocAG() 1698 * FUNCTION: allocate a disk inode from any other allocation group. 1708 * dir - 'true' if the new disk inode is for a directory. 1710 * with the disk inode number allocated, its extent address 1715 * -ENOSPC - insufficient disk resources. 1752 /* no free disk inodes. diAllocAny() 1761 * FUNCTION: allocate a disk inode from the allocation group's free 1775 * with the disk inode number allocated, its extent address 1780 * -ENOSPC - insufficient disk resources. 1899 * with the disk inode number allocated, its extent address 1904 * -ENOSPC - insufficient disk resources. 2021 * -ENOSPC - insufficient disk resources. 2134 * disk resources are allocated for the new extent of inodes 2167 * -ENOSPC - insufficient disk resources. 2265 /* allocate disk space for the inode extent. diNewExt() 2285 /* get a buffer for this page of disk inodes. diNewExt() 2434 * -ENOSPC - insufficient disk resources. 3040 * FUNCTION: Copies inode info from disk inode to in-memory inode 3128 * FUNCTION: Copies inode info from in-memory inode to disk inode
|
H A D | jfs_extent.h | 21 /* get block allocation allocation hint as location of disk inode */
|
/linux-4.1.27/drivers/leds/trigger/ |
H A D | ledtrig-ide-disk.c | 33 led_trigger_register_simple("ide-disk", &ledtrig_ide); ledtrig_ide_init()
|
H A D | ledtrig-camera.c | 4 * based on ledtrig-ide-disk.c
|
/linux-4.1.27/arch/ia64/hp/sim/ |
H A D | simscsi.c | 80 * used to setup a new base for disk images 81 * to use /foo/bar/disk[a-z] as disk images 82 * you have to specify simscsi=/foo/bar/disk on the command line 177 * direct way of determining the disk size, so we do a binary simscsi_get_disk_size() 178 * search, assuming a maximum disk size of 128GB. simscsi_get_disk_size() 232 /* disk doesn't exist... */ simscsi_queuecommand_lck() 236 buf[0] = 0; /* magnetic disk */ simscsi_queuecommand_lck() 299 /* sd.c uses this to determine whether disk does write-caching. */ simscsi_queuecommand_lck()
|
/linux-4.1.27/fs/ext2/ |
H A D | xattr.h | 4 On-disk format of extended attributes for the ext2 filesystem. 29 __le32 h_blocks; /* number of disk blocks used */ 37 __le16 e_value_offs; /* offset in disk block of value */ 38 __le32 e_value_block; /* disk block attribute is stored on (n/i) */
|
/linux-4.1.27/fs/ext3/ |
H A D | xattr.h | 4 On-disk format of extended attributes for the ext3 filesystem. 28 __le32 h_blocks; /* number of disk blocks used */ 40 __le16 e_value_offs; /* offset in disk block of value */ 41 __le32 e_value_block; /* disk block attribute is stored on (n/i) */
|
H A D | fsync.c | 38 * inode to disk. 96 * disk caches manually so that data really is on persistent ext3_sync_file()
|
/linux-4.1.27/fs/ext4/ |
H A D | xattr.h | 4 On-disk format of extended attributes for the ext4 filesystem. 31 __le32 h_blocks; /* number of disk blocks used */ 45 __le16 e_value_offs; /* offset in disk block of value */ 46 __le32 e_value_block; /* disk block attribute is stored on (n/i) */
|
H A D | truncate.h | 30 * i_blocks is corrupt: we've seen disk corruptions in the past ext4_blocks_for_truncate()
|
/linux-4.1.27/fs/adfs/ |
H A D | dir_fplus.h | 10 * Structures of directories on the F+ format disk
|
H A D | dir_f.h | 10 * Structures of directories on the F format disk
|
H A D | map.c | 27 * The physical disk space used by a fragment is taken from the start of 34 * from any zone on the disk. 41 * Objects stored on the disk are allocated object ids (we use these as 257 * disk. The other fragments start at zone (frag / ids_per_zone) adfs_map_lookup()
|
/linux-4.1.27/drivers/s390/block/ |
H A D | xpram.c | 2 * Xpram.c -- the S/390 expanded memory RAM-disk 25 * generic hard disk support to replace ad-hoc partitioning 366 struct gendisk *disk = xpram_disks[i]; xpram_setup_blkdev() local 371 disk->major = XPRAM_MAJOR; xpram_setup_blkdev() 372 disk->first_minor = i; xpram_setup_blkdev() 373 disk->fops = &xpram_devops; xpram_setup_blkdev() 374 disk->private_data = &xpram_devices[i]; xpram_setup_blkdev() 375 disk->queue = xpram_queues[i]; xpram_setup_blkdev() 376 sprintf(disk->disk_name, "slram%d", i); xpram_setup_blkdev() 377 set_capacity(disk, xpram_sizes[i] << 1); xpram_setup_blkdev() 378 add_disk(disk); xpram_setup_blkdev()
|
/linux-4.1.27/arch/um/drivers/ |
H A D | ubd_kern.c | 90 static void ubd_release(struct gendisk *disk, fmode_t mode); 195 seq_puts(m, "disk\n"); fake_ide_media_proc_show() 417 " an 's' will cause data to be written to disk on the host immediately.\n" 808 struct gendisk *disk; ubd_disk_register() local 810 disk = alloc_disk(1 << UBD_SHIFT); ubd_disk_register() 811 if(disk == NULL) ubd_disk_register() 814 disk->major = major; ubd_disk_register() 815 disk->first_minor = unit << UBD_SHIFT; ubd_disk_register() 816 disk->fops = &ubd_blops; ubd_disk_register() 817 set_capacity(disk, size / 512); ubd_disk_register() 819 sprintf(disk->disk_name, "ubd%c", 'a' + unit); ubd_disk_register() 821 sprintf(disk->disk_name, "ubd_fake%d", unit); ubd_disk_register() 830 disk->driverfs_dev = &ubd_devs[unit].pdev.dev; ubd_disk_register() 833 disk->private_data = &ubd_devs[unit]; ubd_disk_register() 834 disk->queue = ubd_devs[unit].queue; ubd_disk_register() 835 add_disk(disk); ubd_disk_register() 837 *disk_out = disk; ubd_disk_register() 979 struct gendisk *disk = ubd_gendisk[n]; ubd_remove() local 990 /* you cannot remove a open disk */ ubd_remove() 996 if(disk != NULL){ ubd_remove() 997 del_gendisk(disk); ubd_remove() 998 put_disk(disk); ubd_remove() 1115 struct gendisk *disk = bdev->bd_disk; ubd_open() local 1116 struct ubd *ubd_dev = disk->private_data; ubd_open() 1124 disk->disk_name, ubd_dev->file, -err); ubd_open() 1129 set_disk_ro(disk, !ubd_dev->openflags.w); ubd_open() 1142 static void ubd_release(struct gendisk *disk, fmode_t mode) ubd_release() argument 1144 struct ubd *ubd_dev = disk->private_data; ubd_release() 1217 struct gendisk *disk = req->rq_disk; prepare_request() local 1218 struct ubd *ubd_dev = disk->private_data; prepare_request() 1246 struct gendisk *disk = req->rq_disk; prepare_flush_request() local 1247 struct ubd *ubd_dev = disk->private_data; prepare_flush_request()
|
/linux-4.1.27/fs/befs/ |
H A D | io.c | 20 * Converts befs notion of disk addr to a disk offset and uses
|
/linux-4.1.27/fs/ocfs2/ |
H A D | ocfs2_fs.h | 6 * On-disk structures for OCFS2. 41 * blocksize of 2K, it is 4096 bytes into disk. 462 * On disk extent record for OCFS2 463 * It describes a range of clusters on disk. 479 __le64 e_blkno; /* Physical disk offset, in blocks */ 486 __le64 c_blkno; /* Physical disk offset (blocks) of 1st group */ 495 * On disk extent list for OCFS2 (node in the tree). Note that this 517 * On disk allocation chain list for OCFS2. Note that this is 531 * On disk deallocation log for OCFS2. Note that this is 543 * On disk extent block (indirect block) for OCFS2 554 __le64 h_blkno; /* Offset on disk, in blocks */ 559 __le64 h_next_leaf_blk; /* Offset on disk, in blocks, 563 /* Actual on-disk size is one block */ 567 * On disk slot map for OCFS2. This defines the contents of the "slot_map" 574 * Actual on-disk size is one block. OCFS2_MAX_SLOTS is 255, 620 * On disk superblock for OCFS2 700 * On disk inode for OCFS2 722 /*50*/ __le64 i_blkno; /* Offset on disk, in blocks */ 774 /* Actual on-disk size is one block */ 778 * On-disk directory entry structure for OCFS2 788 /* Actual on-disk length specified by rec_len */ 812 /*20*/ __le64 db_blkno; /* Offset on disk, in blocks */ 863 __le64 dr_blkno; /* Offset on disk, in blocks */ 901 __le64 dl_blkno; /* Offset on disk, in blocks */ 916 * On disk allocator group structure for OCFS2 933 __le64 bg_blkno; /* Offset on disk, in blocks */ 958 /* Actual on-disk size is one block */ 989 /*10*/ __le64 rf_blkno; /* Offset on disk, in blocks */ 1016 /* Actual on-disk size is one block */ 1020 * On disk extended attribute structure for OCFS2. 1041 * On disk structure for xattr header. 1068 * On disk structure for xattr value root. 1081 * On disk structure for xattr tree root. 1104 * On disk structure for xattr block. 1113 /*10*/ __le64 xb_blkno; /* Offset on disk, in blocks */ 1159 * On disk structures for global quota file 1208 /*20*/ __le64 dqb_bhardlimit; /* absolute limit on disk space */ 1209 __le64 dqb_bsoftlimit; /* preferred limit on disk space */ 1211 __le64 dqb_btime; /* time limit for excessive disk use */ 1218 * On-disk structures for local quota file
|
/linux-4.1.27/drivers/sbus/char/ |
H A D | jsflash.c | 562 struct gendisk *disk = alloc_disk(1); jsfd_init() local 563 if (!disk) jsfd_init() 565 jsfd_disk[i] = disk; jsfd_init() 581 struct gendisk *disk = jsfd_disk[i]; jsfd_init() local 586 disk->major = JSFD_MAJOR; jsfd_init() 587 disk->first_minor = i; jsfd_init() 588 sprintf(disk->disk_name, "jsfd%d", i); jsfd_init() 589 disk->fops = &jsfd_fops; jsfd_init() 590 set_capacity(disk, jdp->dsize >> 9); jsfd_init() 591 disk->private_data = jdp; jsfd_init() 592 disk->queue = jsf_queue; jsfd_init() 593 add_disk(disk); jsfd_init() 594 set_disk_ro(disk, 1); jsfd_init()
|
/linux-4.1.27/fs/xfs/libxfs/ |
H A D | xfs_inode_buf.c | 68 * from disk. We don't report the error otherwise to avoid warnings during log 152 * This routine is called to map an inode to the buffer containing the on-disk 154 * on-disk inode in the bpp parameter, and in the dipp parameter it returns a 155 * pointer to the on-disk inode within that buffer. 335 * Read the disk inode attributes into the in-core inode structure. 341 * disk. Further, if we are using version 4 superblocks (i.e. v1/v2 inode 343 * initialised from the current on-disk value and hence we must also read the 344 * inode off disk. 368 /* initialise the on-disk inode core */ xfs_iread() 382 * Get pointers to the on-disk inode and the buffer containing it. xfs_iread() 399 * If the on-disk inode is already linked to a directory xfs_iread() 466 * Use xfs_trans_brelse() to release the buffer containing the on-disk xfs_iread() 472 * because inodes on disk are never destroyed and we will be locking the xfs_iread()
|
H A D | xfs_format.h | 24 * This header file defines all the on-disk format definitions for 160 * the disk buffer. 184 * Superblock - on disk version. Must match the in core version above. 653 /* disk block (xfs_daddr_t) in the AG */ 721 /* disk block (xfs_daddr_t) in the AG */ 802 * On-disk inode structure. 871 * Size of the core inode on disk. Version 1 and 2 inodes have 1089 * This is the main portion of the on-disk representation of quota 1092 * to construct the on disk structure. 1099 __be64 d_blk_hardlimit;/* absolute limit on disk blks */ 1100 __be64 d_blk_softlimit;/* preferred limit on disk blks */ 1103 __be64 d_bcount; /* disk blocks owned by the user */ 1107 __be32 d_btimer; /* similar to above; for disk blocks */ 1109 __be16 d_bwarns; /* warnings issued wrt disk blocks */ 1112 __be64 d_rtb_softlimit;/* preferred limit on RT disk blks */ 1114 __be32 d_rtbtimer; /* similar to above; for RT disk blocks */ 1115 __be16 d_rtbwarns; /* warnings issued wrt RT disk blocks */ 1120 * This is what goes on disk. This is separated from the xfs_disk_dquot because 1170 * There are two on-disk btrees, one sorted by blockno and one sorted 1278 * Bmap root header, on-disk form only. 1373 * This is a combination of the actual format used on disk for short and long 1426 * On-disk XFS access control list structure. 1441 * The number of ACL entries allowed is defined by the on-disk format. 1455 /* On-disk XFS extended attribute names */
|
H A D | xfs_alloc_btree.h | 22 * Freespace on-disk structures
|
H A D | xfs_cksum.h | 33 * so that it is consistent on disk.
|
H A D | xfs_ialloc.h | 52 * Allocate an inode on disk. 68 * on-disk data structures are updated. The inode itself is not read 83 * Free disk inode. Carefully avoids touching the incore inode, all 85 * The on-disk inode is not changed by this operation, only the
|
H A D | xfs_ialloc_btree.h | 22 * Inode map on-disk structures
|
H A D | xfs_sb.c | 279 * values are not written back to disk unless any quota information xfs_sb_quota_from_disk() 280 * is written to the disk. Even in that case, sb_pquotino field is xfs_sb_quota_from_disk() 281 * not written to disk unless the superblock supports pquotino. xfs_sb_quota_from_disk() 292 * with an older version of on-disk superblock. xfs_sb_quota_from_disk() 307 * In older version of superblock, on-disk superblock only xfs_sb_quota_from_disk() 310 * point of time. So, if PQUOTA is set in disk superblock, xfs_sb_quota_from_disk() 375 /* crc is only used on disk, not in memory; just init to 0 here. */ __xfs_sb_from_disk() 380 /* Convert on-disk flags to in-memory flags? */ __xfs_sb_from_disk() 410 * flags, whereas the on-disk version does. So, convert incore xfs_sb_quota_to_disk() 411 * XFS_{PG}QUOTA_* flags to on-disk XFS_OQUOTA_* flags. xfs_sb_quota_to_disk() 428 * disk. If neither are active, we should NULL the inode. xfs_sb_quota_to_disk() 533 * Use call variant which doesn't convert quota flags from disk xfs_sb_verify() 534 * format, because xfs_mount_validate_sb checks the on-disk flags. xfs_sb_verify() 568 * superblock from disk order just to check the version number xfs_sb_read_verify() 776 * Sync the superblock to disk.
|
/linux-4.1.27/include/uapi/linux/raid/ |
H A D | md_p.h | 77 #define MD_DISK_FAULTY 0 /* disk is faulty / operational */ 78 #define MD_DISK_ACTIVE 1 /* disk is running or spare disk */ 79 #define MD_DISK_SYNC 2 /* disk is in sync with the raid set */ 80 #define MD_DISK_REMOVED 3 /* disk is in sync with the raid set */ 81 #define MD_DISK_CLUSTER_ADD 4 /* Initiate a disk add across the cluster 84 #define MD_DISK_CANDIDATE 5 /* disk is added as spare (local) until confirmed 88 #define MD_DISK_WRITEMOSTLY 9 /* disk is "write-mostly" is RAID1 config. 136 __u32 size; /* 8 Apparent size of each individual disk */
|
/linux-4.1.27/fs/squashfs/ |
H A D | fragment.c | 29 * location on disk and compressed size using a fragment lookup table. 45 * Look-up fragment using the fragment index table. Return the on disk 71 * Read the uncompressed fragment lookup table indexes off disk into memory
|
H A D | xattr_id.c | 26 * into the on disk location of the xattr data. 64 * Read uncompressed xattr id lookup table indexes from disk into memory
|
H A D | export.c | 28 * filehandles to an inode location on disk. This table is stored compressed 33 * The inode lookup table is used only by the export code, inode disk 121 * Read uncompressed inode lookup table indexes off disk into memory
|
/linux-4.1.27/drivers/cdrom/ |
H A D | gdrom.c | 95 {UNIT_ATTENTION, "Device needs attention - disk may have been changed"}, 117 struct gendisk *disk; member in struct:gdrom_unit 243 * Prepare disk command 376 /* spin up the disk */ gdrom_open() 506 static void gdrom_bdops_release(struct gendisk *disk, fmode_t mode) gdrom_bdops_release() argument 513 static unsigned int gdrom_bdops_check_events(struct gendisk *disk, gdrom_bdops_check_events() argument 749 gd.disk->major = gdrom_major; probe_gdrom_setupdisk() 750 gd.disk->first_minor = 1; probe_gdrom_setupdisk() 751 gd.disk->minors = 1; probe_gdrom_setupdisk() 752 strcpy(gd.disk->disk_name, GDROM_DEV_NAME); probe_gdrom_setupdisk() 762 gd.disk->queue = gd.gdrom_rq; probe_gdrom_setupqueue() 794 gd.disk = alloc_disk(1); probe_gdrom() 795 if (!gd.disk) { probe_gdrom() 804 gd.disk->fops = &gdrom_bdops; probe_gdrom() 820 add_disk(gd.disk); probe_gdrom() 830 del_gendisk(gd.disk); probe_gdrom() 846 del_gendisk(gd.disk); remove_gdrom()
|
/linux-4.1.27/drivers/leds/ |
H A D | leds-rb532.c | 37 .default_trigger = "nand-disk",
|
H A D | leds-hp6xx.c | 53 .default_trigger = "ide-disk",
|
H A D | leds-locomo.c | 54 .default_trigger = "nand-disk",
|
/linux-4.1.27/fs/ocfs2/cluster/ |
H A D | ocfs2_heartbeat.h | 6 * On-disk structures for ocfs2_heartbeat
|
/linux-4.1.27/arch/parisc/include/asm/ |
H A D | led.h | 15 #define LED_DISK_IO LED2 /* for disk activity */
|
/linux-4.1.27/arch/arm64/include/uapi/asm/ |
H A D | fcntl.h | 24 #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
|
/linux-4.1.27/fs/bfs/ |
H A D | bfs.h | 27 unsigned long i_dsk_ino; /* inode number from the disk, can be 0 */
|
/linux-4.1.27/drivers/mmc/card/ |
H A D | block.c | 97 struct gendisk *disk; member in struct:mmc_blk_data 155 static struct mmc_blk_data *mmc_blk_get(struct gendisk *disk) mmc_blk_get() argument 160 md = disk->private_data; mmc_blk_get() 170 static inline int mmc_get_devidx(struct gendisk *disk) mmc_get_devidx() argument 172 int devmaj = MAJOR(disk_devt(disk)); mmc_get_devidx() 173 int devidx = MINOR(disk_devt(disk)) / perdev_minors; mmc_get_devidx() 176 devidx = disk->first_minor / perdev_minors; mmc_get_devidx() 185 int devidx = mmc_get_devidx(md->disk); mmc_blk_put() 190 put_disk(md->disk); mmc_blk_put() 240 pr_err("%s: Locking boot partition ro until next power on failed: %d\n", md->disk->disk_name, ret); power_ro_lock_store() 248 md->disk->disk_name); power_ro_lock_store() 249 set_disk_ro(md->disk, 1); power_ro_lock_store() 253 pr_info("%s: Locking boot partition ro until next power on\n", part_md->disk->disk_name); power_ro_lock_store() 254 set_disk_ro(part_md->disk, 1); power_ro_lock_store() 315 static void mmc_blk_release(struct gendisk *disk, fmode_t mode) mmc_blk_release() argument 317 struct mmc_blk_data *md = disk->private_data; mmc_blk_release() 2126 md->disk = alloc_disk(perdev_minors); mmc_blk_alloc_req() 2127 if (md->disk == NULL) { mmc_blk_alloc_req() 2143 md->disk->major = MMC_BLOCK_MAJOR; mmc_blk_alloc_req() 2144 md->disk->first_minor = devidx * perdev_minors; mmc_blk_alloc_req() 2145 md->disk->fops = &mmc_bdops; mmc_blk_alloc_req() 2146 md->disk->private_data = md; mmc_blk_alloc_req() 2147 md->disk->queue = md->queue.queue; mmc_blk_alloc_req() 2148 md->disk->driverfs_dev = parent; mmc_blk_alloc_req() 2149 set_disk_ro(md->disk, md->read_only || default_ro); mmc_blk_alloc_req() 2151 md->disk->flags |= GENHD_FL_NO_PART_SCAN; mmc_blk_alloc_req() 2165 snprintf(md->disk->disk_name, sizeof(md->disk->disk_name), mmc_blk_alloc_req() 2174 set_capacity(md->disk, size); mmc_blk_alloc_req() 2202 put_disk(md->disk); mmc_blk_alloc_req() 2242 part_md = mmc_blk_alloc_req(card, disk_to_dev(md->disk), size, default_ro, mmc_blk_alloc_part() 2249 string_get_size((u64)get_capacity(part_md->disk), 512, STRING_UNITS_2, mmc_blk_alloc_part() 2252 part_md->disk->disk_name, mmc_card_id(card), mmc_blk_alloc_part() 2300 if (md->disk->flags & GENHD_FL_UP) { mmc_blk_remove_req() 2301 device_remove_file(disk_to_dev(md->disk), &md->force_ro); mmc_blk_remove_req() 2304 device_remove_file(disk_to_dev(md->disk), mmc_blk_remove_req() 2307 del_gendisk(md->disk); mmc_blk_remove_req() 2332 add_disk(md->disk); mmc_add_disk() 2338 ret = device_create_file(disk_to_dev(md->disk), &md->force_ro); mmc_add_disk() 2357 ret = device_create_file(disk_to_dev(md->disk), mmc_add_disk() 2365 device_remove_file(disk_to_dev(md->disk), &md->force_ro); mmc_add_disk() 2367 del_gendisk(md->disk); mmc_add_disk() 2455 string_get_size((u64)get_capacity(md->disk), 512, STRING_UNITS_2, mmc_blk_probe() 2458 md->disk->disk_name, mmc_card_id(card), mmc_card_name(card), mmc_blk_probe()
|
/linux-4.1.27/drivers/mtd/ |
H A D | mtd_blkdevs.c | 46 dev->disk->private_data = NULL; blktrans_dev_release() 48 put_disk(dev->disk); blktrans_dev_release() 53 static struct mtd_blktrans_dev *blktrans_dev_get(struct gendisk *disk) blktrans_dev_get() argument 58 dev = disk->private_data; blktrans_dev_get() 241 static void blktrans_release(struct gendisk *disk, fmode_t mode) blktrans_release() argument 243 struct mtd_blktrans_dev *dev = blktrans_dev_get(disk); blktrans_release() 363 * minor numbers and that the disk naming code below can cope add_mtd_blktrans_dev() 387 new->disk = gd; add_mtd_blktrans_dev() 454 put_disk(new->disk); add_mtd_blktrans_dev() 471 sysfs_remove_group(&disk_to_dev(old->disk)->kobj, del_mtd_blktrans_dev() 475 del_gendisk(old->disk); del_mtd_blktrans_dev()
|
/linux-4.1.27/arch/sparc/include/asm/ |
H A D | auxio_32.h | 19 #define AUXIO_FLPY_DCHG 0x10 /* A disk change occurred. Read only. */ 28 #define AUXIO_FLPY_EJCT 0x02 /* Eject floppy disk. Write only. */
|
/linux-4.1.27/arch/mips/fw/arc/ |
H A D | tree.c | 77 "dti adapter", "multi-func adapter", "disk controller", 81 "audio controller", "misc controller", "disk peripheral",
|
/linux-4.1.27/drivers/memstick/core/ |
H A D | mspro_block.c | 142 struct gendisk *disk; member in struct:mspro_block_data 187 struct gendisk *disk = bdev->bd_disk; mspro_block_bd_open() local 188 struct mspro_block_data *msb = disk->private_data; mspro_block_bd_open() 207 static void mspro_block_disk_release(struct gendisk *disk) mspro_block_disk_release() argument 209 struct mspro_block_data *msb = disk->private_data; mspro_block_disk_release() 210 int disk_id = MINOR(disk_devt(disk)) >> MSPRO_BLOCK_PART_SHIFT; mspro_block_disk_release() 220 disk->private_data = NULL; mspro_block_disk_release() 222 put_disk(disk); mspro_block_disk_release() 229 static void mspro_block_bd_release(struct gendisk *disk, fmode_t mode) mspro_block_bd_release() argument 231 mspro_block_disk_release(disk); mspro_block_bd_release() 1220 msb->disk = alloc_disk(1 << MSPRO_BLOCK_PART_SHIFT); mspro_block_init_disk() 1221 if (!msb->disk) { mspro_block_init_disk() 1241 msb->disk->major = major; mspro_block_init_disk() 1242 msb->disk->first_minor = disk_id << MSPRO_BLOCK_PART_SHIFT; mspro_block_init_disk() 1243 msb->disk->fops = &ms_block_bdops; mspro_block_init_disk() 1245 msb->disk->private_data = msb; mspro_block_init_disk() 1246 msb->disk->queue = msb->queue; mspro_block_init_disk() 1247 msb->disk->driverfs_dev = &card->dev; mspro_block_init_disk() 1249 sprintf(msb->disk->disk_name, "mspblk%d", disk_id); mspro_block_init_disk() 1256 set_capacity(msb->disk, capacity); mspro_block_init_disk() 1259 add_disk(msb->disk); mspro_block_init_disk() 1264 put_disk(msb->disk); mspro_block_init_disk() 1344 del_gendisk(msb->disk); mspro_block_remove() 1356 mspro_block_disk_release(msb->disk); mspro_block_remove()
|
H A D | ms_block.c | 1678 * cover whole disk. 1940 static DEFINE_IDR(msb_disk_idr); /*set of used disk numbers */ 1945 struct gendisk *disk = bdev->bd_disk; msb_bd_open() local 1946 struct msb_data *msb = disk->private_data; msb_bd_open() 1968 static int msb_disk_release(struct gendisk *disk) msb_disk_release() argument 1970 struct msb_data *msb = disk->private_data; msb_disk_release() 1980 disk->private_data = NULL; msb_disk_release() 1982 put_disk(disk); msb_disk_release() 1990 static void msb_bd_release(struct gendisk *disk, fmode_t mode) msb_bd_release() argument 1992 msb_disk_release(disk); msb_bd_release() 2123 msb->disk = alloc_disk(0); msb_init_disk() 2124 if (!msb->disk) { msb_init_disk() 2145 sprintf(msb->disk->disk_name, "msblk%d", msb->disk_id); msb_init_disk() 2146 msb->disk->fops = &msb_bdops; msb_init_disk() 2147 msb->disk->private_data = msb; msb_init_disk() 2148 msb->disk->queue = msb->queue; msb_init_disk() 2149 msb->disk->driverfs_dev = &card->dev; msb_init_disk() 2150 msb->disk->flags |= GENHD_FL_EXT_DEVT; msb_init_disk() 2154 set_capacity(msb->disk, capacity); msb_init_disk() 2155 dbg("Set total disk size to %lu sectors", capacity); msb_init_disk() 2163 set_disk_ro(msb->disk, 1); msb_init_disk() 2166 add_disk(msb->disk); msb_init_disk() 2171 put_disk(msb->disk); msb_init_disk() 2217 dbg("Removing the disk device"); msb_remove() 2225 /* Remove the disk */ msb_remove() 2226 del_gendisk(msb->disk); msb_remove() 2234 msb_disk_release(msb->disk); msb_remove()
|
/linux-4.1.27/fs/exofs/ |
H A D | common.h | 51 #define EXOFS_SUPER_ID 0x10000 /* object ID for on-disk superblock */ 52 #define EXOFS_DEVTABLE_ID 0x10001 /* object ID for on-disk device table */ 89 * This is where the in-memory superblock is stored on disk. 167 * the in-memory inode is stored on disk. 197 * The on-disk directory entry 226 * The on-disk (optional) layout structure.
|
/linux-4.1.27/drivers/staging/unisys/include/ |
H A D | uisqueue.h | 173 * phys disk */ 175 * disk.. The length is always 242 struct uisscsi_dest vdest; /* scsi bus, target, lun for virt disk */ 243 struct uisscsi_dest pdest; /* scsi bus, target, lun for phys disk */ 244 u8 sernum[MAX_SERIAL_NUM]; /* serial num of physical disk */ 250 struct uisscsi_dest vdest; /* scsi bus, target, lun for virt disk */ 264 struct uisscsi_dest vdest; /* scsi bus, target, lun for virt disk */
|
/linux-4.1.27/crypto/async_tx/ |
H A D | raid6test.c | 184 pr("testing the %d-disk case...\n", disks); test() 210 /* the 4-disk and 5-disk cases are special for the recovery code */ raid6_test() 215 /* the 11 and 12 disk cases are special for ioatdma (p-disabled raid6_test() 223 /* the 24 disk case is special for ioatdma as it is the boudary point raid6_test()
|
/linux-4.1.27/fs/nilfs2/ |
H A D | ifile.c | 48 * nilfs_ifile_create_inode - create a new disk inode 51 * @out_bh: buffer_head contains newly allocated disk inode 55 * that contains newly allocated disk inode structure is stored in the 95 * nilfs_ifile_delete_inode - delete a disk inode 189 * @raw_inode: on-disk ifile inode
|
/linux-4.1.27/fs/jbd/ |
H A D | journal.c | 15 * This file manages journals: areas of disk reserved for logging 129 * filesystem to disk. The journal thread is responsible for writing 130 * all of the metadata buffers to disk. 134 * the disk. Flushing these old buffers to reclaim space in the log is 268 * Writes a metadata buffer to a given disk block. The actual IO is not 270 * to be written with the correct destination disk block. 733 * journal blocks from disk. */ 737 * journal structures from from scratch, or loaded them from disk. */ 777 * Create a journal structure assigned some fixed set of disk blocks to 778 * the journal. We don't actually touch those disk blocks yet, but we 845 * journal_init_inode creates a journal which maps an on-disk inode as 953 * As a special case, if the on-disk copy is already marked as needing journal_reset() 971 * disk before that. journal_reset() 986 * Given a journal_t structure which tells us which disk blocks we can 1014 /* Zero out the entire journal on disk. We cannot afford to journal_create() 1015 have any blocks on disk beginning with JFS_MAGIC_NUMBER. */ journal_create() 1099 * journal_update_sb_log_tail() - Update log tail in journal sb on disk. 1106 * disk, waiting for the IO to complete. 1130 * mark_journal_empty() - Mark on disk journal as empty. 1134 * Write updated superblock to disk waiting for IO to complete. 1166 * Update a journal's errno. Write updated superblock to disk waiting for IO 1251 * Load the on-disk journal superblock and read the key fields into the 1277 * int journal_load() - Read journal from disk. 1280 * Given a journal_t structure which tells us which disk blocks contain 1281 * a journal, read the journal from disk to initialise the in-memory 1315 * and reset them on disk. */ journal_load() 1348 /* Force any old transactions to disk */ journal_destroy() 1486 * int journal_update_format () - Update on-disk journal structure. 1490 * on-disk structure to update it to the most recent supported version. 1544 * Flush all data for a given journal to disk and empty the journal. 1573 /* ...and flush everything in the log out to disk. */ journal_flush() 1616 * If 'write' is non-zero, then we wipe out the journal on disk; otherwise 1729 * disk by bdflush, but the journaling mechanism will be suspended 1732 * Any dirty, journaled buffers will be written back to disk without 1749 * failure to disk. ext3_error, for example, now uses this
|
H A D | checkpoint.c | 16 * committed fully to disk, so that that portion of the log can be 278 * Try to flush one buffer from the checkpoint list to disk. 328 * disk, as that would break recoverability. __process_buffer() 350 * to disk. We submit larger chunks of data at once. 375 * OK, we need to start writing disk blocks. Take one transaction log_do_checkpoint() 512 * superblock makes it to disk before next transaction starts reusing cleanup_journal_tail() 647 * to disk (either by being write-back flushed to disk, or being 652 * elsewhere on disk. To achieve this, all of the buffers in a
|
/linux-4.1.27/fs/freevxfs/ |
H A D | vxfs_olt.h | 81 * VxFS common OLT entry (on disk). 89 * VxFS free OLT entry (on disk). 97 * VxFS initial-inode list (on disk).
|
/linux-4.1.27/fs/btrfs/ |
H A D | btrfs_inode.h | 64 /* key used to find this inode on disk. This is used by the code 76 /* the extent_tree has caches of all the extent mappings to disk */ 97 * to write all the delalloc pages to disk, and this list is used 145 * the size of the file stored in the metadata on disk. data=ordered 146 * means the in-memory i_size might be larger than the size on disk 173 /* flags field from the on disk inode */
|
H A D | tree-defrag.c | 21 #include "disk-io.h" 29 * better reflect disk order
|
H A D | orphan.c | 20 #include "disk-io.h"
|
H A D | sysfs.c | 30 #include "disk-io.h" 608 struct hd_struct *disk; btrfs_kobj_rm_device() local 615 disk = one_device->bdev->bd_part; btrfs_kobj_rm_device() 616 disk_kobj = &part_to_dev(disk)->kobj; btrfs_kobj_rm_device() 640 struct hd_struct *disk; btrfs_kobj_add_device() local 649 disk = dev->bdev->bd_part; btrfs_kobj_add_device() 650 disk_kobj = &part_to_dev(disk)->kobj; btrfs_kobj_add_device()
|
H A D | dev-replace.c | 31 #include "disk-io.h" 193 * disk. 344 /* the disk copy procedure reuses the scrub code */ btrfs_dev_replace_start() 381 src_device->missing ? "<missing disk>" : btrfs_dev_replace_start() 403 /* force writing the updated state information to disk */ btrfs_dev_replace_start() 414 /* the disk copy procedure reuses the scrub code */ btrfs_dev_replace_start() 525 src_device->missing ? "<missing disk>" : btrfs_dev_replace_finishing() 542 src_device->missing ? "<missing disk>" : btrfs_dev_replace_finishing() 812 dev_replace->srcdev->missing ? "<missing disk>" : btrfs_dev_replace_kthread() 817 "<missing target disk>", btrfs_dev_replace_kthread()
|
/linux-4.1.27/fs/udf/ |
H A D | udf_sb.h | 26 #define UDF_FLAG_UID_FORGET 11 /* save -1 for uid to disk */ 27 #define UDF_FLAG_UID_IGNORE 12 /* use sb uid instead of on disk uid */
|
H A D | lowlevel.c | 40 udf_debug("XA disk: %s, vol_desc_start=%d\n", udf_get_last_session()
|
/linux-4.1.27/fs/xfs/ |
H A D | xfs_dquot.c | 451 * Maps a dquot to the buffer containing its on-disk version. 452 * This returns a ptr to the buffer containing the on-disk dquot 453 * in the bpp param, and a ptr to the on-disk dquot within that buffer 556 * If XFS_QMOPT_DQALLOC is set, allocate a dquot on disk if it needed. 624 * get a pointer to the on-disk dquot and the buffer containing it xfs_qm_dqread() 631 * or if the dquot didn't exist on disk and we ask to xfs_qm_dqread() 639 /* copy everything from disk dquot to the incore dquot */ xfs_qm_dqread() 763 * a (potential) disk read. Also we don't want to deal with the lock xfs_qm_dqget() 884 * flushed to disk. It is responsible for removing the dquot logitem 923 * Write a modified dquot to disk. 925 * The flush lock will not be unlocked until the dquot reaches the disk, 952 * to disk, because the log record didn't make it to disk. xfs_qm_dqflush() 972 * Get the buffer containing the on-disk dquot xfs_qm_dqflush() 1009 * copy the lsn into the on-disk dquot now while we have the in memory xfs_qm_dqflush() 1013 * We also calculate the CRC here so that the on-disk dquot in the xfs_qm_dqflush() 1015 * of a dquot without an up-to-date CRC getting to disk. xfs_qm_dqflush() 1027 * AIL and release the flush lock once the dquot is synced to disk. xfs_qm_dqflush()
|
/linux-4.1.27/arch/m68k/amiga/ |
H A D | amiints.c | 59 /* if floppy disk transfer complete, interrupt */ ami_int1() 134 /* if a disk sync interrupt */ ami_int5()
|
/linux-4.1.27/arch/m68k/include/asm/ |
H A D | amigaints.h | 32 /* floppy disk interrupts */ 77 #define IF_DSKSYN 0x1000 /* disk sync interrupt */
|
/linux-4.1.27/fs/efs/ |
H A D | efs.h | 34 * layout of an extent, in memory and on disk. 8 bytes exactly. 52 * extent based filesystem inode as it appears on disk. The efs inode
|
/linux-4.1.27/fs/f2fs/ |
H A D | xattr.h | 9 * On-disk format of extended attributes for the ext2 filesystem. 80 * On-disk structure of f2fs_xattr
|
/linux-4.1.27/lib/raid6/ |
H A D | mmx.c | 46 z0 = disks - 3; /* Highest data disk */ raid6_mmx1_gen_syndrome() 94 z0 = disks - 3; /* Highest data disk */ raid6_mmx2_gen_syndrome()
|
/linux-4.1.27/arch/sparc/include/uapi/asm/ |
H A D | fcntl.h | 18 #define O_DIRECT 0x100000 /* direct disk access hint */
|
/linux-4.1.27/arch/um/kernel/ |
H A D | uml.lds.S | 93 we can shorten the on-disk segment size. */
|
/linux-4.1.27/arch/s390/include/uapi/asm/ |
H A D | kvm_virtio.h | 19 /* The device type: console, network, disk etc. Type 0 terminates. */
|
/linux-4.1.27/arch/alpha/include/uapi/asm/ |
H A D | fcntl.h | 15 #define O_DIRECT 02000000 /* direct disk access - should check with OSF/1 */
|
/linux-4.1.27/tools/testing/selftests/firmware/ |
H A D | fw_filesystem.sh | 3 # firmware locations on disk. Since the user helper does similar work,
|
/linux-4.1.27/fs/hfs/ |
H A D | mdb.c | 238 * This updates the MDB on disk. 252 * The HFS MDB and on disk will be updated, by copying the possibly 254 * the disk block buffer. 256 * and the function doesn't return until it is actually on disk. 276 /* write MDB to disk */ hfs_mdb_commit()
|
/linux-4.1.27/drivers/staging/lustre/lustre/llite/ |
H A D | lloop.c | 594 static void lo_release(struct gendisk *disk, fmode_t mode) lo_release() argument 596 struct lloop_device *lo = disk->private_data; lo_release() 812 struct gendisk *disk = disks[i]; lloop_init() local 823 disk->major = lloop_major; lloop_init() 824 disk->first_minor = i; lloop_init() 825 disk->fops = &lo_fops; lloop_init() 826 sprintf(disk->disk_name, "lloop%d", i); lloop_init() 827 disk->private_data = lo; lloop_init() 828 disk->queue = lo->lo_queue; lloop_init()
|
/linux-4.1.27/fs/ufs/ |
H A D | ufs_fs.h | 58 * Each disk drive contains some number of filesystems. 81 * UFS1 placed it 8K from the front to leave room for the disk label and 83 * room for the disk label and a bigger bootstrap, and for really piggy 204 * Turn file system block numbers into disk block addresses. 339 * This is the actual superblock, as it is laid out on the disk. 370 __fs32 fs_rps; /* disk revolutions per second */ 414 /* this comes from the disk driver partitioning */ 481 __fs32 fs_inodefmt; /* format of on-disk inodes */ 501 #define UFS_OPTSPACE 1 /* minimize disk fragmentation */ 600 * structure of an on-disk inode 673 __fs64 ui_db[UFS_NDADDR]; /* 112: Direct disk blocks. */ 674 __fs64 ui_ib[UFS_NINDIR];/* 208: Indirect disk blocks.*/ 698 * This structure is used for reading disk structures larger 945 __fs32 fs_inodefmt; /* format of on-disk inodes */
|
/linux-4.1.27/drivers/staging/lustre/lustre/include/ |
H A D | lustre_disk.h | 38 * Lustre disk format definitions. 46 /** \defgroup disk disk 55 /****************** on-disk files *********************/ 60 /** Persistent mount data are stored on the disk in this file. */ 156 /* On-disk configuration file. In host-endian order. */ 492 struct dt_device *lsi_dt_dev; /* dt device to access disk fs*/ 545 /** @} disk */
|