• Home
  • Raw
  • Download

Lines Matching refs:disk

801 		bd_unlink_disk_holder(ca->bdev, d->disk);  in bcache_device_unlink()
811 bd_link_disk_holder(ca->bdev, d->disk); in bcache_device_link()
874 struct gendisk *disk = d->disk; in bcache_device_free() local
878 if (disk) in bcache_device_free()
879 pr_info("%s stopped\n", disk->disk_name); in bcache_device_free()
886 if (disk) { in bcache_device_free()
887 bool disk_added = (disk->flags & GENHD_FL_UP) != 0; in bcache_device_free()
890 del_gendisk(disk); in bcache_device_free()
892 if (disk->queue) in bcache_device_free()
893 blk_cleanup_queue(disk->queue); in bcache_device_free()
896 first_minor_to_idx(disk->first_minor)); in bcache_device_free()
898 put_disk(disk); in bcache_device_free()
950 d->disk = alloc_disk(BCACHE_MINORS); in bcache_device_init()
951 if (!d->disk) in bcache_device_init()
954 set_capacity(d->disk, sectors); in bcache_device_init()
955 snprintf(d->disk->disk_name, DISK_NAME_LEN, "bcache%i", idx); in bcache_device_init()
957 d->disk->major = bcache_major; in bcache_device_init()
958 d->disk->first_minor = idx_to_first_minor(idx); in bcache_device_init()
959 d->disk->fops = ops; in bcache_device_init()
960 d->disk->private_data = d; in bcache_device_init()
966 d->disk->queue = q; in bcache_device_init()
983 d->disk->disk_name, q->limits.logical_block_size, in bcache_device_init()
990 blk_queue_flag_set(QUEUE_FLAG_NONROT, d->disk->queue); in bcache_device_init()
991 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, d->disk->queue); in bcache_device_init()
992 blk_queue_flag_set(QUEUE_FLAG_DISCARD, d->disk->queue); in bcache_device_init()
1046 dc->disk.name); in cached_dev_status_update()
1050 bcache_device_stop(&dc->disk); in cached_dev_status_update()
1063 struct bcache_device *d = &dc->disk; in bch_cached_dev_run()
1101 add_disk(d->disk); in bch_cached_dev_run()
1102 bd_link_disk_holder(dc->bdev, dc->disk.disk); in bch_cached_dev_run()
1107 kobject_uevent_env(&disk_to_dev(d->disk)->kobj, KOBJ_CHANGE, env); in bch_cached_dev_run()
1112 if (sysfs_create_link(&d->kobj, &disk_to_dev(d->disk)->kobj, "dev") || in bch_cached_dev_run()
1113 sysfs_create_link(&disk_to_dev(d->disk)->kobj, in bch_cached_dev_run()
1141 &dc->disk.flags)) in cancel_writeback_rate_update_dwork()
1160 BUG_ON(!test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags)); in cached_dev_detach_finish()
1164 if (test_and_clear_bit(BCACHE_DEV_WB_RUNNING, &dc->disk.flags)) in cached_dev_detach_finish()
1180 calc_cached_dev_sectors(dc->disk.c); in cached_dev_detach_finish()
1181 bcache_device_detach(&dc->disk); in cached_dev_detach_finish()
1184 clear_bit(BCACHE_DEV_DETACHING, &dc->disk.flags); in cached_dev_detach_finish()
1185 clear_bit(BCACHE_DEV_UNLINK_DONE, &dc->disk.flags); in cached_dev_detach_finish()
1192 closure_put(&dc->disk.cl); in cached_dev_detach_finish()
1199 if (test_bit(BCACHE_DEV_CLOSING, &dc->disk.flags)) in bch_cached_dev_detach()
1202 if (test_and_set_bit(BCACHE_DEV_DETACHING, &dc->disk.flags)) in bch_cached_dev_detach()
1209 closure_get(&dc->disk.cl); in bch_cached_dev_detach()
1228 if (dc->disk.c) { in bch_cached_dev_attach()
1307 bcache_device_attach(&dc->disk, c, u - c->uuids); in bch_cached_dev_attach()
1323 dc->disk.disk->disk_name); in bch_cached_dev_attach()
1332 bch_sectors_dirty_init(&dc->disk); in bch_cached_dev_attach()
1350 bcache_device_link(&dc->disk, c, "bdev"); in bch_cached_dev_attach()
1356 set_disk_ro(dc->disk.disk, 1); in bch_cached_dev_attach()
1364 dc->disk.disk->disk_name, in bch_cached_dev_attach()
1365 dc->disk.c->set_uuid); in bch_cached_dev_attach()
1373 disk.kobj); in bch_cached_dev_release()
1380 struct cached_dev *dc = container_of(cl, struct cached_dev, disk.cl); in cached_dev_free()
1382 if (test_and_clear_bit(BCACHE_DEV_WB_RUNNING, &dc->disk.flags)) in cached_dev_free()
1393 bd_unlink_disk_holder(dc->bdev, dc->disk.disk); in cached_dev_free()
1394 bcache_device_free(&dc->disk); in cached_dev_free()
1407 kobject_put(&dc->disk.kobj); in cached_dev_free()
1412 struct cached_dev *dc = container_of(cl, struct cached_dev, disk.cl); in cached_dev_flush()
1413 struct bcache_device *d = &dc->disk; in cached_dev_flush()
1433 closure_init(&dc->disk.cl, NULL); in cached_dev_init()
1434 set_closure_fn(&dc->disk.cl, cached_dev_flush, system_wq); in cached_dev_init()
1435 kobject_init(&dc->disk.kobj, &bch_cached_dev_ktype); in cached_dev_init()
1440 bch_cache_accounting_init(&dc->accounting, &dc->disk.cl); in cached_dev_init()
1449 dc->disk.stripe_size = q->limits.io_opt >> 9; in cached_dev_init()
1451 if (dc->disk.stripe_size) in cached_dev_init()
1455 ret = bcache_device_init(&dc->disk, block_size, in cached_dev_init()
1461 blk_queue_io_opt(dc->disk.disk->queue, in cached_dev_init()
1462 max(queue_io_opt(dc->disk.disk->queue), queue_io_opt(q))); in cached_dev_init()
1495 if (kobject_add(&dc->disk.kobj, &part_to_dev(bdev->bd_part)->kobj, in register_bdev()
1498 if (bch_cache_accounting_add_kobjs(&dc->accounting, &dc->disk.kobj)) in register_bdev()
1519 bcache_device_stop(&dc->disk); in register_bdev()
1575 add_disk(d->disk); in flash_dev_run()
1577 if (kobject_add(&d->kobj, &disk_to_dev(d->disk)->kobj, "bcache")) in flash_dev_run()
1585 set_disk_ro(d->disk, 1); in flash_dev_run()
1638 if (!dc || test_bit(BCACHE_DEV_CLOSING, &dc->disk.flags)) in bch_cached_dev_error()
1646 dc->disk.disk->disk_name, dc->backing_dev_name); in bch_cached_dev_error()
1648 bcache_device_stop(&dc->disk); in bch_cached_dev_error()
1802 d->disk->disk_name, c->set_uuid); in conditional_stop_bcache_device()
1810 d->disk->disk_name); in conditional_stop_bcache_device()
1832 d->disk->disk_name); in conditional_stop_bcache_device()
1852 dc = container_of(d, struct cached_dev, disk); in __cache_set_unregister()
2730 bcache_device_stop(&pdev->dc->disk); in bch_pending_bdevs_cleanup()
2791 bcache_device_stop(&dc->disk); in bcache_reboot()