You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user