Skip to content

Commit

Permalink
nbd: replace sysfs_create_file() with device_create_file()
Browse files Browse the repository at this point in the history
Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Paul Clements <Paul.Clements@steeleye.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
  • Loading branch information
WANG Cong authored and Jens Axboe committed Aug 19, 2011
1 parent 25ac0c2 commit 1695b87
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,17 +406,17 @@ static int nbd_do_it(struct nbd_device *lo)
BUG_ON(lo->magic != LO_MAGIC);

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) {
printk(KERN_ERR "nbd: sysfs_create_file failed!");
printk(KERN_ERR "nbd: device_create_file failed!");
lo->pid = 0;
return ret;
}

while ((req = nbd_read_stat(lo)) != NULL)
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;
return 0;
}
Expand Down

0 comments on commit 1695b87

Please sign in to comment.