[PATCH 09/22] sysfs: rename internal function sysfs_add_file()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Tejun Heo
Date: Thursday, September 20, 2007 - 1:05 am

The function name sysfs_add_file() will be used for sd-based file
interface.  Rename the internal function to __sysfs_add_file().  Note
that the internal function will be removed once the new interface is
in place, so double underscore prefix should do it for the time being.

Signed-off-by: Tejun Heo <htejun@gmail.com>
---
 fs/sysfs/bin.c   |    2 +-
 fs/sysfs/file.c  |    6 +++---
 fs/sysfs/group.c |    2 +-
 fs/sysfs/sysfs.h |    4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
index 91e573f..20c2e78 100644
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@ -234,7 +234,7 @@ int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr)
 {
 	BUG_ON(!kobj || !kobj->sd || !attr);
 
-	return sysfs_add_file(kobj->sd, &attr->attr, SYSFS_KOBJ_BIN_ATTR);
+	return __sysfs_add_file(kobj->sd, &attr->attr, SYSFS_KOBJ_BIN_ATTR);
 }
 
 EXPORT_SYMBOL_GPL(sysfs_create_bin_file);
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 8154fbb..3b74912 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -568,7 +568,7 @@ const struct file_operations sysfs_file_operations = {
 };
 
 
-int sysfs_add_file(struct sysfs_dirent *dir_sd, const struct attribute *attr,
+int __sysfs_add_file(struct sysfs_dirent *dir_sd, const struct attribute *attr,
 		   int type)
 {
 	umode_t mode = attr->mode & S_IALLUGO;
@@ -602,7 +602,7 @@ int sysfs_create_file(struct kobject * kobj, const struct attribute * attr)
 {
 	BUG_ON(!kobj || !kobj->sd || !attr);
 
-	return sysfs_add_file(kobj->sd, attr, SYSFS_KOBJ_ATTR);
+	return __sysfs_add_file(kobj->sd, attr, SYSFS_KOBJ_ATTR);
 
 }
 
@@ -623,7 +623,7 @@ int sysfs_add_file_to_group(struct kobject *kobj,
 	if (!dir_sd)
 		return -ENOENT;
 
-	error = sysfs_add_file(dir_sd, attr, SYSFS_KOBJ_ATTR);
+	error = __sysfs_add_file(dir_sd, attr, SYSFS_KOBJ_ATTR);
 	sysfs_put(dir_sd);
 
 	return error;
diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c
index e4993fd..5c5aab0 100644
--- a/fs/sysfs/group.c
+++ b/fs/sysfs/group.c
@@ -32,7 +32,7 @@ static int create_files(struct sysfs_dirent *dir_sd,
 	int error = 0;
 
 	for (attr = grp->attrs; *attr && !error; attr++)
-		error = sysfs_add_file(dir_sd, *attr, SYSFS_KOBJ_ATTR);
+		error = __sysfs_add_file(dir_sd, *attr, SYSFS_KOBJ_ATTR);
 	if (error)
 		remove_files(dir_sd, grp);
 	return error;
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 82ade38..c57b2dc 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -142,8 +142,8 @@ int sysfs_hash_and_remove(struct sysfs_dirent *dir_sd, const char *name);
 extern const struct file_operations sysfs_file_operations;
 
 void sysfs_file_check_suicide(struct sysfs_dirent *sd);
-int sysfs_add_file(struct sysfs_dirent *dir_sd,
-		   const struct attribute *attr, int type);
+int __sysfs_add_file(struct sysfs_dirent *dir_sd,
+		     const struct attribute *attr, int type);
 
 /*
  * bin.c
-- 
1.5.0.3


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 05/22] sysfs: implement sysfs_find_child(), Tejun Heo, (Thu Sep 20, 1:05 am)
[PATCH 06/22] sysfs: restructure addrm helpers, Tejun Heo, (Thu Sep 20, 1:05 am)
[PATCH 01/22] sysfs: make sysfs_root a pointer, Tejun Heo, (Thu Sep 20, 1:05 am)
[PATCH 04/22] sysfs: make SYSFS_COPY_NAME a flag, Tejun Heo, (Thu Sep 20, 1:05 am)
[PATCH 09/22] sysfs: rename internal function sysfs_add_file(), Tejun Heo, (Thu Sep 20, 1:05 am)
[PATCH 14/22] sysfs: s/symlink/link/g, Tejun Heo, (Thu Sep 20, 1:05 am)
[PATCH 21/22] sysfs: kill sysfs_hash_and_remove(), Tejun Heo, (Thu Sep 20, 1:05 am)
Re: [PATCHSET 3/4] sysfs: divorce sysfs from kobject and d ..., Eric W. Biederman, (Thu Sep 27, 12:25 pm)
Re: [PATCHSET 3/4] sysfs: divorce sysfs from kobject and d ..., Eric W. Biederman, (Wed Oct 10, 6:16 am)
Re: [PATCHSET 3/4] sysfs: divorce sysfs from kobject and d ..., Eric W. Biederman, (Wed Oct 10, 2:16 pm)
Re: [PATCHSET 3/4] sysfs: divorce sysfs from kobject and d ..., Eric W. Biederman, (Tue Oct 16, 4:54 pm)