/block/ |
D | genhd.c | 59 void set_capacity(struct gendisk *disk, sector_t sectors) in set_capacity() argument 61 bdev_set_nr_sectors(disk->part0, sectors); in set_capacity() 69 bool set_capacity_and_notify(struct gendisk *disk, sector_t size) in set_capacity_and_notify() argument 71 sector_t capacity = get_capacity(disk); in set_capacity_and_notify() 74 set_capacity(disk, size); in set_capacity_and_notify() 82 !disk_live(disk) || in set_capacity_and_notify() 83 (disk->flags & GENHD_FL_HIDDEN)) in set_capacity_and_notify() 87 disk->disk_name, capacity, size); in set_capacity_and_notify() 95 kobject_uevent_env(&disk_to_dev(disk)->kobj, KOBJ_CHANGE, envp); in set_capacity_and_notify() 322 void disk_uevent(struct gendisk *disk, enum kobject_action action) in disk_uevent() argument [all …]
|
D | disk-events.c | 12 struct gendisk *disk; /* the associated disk */ member 41 static unsigned long disk_events_poll_jiffies(struct gendisk *disk) in disk_events_poll_jiffies() argument 43 struct disk_events *ev = disk->ev; in disk_events_poll_jiffies() 52 else if (disk->event_flags & DISK_EVENT_FLAG_POLL) in disk_events_poll_jiffies() 73 void disk_block_events(struct gendisk *disk) in disk_block_events() argument 75 struct disk_events *ev = disk->ev; in disk_block_events() 93 cancel_delayed_work_sync(&disk->ev->dwork); in disk_block_events() 98 static void __disk_unblock_events(struct gendisk *disk, bool check_now) in __disk_unblock_events() argument 100 struct disk_events *ev = disk->ev; in __disk_unblock_events() 112 intv = disk_events_poll_jiffies(disk); in __disk_unblock_events() [all …]
|
D | blk-zoned.c | 60 if (!rq->q->disk->seq_zones_wlock) in blk_req_needs_zone_write_lock() 71 if (test_and_set_bit(zno, rq->q->disk->seq_zones_wlock)) in blk_req_zone_write_trylock() 84 rq->q->disk->seq_zones_wlock))) in __blk_req_zone_write_lock() 95 if (rq->q->disk->seq_zones_wlock) in __blk_req_zone_write_unlock() 97 rq->q->disk->seq_zones_wlock)); in __blk_req_zone_write_unlock() 146 struct gendisk *disk = bdev->bd_disk; in blkdev_report_zones() local 147 sector_t capacity = get_capacity(disk); in blkdev_report_zones() 149 if (!bdev_is_zoned(bdev) || WARN_ON_ONCE(!disk->fops->report_zones)) in blkdev_report_zones() 155 return disk->fops->report_zones(disk, sector, nr_zones, cb, data); in blkdev_report_zones() 188 struct gendisk *disk = bdev->bd_disk; in blkdev_zone_reset_all_emulated() local [all …]
|
D | holder.c | 13 struct gendisk *disk) in bd_find_holder_disk() argument 17 list_for_each_entry(holder, &disk->slave_bdevs, list) in bd_find_holder_disk() 61 int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) in bd_link_disk_holder() argument 66 if (WARN_ON_ONCE(!disk->slave_dir)) in bd_link_disk_holder() 69 if (bdev->bd_disk == disk) in bd_link_disk_holder() 84 mutex_lock(&disk->open_mutex); in bd_link_disk_holder() 87 holder = bd_find_holder_disk(bdev, disk); in bd_link_disk_holder() 104 ret = add_symlink(disk->slave_dir, bdev_kobj(bdev)); in bd_link_disk_holder() 107 ret = add_symlink(bdev->bd_holder_dir, &disk_to_dev(disk)->kobj); in bd_link_disk_holder() 110 list_add(&holder->list, &disk->slave_bdevs); in bd_link_disk_holder() [all …]
|
D | blk-ia-ranges.c | 108 int disk_register_independent_access_ranges(struct gendisk *disk) in disk_register_independent_access_ranges() argument 110 struct blk_independent_access_ranges *iars = disk->ia_ranges; in disk_register_independent_access_ranges() 111 struct request_queue *q = disk->queue; in disk_register_independent_access_ranges() 126 &disk->queue_kobj, "%s", in disk_register_independent_access_ranges() 129 disk->ia_ranges = NULL; in disk_register_independent_access_ranges() 152 void disk_unregister_independent_access_ranges(struct gendisk *disk) in disk_unregister_independent_access_ranges() argument 154 struct request_queue *q = disk->queue; in disk_unregister_independent_access_ranges() 155 struct blk_independent_access_ranges *iars = disk->ia_ranges; in disk_unregister_independent_access_ranges() 173 disk->ia_ranges = NULL; in disk_unregister_independent_access_ranges() 193 static bool disk_check_ia_ranges(struct gendisk *disk, in disk_check_ia_ranges() argument [all …]
|
D | blk-sysfs.c | 82 if (!q->disk) in queue_ra_show() 84 ra_kb = q->disk->bdi->ra_pages << (PAGE_SHIFT - 10); in queue_ra_show() 94 if (!q->disk) in queue_ra_store() 99 q->disk->bdi->ra_pages = ra_kb >> (PAGE_SHIFT - 10); in queue_ra_store() 254 if (q->disk) in queue_max_sectors_store() 255 q->disk->bdi->io_pages = max_sectors_kb >> (PAGE_SHIFT - 10); in queue_max_sectors_store() 324 return queue_var_show(disk_nr_zones(q->disk), page); in queue_nr_zones_show() 329 return queue_var_show(bdev_max_open_zones(q->disk->part0), page); in queue_max_open_zones_show() 334 return queue_var_show(bdev_max_active_zones(q->disk->part0), page); in queue_max_active_zones_show() 586 ret = wbt_init(q->disk); in queue_wb_lat_store() [all …]
|
D | bdev.c | 390 struct block_device *bdev_alloc(struct gendisk *disk, u8 partno) in bdev_alloc() argument 409 bdev->bd_queue = disk->queue; in bdev_alloc() 411 bdev->bd_has_submit_bio = disk->part0->bd_has_submit_bio; in bdev_alloc() 419 bdev->bd_disk = disk; in bdev_alloc() 643 struct gendisk *disk = bdev->bd_disk; in blkdev_get_whole() local 646 if (disk->fops->open) { in blkdev_get_whole() 647 ret = disk->fops->open(disk, mode); in blkdev_get_whole() 651 test_bit(GD_NEED_PART_SCAN, &disk->state)) in blkdev_get_whole() 652 bdev_disk_changed(disk, true); in blkdev_get_whole() 659 if (test_bit(GD_NEED_PART_SCAN, &disk->state)) in blkdev_get_whole() [all …]
|
D | blk-throttle.h | 171 static inline int blk_throtl_init(struct gendisk *disk) { return 0; } in blk_throtl_init() argument 172 static inline void blk_throtl_exit(struct gendisk *disk) { } in blk_throtl_exit() argument 173 static inline void blk_throtl_register(struct gendisk *disk) { } in blk_throtl_register() argument 175 static inline void blk_throtl_cancel_bios(struct gendisk *disk) { } in blk_throtl_cancel_bios() argument 177 int blk_throtl_init(struct gendisk *disk); 178 void blk_throtl_exit(struct gendisk *disk); 179 void blk_throtl_register(struct gendisk *disk); 181 void blk_throtl_cancel_bios(struct gendisk *disk);
|
D | blk-cgroup.c | 305 static struct blkcg_gq *blkg_alloc(struct blkcg *blkcg, struct gendisk *disk, in blkg_alloc() argument 312 blkg = kzalloc_node(sizeof(*blkg), gfp_mask, disk->queue->node); in blkg_alloc() 320 if (!blk_get_queue(disk->queue)) in blkg_alloc() 323 blkg->q = disk->queue; in blkg_alloc() 343 if (!blkcg_policy_enabled(disk->queue, pol)) in blkg_alloc() 347 pd = pol->pd_alloc_fn(disk, blkcg, gfp_mask); in blkg_alloc() 362 blk_put_queue(disk->queue); in blkg_alloc() 376 static struct blkcg_gq *blkg_create(struct blkcg *blkcg, struct gendisk *disk, in blkg_create() argument 382 lockdep_assert_held(&disk->queue->queue_lock); in blkg_create() 385 if (blk_queue_dying(disk->queue)) { in blkg_create() [all …]
|
D | blk.h | 425 void disk_free_zone_bitmaps(struct gendisk *disk); 426 void disk_clear_zone_settings(struct gendisk *disk); 432 static inline void disk_free_zone_bitmaps(struct gendisk *disk) {} in disk_free_zone_bitmaps() argument 433 static inline void disk_clear_zone_settings(struct gendisk *disk) {} in disk_clear_zone_settings() argument 446 struct block_device *bdev_alloc(struct gendisk *disk, u8 partno); 454 int bdev_add_partition(struct gendisk *disk, int partno, sector_t start, 456 int bdev_del_partition(struct gendisk *disk, int partno); 457 int bdev_resize_partition(struct gendisk *disk, int partno, sector_t start, 482 int disk_scan_partitions(struct gendisk *disk, blk_mode_t mode); 484 int disk_alloc_events(struct gendisk *disk); [all …]
|
D | blk-wbt.h | 7 int wbt_init(struct gendisk *disk); 8 void wbt_disable_default(struct gendisk *disk); 9 void wbt_enable_default(struct gendisk *disk); 21 static inline void wbt_disable_default(struct gendisk *disk) in wbt_disable_default() argument 24 static inline void wbt_enable_default(struct gendisk *disk) in wbt_enable_default() argument
|
D | blk-ioprio.h | 12 int blk_ioprio_init(struct gendisk *disk); 13 void blk_ioprio_exit(struct gendisk *disk); 16 static inline int blk_ioprio_init(struct gendisk *disk) in blk_ioprio_init() argument 20 static inline void blk_ioprio_exit(struct gendisk *disk) in blk_ioprio_exit() argument
|
D | blk-settings.c | 215 if (!q->disk) in blk_queue_max_hw_sectors() 217 q->disk->bdi->io_pages = max_sectors >> (PAGE_SHIFT - 9); in blk_queue_max_hw_sectors() 462 void disk_update_readahead(struct gendisk *disk) in disk_update_readahead() argument 464 struct request_queue *q = disk->queue; in disk_update_readahead() 470 disk->bdi->ra_pages = in disk_update_readahead() 472 disk->bdi->io_pages = queue_max_sectors(q) >> (PAGE_SHIFT - 9); in disk_update_readahead() 554 if (!q->disk) in blk_queue_io_opt() 556 q->disk->bdi->ra_pages = in blk_queue_io_opt() 778 void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, in disk_stack_limits() argument 781 struct request_queue *t = disk->queue; in disk_stack_limits() [all …]
|
D | ioctl.c | 19 struct gendisk *disk = bdev->bd_disk; in blkpg_do_ioctl() local 34 return bdev_del_partition(disk, p.pno); in blkpg_do_ioctl() 47 return bdev_add_partition(disk, p.pno, start, length); in blkpg_do_ioctl() 49 return bdev_resize_partition(disk, p.pno, start, length); in blkpg_do_ioctl() 250 struct gendisk *disk = bdev->bd_disk; in blkdev_compat_ptr_ioctl() local 252 if (disk->fops->ioctl) in blkdev_compat_ptr_ioctl() 253 return disk->fops->ioctl(bdev, mode, cmd, in blkdev_compat_ptr_ioctl() 405 struct gendisk *disk = bdev->bd_disk; in blkdev_getgeo() local 411 if (!disk->fops->getgeo) in blkdev_getgeo() 420 ret = disk->fops->getgeo(bdev, &geo); in blkdev_getgeo() [all …]
|
D | bsg.c | 180 struct gendisk *disk = bd->queue->disk; in bsg_unregister_queue() local 182 if (disk && disk->queue_kobj.sd) in bsg_unregister_queue() 183 sysfs_remove_link(&disk->queue_kobj, "bsg"); in bsg_unregister_queue() 223 if (q->disk && q->disk->queue_kobj.sd) { in bsg_register_queue() 224 ret = sysfs_create_link(&q->disk->queue_kobj, &bd->device.kobj, in bsg_register_queue()
|
D | blk-integrity.c | 362 void blk_integrity_register(struct gendisk *disk, struct blk_integrity *template) in blk_integrity_register() argument 364 struct blk_integrity *bi = &disk->queue->integrity; in blk_integrity_register() 369 ilog2(queue_logical_block_size(disk->queue)); in blk_integrity_register() 374 blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, disk->queue); in blk_integrity_register() 377 if (disk->queue->crypto_profile) { in blk_integrity_register() 379 disk->queue->crypto_profile = NULL; in blk_integrity_register() 392 void blk_integrity_unregister(struct gendisk *disk) in blk_integrity_unregister() argument 394 struct blk_integrity *bi = &disk->queue->integrity; in blk_integrity_unregister() 401 blk_queue_flag_clear(QUEUE_FLAG_STABLE_WRITES, disk->queue); in blk_integrity_unregister()
|
D | early-lookup.c | 132 struct gendisk *disk = dev_to_disk(dev); in blk_lookup_devt() local 137 if (partno < disk->minors) { in blk_lookup_devt() 144 devt = part_devt(disk, partno); in blk_lookup_devt() 279 struct gendisk *disk = dev_to_disk(dev); in printk_all_partitions() local 288 if (get_capacity(disk) == 0 || (disk->flags & GENHD_FL_HIDDEN)) in printk_all_partitions() 296 xa_for_each(&disk->part_tbl, idx, part) { in printk_all_partitions()
|
D | blk-wbt.c | 168 struct backing_dev_info *bdi = rwb->rqos.disk->bdi; in wb_recent_wait() 306 struct backing_dev_info *bdi = rwb->rqos.disk->bdi; in latency_exceeded() 359 struct backing_dev_info *bdi = rwb->rqos.disk->bdi; in rwb_trace_step() 429 if (!rwb->rqos.disk) in wb_timer_fn() 434 trace_wbt_timer(rwb->rqos.disk->bdi, status, rqd->scale_step, inflight); in wb_timer_fn() 712 void wbt_enable_default(struct gendisk *disk) in wbt_enable_default() argument 714 struct request_queue *q = disk->queue; in wbt_enable_default() 735 wbt_init(disk); in wbt_enable_default() 766 RQWB(rqos)->rq_depth.queue_depth = blk_queue_depth(rqos->disk->queue); in wbt_queue_depth_changed() 774 blk_stat_remove_callback(rqos->disk->queue, rwb->cb); in wbt_exit() [all …]
|
D | blk-cgroup.h | 164 typedef struct blkg_policy_data *(blkcg_pol_alloc_pd_fn)(struct gendisk *disk, 197 int blkcg_init_disk(struct gendisk *disk); 198 void blkcg_exit_disk(struct gendisk *disk); 203 int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol); 204 void blkcg_deactivate_policy(struct gendisk *disk, 491 static inline int blkcg_init_disk(struct gendisk *disk) { return 0; } in blkcg_init_disk() argument 492 static inline void blkcg_exit_disk(struct gendisk *disk) { } in blkcg_exit_disk() argument 495 static inline int blkcg_activate_policy(struct gendisk *disk, in blkcg_activate_policy() argument 497 static inline void blkcg_deactivate_policy(struct gendisk *disk, in blkcg_deactivate_policy() argument
|
D | blk-crypto-sysfs.c | 129 int blk_crypto_sysfs_register(struct gendisk *disk) in blk_crypto_sysfs_register() argument 131 struct request_queue *q = disk->queue; in blk_crypto_sysfs_register() 144 &disk->queue_kobj, "crypto"); in blk_crypto_sysfs_register() 153 void blk_crypto_sysfs_unregister(struct gendisk *disk) in blk_crypto_sysfs_unregister() argument 155 kobject_put(disk->queue->crypto_kobject); in blk_crypto_sysfs_unregister()
|
D | blk-mq-debugfs-zoned.c | 14 if (!q->disk->seq_zones_wlock) in queue_zone_wlock_show() 17 for (i = 0; i < q->disk->nr_zones; i++) in queue_zone_wlock_show() 18 if (test_bit(i, q->disk->seq_zones_wlock)) in queue_zone_wlock_show()
|
D | blk-ioprio.c | 122 ioprio_alloc_pd(struct gendisk *disk, struct blkcg *blkcg, gfp_t gfp) in ioprio_alloc_pd() argument 222 void blk_ioprio_exit(struct gendisk *disk) in blk_ioprio_exit() argument 224 blkcg_deactivate_policy(disk, &ioprio_policy); in blk_ioprio_exit() 227 int blk_ioprio_init(struct gendisk *disk) in blk_ioprio_init() argument 229 return blkcg_activate_policy(disk, &ioprio_policy); in blk_ioprio_init()
|
/block/partitions/ |
D | core.c | 129 state->disk = hd; in check_partition() 299 static struct block_device *add_partition(struct gendisk *disk, int partno, in add_partition() argument 304 struct device *ddev = disk_to_dev(disk); in add_partition() 310 lockdep_assert_held(&disk->open_mutex); in add_partition() 319 switch (disk->queue->limits.zoned) { in add_partition() 322 disk->disk_name); in add_partition() 326 disk->disk_name); in add_partition() 327 disk_set_zoned(disk, BLK_ZONED_NONE); in add_partition() 333 if (xa_load(&disk->part_tbl, partno)) in add_partition() 337 get_device(disk_to_dev(disk)); in add_partition() [all …]
|
D | efi.c | 134 static u64 last_lba(struct gendisk *disk) in last_lba() argument 136 return div_u64(bdev_nr_bytes(disk->part0), in last_lba() 137 queue_logical_block_size(disk->queue)) - 1ULL; in last_lba() 240 (queue_logical_block_size(state->disk->queue) / 512); in read_lba() 242 if (!buffer || lba > last_lba(state->disk)) in read_lba() 310 unsigned ssz = queue_logical_block_size(state->disk->queue); in alloc_read_gpt_header() 357 queue_logical_block_size(state->disk->queue)) { in is_gpt_valid() 360 queue_logical_block_size(state->disk->queue)); in is_gpt_valid() 396 lastlba = last_lba(state->disk); in is_gpt_valid() 588 struct gendisk *disk = state->disk; in find_valid_gpt() local [all …]
|
D | amiga.c | 56 state->disk->disk_name, blk); in amiga_partition() 78 state->disk->disk_name, blk); in amiga_partition() 97 state->disk->disk_name, blk, part); in amiga_partition() 103 state->disk->disk_name, blk); in amiga_partition() 127 state->disk->disk_name, cylblk); in amiga_partition() 134 state->disk->disk_name, cylblk, in amiga_partition() 144 state->disk->disk_name, part); in amiga_partition() 165 state->disk->disk_name, part, in amiga_partition() 171 state->disk->disk_name, part, in amiga_partition()
|