Lines Matching refs:disk
122 struct gendisk *disk; member
158 #define nbd_name(nbd) ((nbd)->disk->disk_name)
176 return disk_to_dev(nbd->disk); in nbd_to_dev()
223 struct gendisk *disk = dev_to_disk(dev); in pid_show() local
224 struct nbd_device *nbd = (struct nbd_device *)disk->private_data; in pid_show()
237 struct gendisk *disk = dev_to_disk(dev); in backend_show() local
238 struct nbd_device *nbd = (struct nbd_device *)disk->private_data; in backend_show()
250 struct gendisk *disk = nbd->disk; in nbd_dev_remove() local
252 del_gendisk(disk); in nbd_dev_remove()
253 put_disk(disk); in nbd_dev_remove()
335 nbd->disk->queue->limits.discard_granularity = blksize; in nbd_set_size()
336 blk_queue_max_discard_sectors(nbd->disk->queue, UINT_MAX); in nbd_set_size()
338 blk_queue_logical_block_size(nbd->disk->queue, blksize); in nbd_set_size()
339 blk_queue_physical_block_size(nbd->disk->queue, blksize); in nbd_set_size()
342 set_bit(GD_NEED_PART_SCAN, &nbd->disk->state); in nbd_set_size()
343 if (!set_capacity_and_notify(nbd->disk, bytesize >> 9)) in nbd_set_size()
377 dev_warn(disk_to_dev(nbd->disk), "shutting down sockets\n"); in sock_shutdown()
504 dev_err_ratelimited(disk_to_dev(nbd->disk), in sock_xmit()
575 dev_err_ratelimited(disk_to_dev(nbd->disk), in nbd_send_cmd()
633 dev_err_ratelimited(disk_to_dev(nbd->disk), in nbd_send_cmd()
674 dev_err(disk_to_dev(nbd->disk), in nbd_send_cmd()
709 dev_err(disk_to_dev(nbd->disk), in nbd_read_reply()
715 dev_err(disk_to_dev(nbd->disk), "Wrong magic (0x%lx)\n", in nbd_read_reply()
742 dev_err(disk_to_dev(nbd->disk), "Unexpected reply (%d) %p\n", in nbd_handle_reply()
751 dev_err(disk_to_dev(nbd->disk), "Suspicious reply %d (status %u flags %lu)", in nbd_handle_reply()
757 dev_err(disk_to_dev(nbd->disk), "Unexpected reply %d from different sock %d (expected %d)", in nbd_handle_reply()
763 dev_err(disk_to_dev(nbd->disk), "Double reply on req %p, cmd_cookie %u, handle cookie %u\n", in nbd_handle_reply()
769 dev_err(disk_to_dev(nbd->disk), "Command already handled %p\n", in nbd_handle_reply()
775 dev_err(disk_to_dev(nbd->disk), "Raced with timeout on req %p\n", in nbd_handle_reply()
781 dev_err(disk_to_dev(nbd->disk), "Other side returned error (%d)\n", in nbd_handle_reply()
797 dev_err(disk_to_dev(nbd->disk), "Receive data failed (result %d)\n", in nbd_handle_reply()
829 struct request_queue *q = nbd->disk->queue; in recv_work()
847 dev_err(disk_to_dev(nbd->disk), "%s: no io inflight\n", in recv_work()
905 blk_mq_quiesce_queue(nbd->disk->queue); in nbd_clear_que()
907 blk_mq_unquiesce_queue(nbd->disk->queue); in nbd_clear_que()
908 dev_dbg(disk_to_dev(nbd->disk), "queue cleared\n"); in nbd_clear_que()
922 dev_err_ratelimited(disk_to_dev(nbd->disk), in find_fallback()
945 dev_err_ratelimited(disk_to_dev(nbd->disk), in find_fallback()
979 dev_err_ratelimited(disk_to_dev(nbd->disk), in nbd_handle_cmd()
986 dev_err_ratelimited(disk_to_dev(nbd->disk), in nbd_handle_cmd()
1040 dev_err_ratelimited(disk_to_dev(nbd->disk), in nbd_handle_cmd()
1096 dev_err(disk_to_dev(nbd->disk), "Unsupported socket: shutdown callout must be supported.\n"); in nbd_get_socket()
1122 blk_mq_freeze_queue(nbd->disk->queue); in nbd_add_socket()
1131 dev_err(disk_to_dev(nbd->disk), in nbd_add_socket()
1162 blk_mq_unfreeze_queue(nbd->disk->queue); in nbd_add_socket()
1167 blk_mq_unfreeze_queue(nbd->disk->queue); in nbd_add_socket()
1235 if (disk_openers(nbd->disk) > 1) in nbd_bdev_reset()
1237 set_capacity(nbd->disk, 0); in nbd_bdev_reset()
1244 set_disk_ro(nbd->disk, true); in nbd_parse_flags()
1246 set_disk_ro(nbd->disk, false); in nbd_parse_flags()
1249 blk_queue_write_cache(nbd->disk->queue, true, true); in nbd_parse_flags()
1251 blk_queue_write_cache(nbd->disk->queue, true, false); in nbd_parse_flags()
1254 blk_queue_write_cache(nbd->disk->queue, false, false); in nbd_parse_flags()
1275 dev_err(disk_to_dev(nbd->disk), in send_disconnects()
1285 dev_info(disk_to_dev(nbd->disk), "NBD_DISCONNECT\n"); in nbd_disconnect()
1305 invalidate_disk(nbd->disk); in nbd_config_put()
1310 device_remove_file(disk_to_dev(nbd->disk), &pid_attr); in nbd_config_put()
1314 device_remove_file(disk_to_dev(nbd->disk), &backend_attr); in nbd_config_put()
1331 nbd->disk->queue->limits.discard_granularity = 0; in nbd_config_put()
1332 blk_queue_max_discard_sectors(nbd->disk->queue, 0); in nbd_config_put()
1352 dev_err(disk_to_dev(nbd->disk), "server does not support multiple connections per device.\n"); in nbd_start_device()
1361 error = device_create_file(disk_to_dev(nbd->disk), &pid_attr); in nbd_start_device()
1363 dev_err(disk_to_dev(nbd->disk), "device_create_file failed for pid!\n"); in nbd_start_device()
1411 set_bit(GD_NEED_PART_SCAN, &nbd->disk->state); in nbd_start_device_ioctl()
1446 blk_queue_rq_timeout(nbd->disk->queue, timeout * HZ); in nbd_set_cmd_timeout()
1448 blk_queue_rq_timeout(nbd->disk->queue, 30 * HZ); in nbd_set_cmd_timeout()
1594 static void nbd_release(struct gendisk *disk, fmode_t mode) in nbd_release() argument
1596 struct nbd_device *nbd = disk->private_data; in nbd_release()
1599 disk_openers(disk) == 0) in nbd_release()
1744 struct gendisk *disk; in nbd_dev_add() local
1782 disk = blk_mq_alloc_disk(&nbd->tag_set, NULL); in nbd_dev_add()
1783 if (IS_ERR(disk)) { in nbd_dev_add()
1784 err = PTR_ERR(disk); in nbd_dev_add()
1787 nbd->disk = disk; in nbd_dev_add()
1793 dev_err(disk_to_dev(nbd->disk), "Could not allocate knbd recv work queue.\n"); in nbd_dev_add()
1801 blk_queue_flag_set(QUEUE_FLAG_NONROT, disk->queue); in nbd_dev_add()
1802 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, disk->queue); in nbd_dev_add()
1803 disk->queue->limits.discard_granularity = 0; in nbd_dev_add()
1804 blk_queue_max_discard_sectors(disk->queue, 0); in nbd_dev_add()
1805 blk_queue_max_segment_size(disk->queue, UINT_MAX); in nbd_dev_add()
1806 blk_queue_max_segments(disk->queue, USHRT_MAX); in nbd_dev_add()
1807 blk_queue_max_hw_sectors(disk->queue, 65536); in nbd_dev_add()
1808 disk->queue->limits.max_sectors = 256; in nbd_dev_add()
1818 disk->major = NBD_MAJOR; in nbd_dev_add()
1819 disk->first_minor = index << part_shift; in nbd_dev_add()
1820 disk->minors = 1 << part_shift; in nbd_dev_add()
1821 disk->fops = &nbd_fops; in nbd_dev_add()
1822 disk->private_data = nbd; in nbd_dev_add()
1823 sprintf(disk->disk_name, "nbd%d", index); in nbd_dev_add()
1824 err = add_disk(disk); in nbd_dev_add()
1838 put_disk(disk); in nbd_dev_add()
2078 ret = device_create_file(disk_to_dev(nbd->disk), &backend_attr); in nbd_genl_connect()
2080 dev_err(disk_to_dev(nbd->disk), in nbd_genl_connect()