Skip to content

Commit 1695b87

Browse files
WANG CongJens Axboe
authored andcommitted
nbd: replace sysfs_create_file() with device_create_file()
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>
1 parent 25ac0c2 commit 1695b87

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎drivers/block/nbd.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,17 +406,17 @@ static int nbd_do_it(struct nbd_device *lo)
406406
BUG_ON(lo->magic != LO_MAGIC);
407407

408408
lo->pid = task_pid_nr(current);
409-
ret = sysfs_create_file(&disk_to_dev(lo->disk)->kobj, &pid_attr.attr);
409+
ret = device_create_file(disk_to_dev(lo->disk), &pid_attr);
410410
if (ret) {
411-
printk(KERN_ERR "nbd: sysfs_create_file failed!");
411+
printk(KERN_ERR "nbd: device_create_file failed!");
412412
lo->pid = 0;
413413
return ret;
414414
}
415415

416416
while ((req = nbd_read_stat(lo)) != NULL)
417417
nbd_end_request(req);
418418

419-
sysfs_remove_file(&disk_to_dev(lo->disk)->kobj, &pid_attr.attr);
419+
device_remove_file(disk_to_dev(lo->disk), &pid_attr);
420420
lo->pid = 0;
421421
return 0;
422422
}

0 commit comments

Comments
 (0)