Home
last modified time | relevance | path

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

1234567

/drivers/block/paride/
Dpd.c252 static inline int status_reg(struct pd_unit *disk) in status_reg() argument
254 return pi_read_regr(disk->pi, 1, 6); in status_reg()
257 static inline int read_reg(struct pd_unit *disk, int reg) in read_reg() argument
259 return pi_read_regr(disk->pi, 0, reg); in read_reg()
262 static inline void write_status(struct pd_unit *disk, int val) in write_status() argument
264 pi_write_regr(disk->pi, 1, 6, val); in write_status()
267 static inline void write_reg(struct pd_unit *disk, int reg, int val) in write_reg() argument
269 pi_write_regr(disk->pi, 0, reg, val); in write_reg()
272 static inline u8 DRIVE(struct pd_unit *disk) in DRIVE() argument
274 return 0xa0+0x10*disk->drive; in DRIVE()
[all …]
Dpf.c214 static void pf_release(struct gendisk *disk, fmode_t mode);
240 struct gendisk *disk; member
248 static unsigned int pf_check_events(struct gendisk *disk,
287 struct gendisk *disk = alloc_disk(1); in pf_init_units() local
288 if (!disk) in pf_init_units()
290 disk->queue = blk_init_queue(do_pf_request, &pf_spin_lock); in pf_init_units()
291 if (!disk->queue) { in pf_init_units()
292 put_disk(disk); in pf_init_units()
295 blk_queue_max_segments(disk->queue, cluster); in pf_init_units()
296 blk_queue_bounce_limit(disk->queue, BLK_BOUNCE_HIGH); in pf_init_units()
[all …]
Dpcd.c201 struct gendisk *disk; member
242 static void pcd_block_release(struct gendisk *disk, fmode_t mode) in pcd_block_release() argument
244 struct pcd_unit *cd = disk->private_data; in pcd_block_release()
263 static unsigned int pcd_block_check_events(struct gendisk *disk, in pcd_block_check_events() argument
266 struct pcd_unit *cd = disk->private_data; in pcd_block_check_events()
302 struct gendisk *disk = alloc_disk(1); in pcd_init_units() local
303 if (!disk) in pcd_init_units()
305 disk->queue = blk_init_queue(do_pcd_request, &pcd_lock); in pcd_init_units()
306 if (!disk->queue) { in pcd_init_units()
307 put_disk(disk); in pcd_init_units()
[all …]
/drivers/md/bcache/
Dwriteback.c24 struct cache_set *c = dc->disk.c; in __update_writeback_rate()
35 int64_t dirty = bcache_dev_sectors_dirty(&dc->disk); in __update_writeback_rate()
36 int64_t derivative = dirty - dc->disk.sectors_dirty_last; in __update_writeback_rate()
40 dc->disk.sectors_dirty_last = dirty; in __update_writeback_rate()
49 derivative = ewma_add(dc->disk.sectors_dirty_derivative, derivative, in __update_writeback_rate()
94 if (test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags) || in writeback_delay()
149 atomic_inc(&PTR_BUCKET(dc->disk.c, &w->key, i)->pin); in write_dirty_finish()
151 ret = bch_btree_insert(dc->disk.c, &keys, NULL, &w->key); in write_dirty_finish()
157 ? &dc->disk.c->writeback_keys_failed in write_dirty_finish()
158 : &dc->disk.c->writeback_keys_done); in write_dirty_finish()
[all …]
Dsuper.c671 bd_unlink_disk_holder(ca->bdev, d->disk); in bcache_device_unlink()
682 bd_link_disk_holder(ca->bdev, d->disk); in bcache_device_link()
728 pr_info("%s stopped", d->disk->disk_name); in bcache_device_free()
732 if (d->disk && d->disk->flags & GENHD_FL_UP) in bcache_device_free()
733 del_gendisk(d->disk); in bcache_device_free()
734 if (d->disk && d->disk->queue) in bcache_device_free()
735 blk_cleanup_queue(d->disk->queue); in bcache_device_free()
736 if (d->disk) { in bcache_device_free()
737 ida_simple_remove(&bcache_minor, d->disk->first_minor); in bcache_device_free()
738 put_disk(d->disk); in bcache_device_free()
[all …]
Dwriteback.h48 unsigned stripe = offset_to_stripe(&dc->disk, offset); in bcache_dev_stripe_dirty()
51 if (atomic_read(dc->disk.stripe_sectors_dirty + stripe)) in bcache_dev_stripe_dirty()
54 if (nr_sectors <= dc->disk.stripe_size) in bcache_dev_stripe_dirty()
57 nr_sectors -= dc->disk.stripe_size; in bcache_dev_stripe_dirty()
65 unsigned in_use = dc->disk.c->gc_stats.in_use; in should_writeback()
68 test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags) || in should_writeback()
/drivers/scsi/
Dsr.c138 static inline struct scsi_cd *scsi_cd(struct gendisk *disk) in scsi_cd() argument
140 return container_of(disk->private_data, struct scsi_cd, driver); in scsi_cd()
160 static inline struct scsi_cd *scsi_cd_get(struct gendisk *disk) in scsi_cd_get() argument
165 if (disk->private_data == NULL) in scsi_cd_get()
167 cd = scsi_cd(disk); in scsi_cd_get()
369 if (error_sector < get_capacity(cd->disk) && in sr_done()
371 set_capacity(cd->disk, error_sector); in sr_done()
549 static void sr_block_release(struct gendisk *disk, fmode_t mode) in sr_block_release() argument
551 struct scsi_cd *cd = scsi_cd(disk); in sr_block_release()
600 static unsigned int sr_block_check_events(struct gendisk *disk, in sr_block_check_events() argument
[all …]
/drivers/block/
Dvirtio_blk.c37 struct gendisk *disk; member
128 struct gendisk *disk = bdev->bd_disk; in virtblk_ioctl() local
129 struct virtio_blk *vblk = disk->private_data; in virtblk_ioctl()
213 blk_mq_start_stopped_hw_queues(vblk->disk->queue, true); in virtblk_done()
296 static int virtblk_get_id(struct gendisk *disk, char *id_str) in virtblk_get_id() argument
298 struct virtio_blk *vblk = disk->private_data; in virtblk_get_id()
299 struct request_queue *q = vblk->disk->queue; in virtblk_get_id()
311 blk_execute_rq(vblk->disk->queue, vblk->disk, req, false); in virtblk_get_id()
359 struct gendisk *disk = dev_to_disk(dev); in virtblk_serial_show() local
366 err = virtblk_get_id(disk, buf); in virtblk_serial_show()
[all …]
Dnbd.c108 struct gendisk *disk; member
132 #define nbd_name(nbd) ((nbd)->disk->disk_name)
152 return disk_to_dev(nbd->disk); in nbd_to_dev()
199 struct gendisk *disk = dev_to_disk(dev); in pid_show() local
200 struct nbd_device *nbd = (struct nbd_device *)disk->private_data; in pid_show()
212 struct gendisk *disk = nbd->disk; in nbd_dev_remove() local
215 if (disk) { in nbd_dev_remove()
216 q = disk->queue; in nbd_dev_remove()
217 del_gendisk(disk); in nbd_dev_remove()
220 disk->private_data = NULL; in nbd_dev_remove()
[all …]
Dswim.c192 struct gendisk *disk; member
535 q = swd->unit[swd->fdc_queue].disk->queue; in swim_next_request()
661 set_capacity(fs->disk, fs->total_secs); in floppy_open()
696 static void floppy_release(struct gendisk *disk, fmode_t mode) in floppy_release() argument
698 struct floppy_state *fs = disk->private_data; in floppy_release()
756 static unsigned int floppy_check_events(struct gendisk *disk, in floppy_check_events() argument
759 struct floppy_state *fs = disk->private_data; in floppy_check_events()
764 static int floppy_revalidate(struct gendisk *disk) in floppy_revalidate() argument
766 struct floppy_state *fs = disk->private_data; in floppy_revalidate()
801 return get_disk(swd->unit[drive].disk); in floppy_find()
[all …]
Dataflop.c221 struct gendisk *disk; member
372 static void floppy_release(struct gendisk *disk, fmode_t mode);
1076 set_capacity(unit[SelectedDrive].disk, in fd_rwsec_done1()
1091 set_capacity(unit[SelectedDrive].disk, in fd_rwsec_done1()
1328 static unsigned int floppy_check_events(struct gendisk *disk, in floppy_check_events() argument
1331 struct atari_floppy_struct *p = disk->private_data; in floppy_check_events()
1351 static int floppy_revalidate(struct gendisk *disk) in floppy_revalidate() argument
1353 struct atari_floppy_struct *p = disk->private_data; in floppy_revalidate()
1407 q = unit[fdc_queue].disk->queue; in set_next_request()
1456 set_capacity(floppy->disk, UDT->blocks); in redo_fd_request()
[all …]
Damiflop.c814 static unsigned long *putsec(int disk, unsigned long *raw, int cnt) in putsec() argument
819 disk&=3; in putsec()
825 hdr.track = unit[disk].track; in putsec()
827 hdr.ord = unit[disk].dtype->sects * unit[disk].type->sect_mult - cnt; in putsec()
832 hdr.datachk = checksum((ulong *)(unit[disk].trackbuf+cnt*512), 512); in putsec()
842 encode_block(raw, (ulong *)(unit[disk].trackbuf+cnt*512), 512); in putsec()
848 static void amiga_write(int disk) in amiga_write() argument
853 disk&=3; in amiga_write()
855 for (cnt = 0; cnt < 415 * unit[disk].type->sect_mult; cnt++) in amiga_write()
859 for (cnt = 0; cnt < unit[disk].dtype->sects * unit[disk].type->sect_mult; cnt++) in amiga_write()
[all …]
Dswim3.c255 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);
1024 static void floppy_release(struct gendisk *disk, fmode_t mode) in floppy_release() argument
1026 struct floppy_state *fs = disk->private_data; in floppy_release()
1042 static unsigned int floppy_check_events(struct gendisk *disk, in floppy_check_events() argument
1045 struct floppy_state *fs = disk->private_data; in floppy_check_events()
1049 static int floppy_revalidate(struct gendisk *disk) in floppy_revalidate() argument
1051 struct floppy_state *fs = disk->private_data; in floppy_revalidate()
1210 struct gendisk *disk; in swim3_attach() local
[all …]
Dbrd.c418 struct gendisk *disk; in brd_alloc() local
441 disk = brd->brd_disk = alloc_disk(max_part); in brd_alloc()
442 if (!disk) in brd_alloc()
444 disk->major = RAMDISK_MAJOR; in brd_alloc()
445 disk->first_minor = i * max_part; in brd_alloc()
446 disk->fops = &brd_fops; in brd_alloc()
447 disk->private_data = brd; in brd_alloc()
448 disk->queue = brd->brd_queue; in brd_alloc()
449 disk->flags = GENHD_FL_EXT_DEVT; in brd_alloc()
450 sprintf(disk->disk_name, "ram%d", i); in brd_alloc()
[all …]
/drivers/ide/
Dide-gd.c33 static struct ide_disk_obj *ide_disk_get(struct gendisk *disk) in ide_disk_get() argument
38 idkp = ide_drv_g(disk, ide_disk_obj); in ide_disk_get()
69 struct gendisk *g = idkp->disk; in ide_gd_remove()
85 struct gendisk *g = idkp->disk; in ide_disk_release()
185 struct gendisk *disk = bdev->bd_disk; local
190 idkp = ide_disk_get(disk);
204 ret = drive->disk_ops->init_media(drive, disk);
226 drive->disk_ops->set_doorlock(drive, disk, 1);
253 static void ide_gd_release(struct gendisk *disk, fmode_t mode) argument
255 struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj);
[all …]
Dide-tape.c143 struct gendisk *disk; member
231 static struct ide_tape_obj *ide_tape_get(struct gendisk *disk, bool cdev, in ide_tape_get() argument
241 tape = ide_drv_g(disk, ide_tape_obj); in ide_tape_get()
686 struct gendisk *disk = tape->disk; in idetape_wait_ready() local
693 if (ide_do_test_unit_ready(drive, disk) == 0) in idetape_wait_ready()
700 ide_do_start_stop(drive, disk, IDETAPE_LU_LOAD_MASK); in idetape_wait_ready()
718 rc = ide_queue_pc_tail(drive, tape->disk, &pc, NULL, 0); in idetape_flush_tape_buffers()
738 if (ide_queue_pc_tail(drive, tape->disk, &pc, buf, pc.req_xfer)) in ide_tape_read_position()
806 struct gendisk *disk = tape->disk; in idetape_position_tape() local
814 ret = ide_queue_pc_tail(drive, disk, &pc, NULL, 0); in idetape_position_tape()
[all …]
Dide-floppy_ioctl.c54 if (ide_queue_pc_tail(drive, floppy->disk, pc, pc_buf, pc->req_xfer)) { in ide_floppy_get_format_capacities()
130 if (ide_queue_pc_tail(drive, floppy->disk, pc, buf, pc->req_xfer)) in ide_floppy_get_sfrp_bit()
179 if (ide_queue_pc_tail(drive, floppy->disk, pc, buf, pc->req_xfer)) in ide_floppy_format_unit()
208 if (ide_queue_pc_tail(drive, floppy->disk, pc, sense_buf, in ide_floppy_get_format_progress()
240 struct gendisk *disk = floppy->disk; in ide_floppy_lockdoor() local
246 ide_set_media_lock(drive, disk, prevent); in ide_floppy_lockdoor()
249 ide_do_start_stop(drive, disk, 2); in ide_floppy_lockdoor()
/drivers/md/
Ddm-era-target.c194 struct superblock_disk *disk = dm_block_data(b); in sb_prepare_for_write() local
196 disk->blocknr = cpu_to_le64(dm_block_location(b)); in sb_prepare_for_write()
197 disk->csum = cpu_to_le32(dm_bm_checksum(&disk->flags, in sb_prepare_for_write()
202 static int check_metadata_version(struct superblock_disk *disk) in check_metadata_version() argument
204 uint32_t metadata_version = le32_to_cpu(disk->version); in check_metadata_version()
218 struct superblock_disk *disk = dm_block_data(b); in sb_check() local
221 if (dm_block_location(b) != le64_to_cpu(disk->blocknr)) { in sb_check()
223 le64_to_cpu(disk->blocknr), in sb_check()
228 if (le64_to_cpu(disk->magic) != SUPERBLOCK_MAGIC) { in sb_check()
230 le64_to_cpu(disk->magic), in sb_check()
[all …]
/drivers/block/drbd/
Ddrbd_state.c139 device_state_change->disk_state[OLD] = device->state.disk; in remember_old_state()
190 device_state_change->disk_state[NEW] = device->state.disk; in remember_new_state()
315 if (device->state.disk != D_DISKLESS || in conn_all_vols_unconf()
388 disk_state = max_t(enum drbd_disk_state, disk_state, device->state.disk); in conn_highest_disk()
404 disk_state = min_t(enum drbd_disk_state, disk_state, device->state.disk); in conn_lowest_disk()
486 (os.disk != D_FAILED && ns.disk == D_FAILED))) || in cl_wide_st_chg()
687 return drbd_req_state(device, NS(disk, D_FAILED), in request_detach()
701 device->state.disk != D_FAILED); in drbd_request_detach_interruptible()
734 drbd_disk_str(ns.disk), in print_st()
774 if (ns.disk != os.disk && flags & CS_DC_DISK) in print_state_change()
[all …]
/drivers/nvdimm/
Dblk.c243 static void nd_blk_release_disk(void *disk) in nd_blk_release_disk() argument
245 del_gendisk(disk); in nd_blk_release_disk()
246 put_disk(disk); in nd_blk_release_disk()
254 struct gendisk *disk; in nsblk_attach_disk() local
272 disk = alloc_disk(0); in nsblk_attach_disk()
273 if (!disk) in nsblk_attach_disk()
276 disk->first_minor = 0; in nsblk_attach_disk()
277 disk->fops = &nd_blk_fops; in nsblk_attach_disk()
278 disk->queue = q; in nsblk_attach_disk()
279 disk->flags = GENHD_FL_EXT_DEVT; in nsblk_attach_disk()
[all …]
Dpmem.c297 del_gendisk(pmem->disk); in pmem_release_disk()
298 put_disk(pmem->disk); in pmem_release_disk()
316 struct gendisk *disk; in pmem_attach_disk() local
395 disk = alloc_disk_node(0, nid); in pmem_attach_disk()
396 if (!disk) in pmem_attach_disk()
398 pmem->disk = disk; in pmem_attach_disk()
400 disk->fops = &pmem_fops; in pmem_attach_disk()
401 disk->queue = q; in pmem_attach_disk()
402 disk->flags = GENHD_FL_EXT_DEVT; in pmem_attach_disk()
403 nvdimm_namespace_disk_name(ndns, disk->disk_name); in pmem_attach_disk()
[all …]
/drivers/sbus/char/
Djsflash.c587 struct gendisk *disk = alloc_disk(1); in jsfd_init() local
588 if (!disk) in jsfd_init()
590 disk->queue = blk_init_queue(jsfd_do_request, &lock); in jsfd_init()
591 if (!disk->queue) { in jsfd_init()
592 put_disk(disk); in jsfd_init()
595 blk_queue_bounce_limit(disk->queue, BLK_BOUNCE_HIGH); in jsfd_init()
596 jsfd_disk[i] = disk; in jsfd_init()
605 struct gendisk *disk = jsfd_disk[i]; in jsfd_init() local
610 disk->major = JSFD_MAJOR; in jsfd_init()
611 disk->first_minor = i; in jsfd_init()
[all …]
/drivers/scsi/osd/
Dosd_uld.c89 struct gendisk *disk; member
407 oud->disk ? oud->disk->disk_name : NULL); in __remove()
409 if (oud->disk) in __remove()
410 put_disk(oud->disk); in __remove()
418 struct gendisk *disk; in osd_probe() local
463 disk = alloc_disk(1); in osd_probe()
464 if (!disk) { in osd_probe()
468 disk->major = SCSI_OSD_MAJOR; in osd_probe()
469 disk->first_minor = oud->minor; in osd_probe()
470 sprintf(disk->disk_name, "osd%d", oud->minor); in osd_probe()
[all …]
/drivers/s390/block/
Dxpram.c368 struct gendisk *disk = xpram_disks[i]; in xpram_setup_blkdev() local
373 disk->major = XPRAM_MAJOR; in xpram_setup_blkdev()
374 disk->first_minor = i; in xpram_setup_blkdev()
375 disk->fops = &xpram_devops; in xpram_setup_blkdev()
376 disk->private_data = &xpram_devices[i]; in xpram_setup_blkdev()
377 disk->queue = xpram_queues[i]; in xpram_setup_blkdev()
378 sprintf(disk->disk_name, "slram%d", i); in xpram_setup_blkdev()
379 set_capacity(disk, xpram_sizes[i] << 1); in xpram_setup_blkdev()
380 add_disk(disk); in xpram_setup_blkdev()
/drivers/block/zram/
Dzram_drv.c937 zram->debugfs_dir = debugfs_create_dir(zram->disk->disk_name, in zram_debugfs_register()
1157 zram->mem_pool = zs_create_pool(zram->disk->disk_name); in zram_meta_alloc()
1519 struct request_queue *q = zram->disk->queue; in zram_bvec_rw()
1523 &zram->disk->part0); in zram_bvec_rw()
1534 generic_end_io_acct(q, rw_acct, &zram->disk->part0, start_time); in zram_bvec_rw()
1703 set_capacity(zram->disk, 0); in zram_reset_device()
1704 part_stat_set_all(&zram->disk->part0, 0); in zram_reset_device()
1749 set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT); in disksize_store()
1751 revalidate_disk(zram->disk); in disksize_store()
1779 bdev = bdget_disk(zram->disk, 0); in reset_store()
[all …]

1234567