Commit 1695b87f authored by WANG Cong's avatar WANG Cong Committed by Jens Axboe

nbd: replace sysfs_create_file() with device_create_file()

Signed-off-by: default avatarWANG Cong <amwang@redhat.com>
Cc: Paul Clements <Paul.Clements@steeleye.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
parent 25ac0c2b
...@@ -406,9 +406,9 @@ static int nbd_do_it(struct nbd_device *lo) ...@@ -406,9 +406,9 @@ static int nbd_do_it(struct nbd_device *lo)
BUG_ON(lo->magic != LO_MAGIC); BUG_ON(lo->magic != LO_MAGIC);
lo->pid = task_pid_nr(current); lo->pid = task_pid_nr(current);
ret = sysfs_create_file(&disk_to_dev(lo->disk)->kobj, &pid_attr.attr); ret = device_create_file(disk_to_dev(lo->disk), &pid_attr);
if (ret) { if (ret) {
printk(KERN_ERR "nbd: sysfs_create_file failed!"); printk(KERN_ERR "nbd: device_create_file failed!");
lo->pid = 0; lo->pid = 0;
return ret; return ret;
} }
...@@ -416,7 +416,7 @@ static int nbd_do_it(struct nbd_device *lo) ...@@ -416,7 +416,7 @@ static int nbd_do_it(struct nbd_device *lo)
while ((req = nbd_read_stat(lo)) != NULL) while ((req = nbd_read_stat(lo)) != NULL)
nbd_end_request(req); nbd_end_request(req);
sysfs_remove_file(&disk_to_dev(lo->disk)->kobj, &pid_attr.attr); device_remove_file(disk_to_dev(lo->disk), &pid_attr);
lo->pid = 0; lo->pid = 0;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment