diff options
author | Tejun Heo <tj@kernel.org> | 2008-08-25 19:56:05 +0900 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-10-09 08:56:07 +0200 |
commit | ed9e1982347b36573cd622ee5f4e2a7ccd79b3fd (patch) | |
tree | 79d834094d655ec97cfc0a382a9207ebc8e711a5 /drivers/block/nbd.c | |
parent | 870d6656126add8e383645732b03df2b7ccd4f94 (diff) | |
download | op-kernel-dev-ed9e1982347b36573cd622ee5f4e2a7ccd79b3fd.zip op-kernel-dev-ed9e1982347b36573cd622ee5f4e2a7ccd79b3fd.tar.gz |
block: implement and use {disk|part}_to_dev()
Implement {disk|part}_to_dev() and use them to access generic device
instead of directly dereferencing {disk|part}->dev. To make sure no
user is left behind, rename generic devices fields to __dev.
This is in preparation of unifying partition 0 handling with other
partitions.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/block/nbd.c')
-rw-r--r-- | drivers/block/nbd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 1778e4a..7b33512 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -403,7 +403,7 @@ static int nbd_do_it(struct nbd_device *lo) BUG_ON(lo->magic != LO_MAGIC); lo->pid = current->pid; - ret = sysfs_create_file(&lo->disk->dev.kobj, &pid_attr.attr); + ret = sysfs_create_file(&disk_to_dev(lo->disk)->kobj, &pid_attr.attr); if (ret) { printk(KERN_ERR "nbd: sysfs_create_file failed!"); return ret; @@ -412,7 +412,7 @@ static int nbd_do_it(struct nbd_device *lo) while ((req = nbd_read_stat(lo)) != NULL) nbd_end_request(req); - sysfs_remove_file(&lo->disk->dev.kobj, &pid_attr.attr); + sysfs_remove_file(&disk_to_dev(lo->disk)->kobj, &pid_attr.attr); return 0; } |