Lines Matching refs:dev
64 struct nfhd_device *dev = queue->queuedata; in nfhd_make_request() local
71 shift = dev->bshift; in nfhd_make_request()
75 nfhd_read_write(dev->id, 0, dir, sec >> shift, len >> shift, in nfhd_make_request()
85 struct nfhd_device *dev = bdev->bd_disk->private_data; in nfhd_getgeo() local
87 geo->cylinders = dev->blocks >> (6 - dev->bshift); in nfhd_getgeo()
101 struct nfhd_device *dev; in nfhd_init_one() local
112 dev = kmalloc(sizeof(struct nfhd_device), GFP_KERNEL); in nfhd_init_one()
113 if (!dev) in nfhd_init_one()
116 dev->id = id; in nfhd_init_one()
117 dev->blocks = blocks; in nfhd_init_one()
118 dev->bsize = bsize; in nfhd_init_one()
119 dev->bshift = ffs(bsize) - 10; in nfhd_init_one()
121 dev->queue = blk_alloc_queue(GFP_KERNEL); in nfhd_init_one()
122 if (dev->queue == NULL) in nfhd_init_one()
125 dev->queue->queuedata = dev; in nfhd_init_one()
126 blk_queue_make_request(dev->queue, nfhd_make_request); in nfhd_init_one()
127 blk_queue_logical_block_size(dev->queue, bsize); in nfhd_init_one()
129 dev->disk = alloc_disk(16); in nfhd_init_one()
130 if (!dev->disk) in nfhd_init_one()
133 dev->disk->major = major_num; in nfhd_init_one()
134 dev->disk->first_minor = dev_id * 16; in nfhd_init_one()
135 dev->disk->fops = &nfhd_ops; in nfhd_init_one()
136 dev->disk->private_data = dev; in nfhd_init_one()
137 sprintf(dev->disk->disk_name, "nfhd%u", dev_id); in nfhd_init_one()
138 set_capacity(dev->disk, (sector_t)blocks * (bsize / 512)); in nfhd_init_one()
139 dev->disk->queue = dev->queue; in nfhd_init_one()
141 add_disk(dev->disk); in nfhd_init_one()
143 list_add_tail(&dev->list, &nfhd_list); in nfhd_init_one()
148 blk_cleanup_queue(dev->queue); in nfhd_init_one()
150 kfree(dev); in nfhd_init_one()
181 struct nfhd_device *dev, *next; in nfhd_exit() local
183 list_for_each_entry_safe(dev, next, &nfhd_list, list) { in nfhd_exit()
184 list_del(&dev->list); in nfhd_exit()
185 del_gendisk(dev->disk); in nfhd_exit()
186 put_disk(dev->disk); in nfhd_exit()
187 blk_cleanup_queue(dev->queue); in nfhd_exit()
188 kfree(dev); in nfhd_exit()