[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1313572963-3440-2-git-send-email-amwang@redhat.com>
Date: Wed, 17 Aug 2011 17:22:40 +0800
From: Amerigo Wang <amwang@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: akpm@...ux-foundation.org, Greg Kroah-Hartman <gregkh@...e.de>,
WANG Cong <amwang@...hat.com>,
Paul Clements <Paul.Clements@...eleye.com>
Subject: [PATCH 2/5] nbd: replace sysfs_create_file() with device_create_file()
From: WANG Cong <amwang@...hat.com>
Signed-off-by: WANG Cong <amwang@...hat.com>
---
drivers/block/nbd.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index a928287..da98360 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -406,9 +406,9 @@ 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;
}
@@ -416,7 +416,7 @@ static int nbd_do_it(struct nbd_device *lo)
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;
}
--
1.7.4.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists