Home
last modified time | relevance | path

Searched refs:disk (Results 1 – 25 of 566) sorted by relevance

12345678910>>...23

/linux-6.6.21/block/
Dgenhd.c59 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 …]
Ddisk-events.c12 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 …]
Dblk-zoned.c60 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()
141 struct gendisk *disk = bdev->bd_disk; in blkdev_report_zones() local
142 sector_t capacity = get_capacity(disk); in blkdev_report_zones()
144 if (!bdev_is_zoned(bdev) || WARN_ON_ONCE(!disk->fops->report_zones)) in blkdev_report_zones()
150 return disk->fops->report_zones(disk, sector, nr_zones, cb, data); in blkdev_report_zones()
183 struct gendisk *disk = bdev->bd_disk; in blkdev_zone_reset_all_emulated() local
[all …]
Dholder.c12 struct gendisk *disk) in bd_find_holder_disk() argument
16 list_for_each_entry(holder, &disk->slave_bdevs, list) in bd_find_holder_disk()
60 int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) in bd_link_disk_holder() argument
65 if (WARN_ON_ONCE(!disk->slave_dir)) in bd_link_disk_holder()
68 if (bdev->bd_disk == disk) in bd_link_disk_holder()
83 mutex_lock(&disk->open_mutex); in bd_link_disk_holder()
86 holder = bd_find_holder_disk(bdev, disk); in bd_link_disk_holder()
103 ret = add_symlink(disk->slave_dir, bdev_kobj(bdev)); in bd_link_disk_holder()
106 ret = add_symlink(bdev->bd_holder_dir, &disk_to_dev(disk)->kobj); in bd_link_disk_holder()
109 list_add(&holder->list, &disk->slave_bdevs); in bd_link_disk_holder()
[all …]
Dblk-ia-ranges.c108 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 …]
Dblk-sysfs.c82 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 …]
/linux-6.6.21/block/partitions/
Dcore.c129 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 …]
/linux-6.6.21/drivers/md/
Ddm-zone.c25 struct gendisk *disk = md->disk; in dm_blk_do_report_zones() local
46 args.next_sector < get_capacity(disk)); in dm_blk_do_report_zones()
56 int dm_blk_report_zones(struct gendisk *disk, sector_t sector, in dm_blk_report_zones() argument
59 struct mapped_device *md = disk->private_data; in dm_blk_report_zones()
143 if (md->disk) { in dm_cleanup_zoned_dev()
144 bitmap_free(md->disk->conv_zones_bitmap); in dm_cleanup_zoned_dev()
145 md->disk->conv_zones_bitmap = NULL; in dm_cleanup_zoned_dev()
146 bitmap_free(md->disk->seq_zones_wlock); in dm_cleanup_zoned_dev()
147 md->disk->seq_zones_wlock = NULL; in dm_cleanup_zoned_dev()
181 struct gendisk *disk = md->disk; in dm_zone_revalidate_cb() local
[all …]
Ddm-era-target.c203 struct superblock_disk *disk = dm_block_data(b); in sb_prepare_for_write() local
205 disk->blocknr = cpu_to_le64(dm_block_location(b)); in sb_prepare_for_write()
206 disk->csum = cpu_to_le32(dm_bm_checksum(&disk->flags, in sb_prepare_for_write()
211 static int check_metadata_version(struct superblock_disk *disk) in check_metadata_version() argument
213 uint32_t metadata_version = le32_to_cpu(disk->version); in check_metadata_version()
228 struct superblock_disk *disk = dm_block_data(b); in sb_check() local
231 if (dm_block_location(b) != le64_to_cpu(disk->blocknr)) { in sb_check()
233 __func__, le64_to_cpu(disk->blocknr), in sb_check()
238 if (le64_to_cpu(disk->magic) != SUPERBLOCK_MAGIC) { in sb_check()
240 __func__, le64_to_cpu(disk->magic), in sb_check()
[all …]
/linux-6.6.21/drivers/block/
Dn64cart.c117 struct gendisk *disk; in n64cart_probe() local
134 disk = blk_alloc_disk(NUMA_NO_NODE); in n64cart_probe()
135 if (!disk) in n64cart_probe()
138 disk->first_minor = 0; in n64cart_probe()
139 disk->flags = GENHD_FL_NO_PART; in n64cart_probe()
140 disk->fops = &n64cart_fops; in n64cart_probe()
141 disk->private_data = &pdev->dev; in n64cart_probe()
142 strcpy(disk->disk_name, "n64cart"); in n64cart_probe()
144 set_capacity(disk, size >> SECTOR_SHIFT); in n64cart_probe()
145 set_disk_ro(disk, 1); in n64cart_probe()
[all …]
Dz2ram.c143 static int z2_open(struct gendisk *disk, blk_mode_t mode) in z2_open() argument
145 int device = disk->first_minor; in z2_open()
291 static void z2_release(struct gendisk *disk) in z2_release() argument
318 struct gendisk *disk; in z2ram_register_disk() local
321 disk = blk_mq_alloc_disk(&tag_set, NULL); in z2ram_register_disk()
322 if (IS_ERR(disk)) in z2ram_register_disk()
323 return PTR_ERR(disk); in z2ram_register_disk()
325 disk->major = Z2RAM_MAJOR; in z2ram_register_disk()
326 disk->first_minor = minor; in z2ram_register_disk()
327 disk->minors = 1; in z2ram_register_disk()
[all …]
Dnbd.c123 struct gendisk *disk; member
159 #define nbd_name(nbd) ((nbd)->disk->disk_name)
177 return disk_to_dev(nbd->disk); in nbd_to_dev()
224 struct gendisk *disk = dev_to_disk(dev); in pid_show() local
225 struct nbd_device *nbd = (struct nbd_device *)disk->private_data; in pid_show()
238 struct gendisk *disk = dev_to_disk(dev); in backend_show() local
239 struct nbd_device *nbd = (struct nbd_device *)disk->private_data; in backend_show()
251 struct gendisk *disk = nbd->disk; in nbd_dev_remove() local
253 del_gendisk(disk); in nbd_dev_remove()
264 put_disk(disk); in nbd_dev_remove()
[all …]
Dataflop.c301 struct gendisk *disk[NUM_DISK_MINORS]; member
450 static int floppy_open(struct gendisk *disk, blk_mode_t mode);
451 static void floppy_release(struct gendisk *disk);
760 q = unit[drive].disk[type]->queue; in do_format()
1184 set_capacity(unit[SelectedDrive].disk[0], in fd_rwsec_done1()
1199 set_capacity(unit[SelectedDrive].disk[0], in fd_rwsec_done1()
1435 static unsigned int floppy_check_events(struct gendisk *disk, in floppy_check_events() argument
1438 struct atari_floppy_struct *p = disk->private_data; in floppy_check_events()
1458 static int floppy_revalidate(struct gendisk *disk) in floppy_revalidate() argument
1460 struct atari_floppy_struct *p = disk->private_data; in floppy_revalidate()
[all …]
/linux-6.6.21/include/linux/
Dblkdev.h212 static inline bool disk_live(struct gendisk *disk) in disk_live() argument
214 return !inode_unhashed(disk->part0->bd_inode); in disk_live()
227 static inline unsigned int disk_openers(struct gendisk *disk) in disk_openers() argument
229 return atomic_read(&disk->part0->bd_openers); in disk_openers()
238 #define disk_to_dev(disk) \ argument
239 (&((disk)->part0->bd_device))
242 #define disk_to_cdi(disk) ((disk)->cdi) argument
244 #define disk_to_cdi(disk) NULL argument
247 static inline dev_t disk_devt(struct gendisk *disk) in disk_devt() argument
249 return MKDEV(disk->major, disk->first_minor); in disk_devt()
[all …]
/linux-6.6.21/Documentation/admin-guide/
Ddevices.txt20 1 block RAM disk
21 0 = /dev/ram0 First RAM disk
22 1 = /dev/ram1 Second RAM disk
24 250 = /dev/initrd Initial RAM disk
27 /dev/initrd refers to a RAM disk which was preloaded
115 3 block First MFM, RLL and IDE hard disk/CD-ROM interface
116 0 = /dev/hda Master: whole disk (or CD-ROM)
117 64 = /dev/hdb Slave: whole disk (or CD-ROM)
119 For partitions, add to the whole disk device number:
120 0 = /dev/hd? Whole disk
[all …]
/linux-6.6.21/drivers/block/null_blk/
Dtrace.h24 static inline void __assign_disk_name(char *name, struct gendisk *disk) in __assign_disk_name() argument
26 if (disk) in __assign_disk_name()
27 memcpy(name, disk->disk_name, DISK_NAME_LEN); in __assign_disk_name()
38 __array(char, disk, DISK_NAME_LEN)
47 __assign_disk_name(__entry->disk, cmd->rq->q->disk);
50 __print_disk_name(__entry->disk),
60 __array(char, disk, DISK_NAME_LEN)
65 __assign_disk_name(__entry->disk, nullb->disk);
68 __print_disk_name(__entry->disk), __entry->nr_zones)
/linux-6.6.21/arch/m68k/emu/
Dnfblock.c57 struct gendisk *disk; member
120 dev->disk = blk_alloc_disk(NUMA_NO_NODE); in nfhd_init_one()
121 if (!dev->disk) in nfhd_init_one()
124 dev->disk->major = major_num; in nfhd_init_one()
125 dev->disk->first_minor = dev_id * 16; in nfhd_init_one()
126 dev->disk->minors = 16; in nfhd_init_one()
127 dev->disk->fops = &nfhd_ops; in nfhd_init_one()
128 dev->disk->private_data = dev; in nfhd_init_one()
129 sprintf(dev->disk->disk_name, "nfhd%u", dev_id); in nfhd_init_one()
130 set_capacity(dev->disk, (sector_t)blocks * (bsize / 512)); in nfhd_init_one()
[all …]
/linux-6.6.21/drivers/nvme/host/
Dmultipath.c59 if (h->disk) in nvme_mpath_unfreeze()
60 blk_mq_unfreeze_queue(h->disk->queue); in nvme_mpath_unfreeze()
69 if (h->disk) in nvme_mpath_wait_freeze()
70 blk_mq_freeze_queue_wait(h->disk->queue); in nvme_mpath_wait_freeze()
79 if (h->disk) in nvme_mpath_start_freeze()
80 blk_freeze_queue_start(h->disk->queue); in nvme_mpath_start_freeze()
104 bio_set_dev(bio, ns->head->disk->part0); in nvme_failover_req()
128 struct gendisk *disk = ns->head->disk; in nvme_mpath_start_request() local
130 if (!blk_queue_io_stat(disk->queue) || blk_rq_is_passthrough(rq)) in nvme_mpath_start_request()
134 nvme_req(rq)->start_time = bdev_start_io_acct(disk->part0, req_op(rq), in nvme_mpath_start_request()
[all …]
Dtrace.h38 static inline void __assign_disk_name(char *name, struct gendisk *disk) in __assign_disk_name() argument
40 if (disk) in __assign_disk_name()
41 memcpy(name, disk->disk_name, DISK_NAME_LEN); in __assign_disk_name()
51 __array(char, disk, DISK_NAME_LEN)
71 __assign_disk_name(__entry->disk, req->q->disk);
76 __entry->ctrl_id, __print_disk_name(__entry->disk),
89 __array(char, disk, DISK_NAME_LEN)
106 __assign_disk_name(__entry->disk, req->q->disk);
109 __entry->ctrl_id, __print_disk_name(__entry->disk),
146 __array(char, disk, DISK_NAME_LEN)
[all …]
/linux-6.6.21/drivers/scsi/
Dsr.c141 static inline struct scsi_cd *scsi_cd(struct gendisk *disk) in scsi_cd() argument
143 return disk->private_data; in scsi_cd()
302 struct scsi_cd *cd = scsi_cd(rq->q->disk); in sr_done()
342 if (error_sector < get_capacity(cd->disk) && in sr_done()
344 set_capacity(cd->disk, error_sector); in sr_done()
369 cd = scsi_cd(rq->q->disk); in sr_init_command()
487 static int sr_block_open(struct gendisk *disk, blk_mode_t mode) in sr_block_open() argument
489 struct scsi_cd *cd = scsi_cd(disk); in sr_block_open()
497 if (disk_check_media_change(disk)) in sr_block_open()
510 static void sr_block_release(struct gendisk *disk) in sr_block_release() argument
[all …]
/linux-6.6.21/Documentation/ABI/testing/
Dsysfs-fs-f2fs1 What: /sys/fs/f2fs/<disk>/gc_max_sleep_time
7 What: /sys/fs/f2fs/<disk>/gc_min_sleep_time
13 What: /sys/fs/f2fs/<disk>/gc_no_gc_sleep_time
19 What: /sys/fs/f2fs/<disk>/gc_idle
31 What: /sys/fs/f2fs/<disk>/reclaim_segments
41 What: /sys/fs/f2fs/<disk>/main_blkaddr
46 What: /sys/fs/f2fs/<disk>/ipu_policy
72 What: /sys/fs/f2fs/<disk>/min_ipu_util
78 What: /sys/fs/f2fs/<disk>/min_fsync_blocks
84 What: /sys/fs/f2fs/<disk>/min_seq_blocks
[all …]
/linux-6.6.21/drivers/md/bcache/
Dwriteback.c32 struct cache_set *c = dc->disk.c; in __calc_target_rate()
84 int64_t dirty = bcache_dev_sectors_dirty(&dc->disk); in __update_writeback_rate()
101 struct cache_set *c = dc->disk.c; in __update_writeback_rate()
247 struct cache_set *c = dc->disk.c; in update_writeback_rate()
253 set_bit(BCACHE_DEV_RATE_DW_RUNNING, &dc->disk.flags); in update_writeback_rate()
261 if (!test_bit(BCACHE_DEV_WB_RUNNING, &dc->disk.flags) || in update_writeback_rate()
263 clear_bit(BCACHE_DEV_RATE_DW_RUNNING, &dc->disk.flags); in update_writeback_rate()
297 if (test_bit(BCACHE_DEV_WB_RUNNING, &dc->disk.flags) && in update_writeback_rate()
307 clear_bit(BCACHE_DEV_RATE_DW_RUNNING, &dc->disk.flags); in update_writeback_rate()
315 if (test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags) || in writeback_delay()
[all …]
/linux-6.6.21/Documentation/admin-guide/blockdev/
Dramdisk.rst2 Using the RAM disk block device with Linux
16 The RAM disk driver is a way to use main system memory as a block device. It
22 The RAM disk dynamically grows as more space is required. It does this by using
26 The RAM disk supports up to 16 RAM disks by default, and can be reconfigured
31 To use RAM disk support with your system, run './MAKEDEV ram' from the /dev
35 The new RAM disk also has the ability to load compressed RAM disk images,
37 rescue floppy disk.
48 This parameter tells the RAM disk driver to set up RAM disks of N k size. The
80 If you make a boot disk that has LILO, then for the above, you would use::
87 To create a RAM disk image, you will need a spare block device to
[all …]
/linux-6.6.21/drivers/block/drbd/
Ddrbd_state.c127 device_state_change->disk_state[OLD] = device->state.disk; in remember_old_state()
178 device_state_change->disk_state[NEW] = device->state.disk; in remember_new_state()
303 if (device->state.disk != D_DISKLESS || in conn_all_vols_unconf()
376 disk_state = max_t(enum drbd_disk_state, disk_state, device->state.disk); in conn_highest_disk()
392 disk_state = min_t(enum drbd_disk_state, disk_state, device->state.disk); in conn_lowest_disk()
474 (os.disk != D_FAILED && ns.disk == D_FAILED))) || in cl_wide_st_chg()
675 return drbd_req_state(device, NS(disk, D_FAILED), in request_detach()
689 device->state.disk != D_FAILED); in drbd_request_detach_interruptible()
722 drbd_disk_str(ns.disk), in print_st()
762 if (ns.disk != os.disk && flags & CS_DC_DISK) in print_state_change()
[all …]
/linux-6.6.21/Documentation/ABI/stable/
Dsysfs-block1 What: /sys/block/<disk>/alignment_offset
10 offset from the disk's natural alignment.
13 What: /sys/block/<disk>/discard_alignment
25 What: /sys/block/<disk>/diskseq
29 The /sys/block/<disk>/diskseq files reports the disk
37 What: /sys/block/<disk>/inflight
49 This is related to /sys/block/<disk>/queue/nr_requests
53 What: /sys/block/<disk>/integrity/device_is_integrity_capable
61 What: /sys/block/<disk>/integrity/format
69 What: /sys/block/<disk>/integrity/protection_interval_bytes
[all …]

12345678910>>...23