diff options
| author | Tejun Heo <tj@kernel.org> | 2013-09-11 23:19:13 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-26 18:33:18 -0400 |
| commit | 388975cccaaf11abd47525f664c76891c440481a (patch) | |
| tree | 597308874997808e7621ab4a56f0b1fd201e8639 /fs/sysfs/file.c | |
| parent | cb26a311578e67769e92a39a0a63476533cb7e12 (diff) | |
sysfs: clean up sysfs_get_dirent()
The pre-existing sysfs interfaces which take explicit namespace
argument are weird in that they place the optional @ns in front of
@name which is contrary to the established convention. For example,
we end up forcing vast majority of sysfs_get_dirent() users to do
sysfs_get_dirent(parent, NULL, name), which is silly and error-prone
especially as @ns and @name may be interchanged without causing
compilation warning.
This renames sysfs_get_dirent() to sysfs_get_dirent_ns() and swap the
positions of @name and @ns, and sysfs_get_dirent() is now a wrapper
around sysfs_get_dirent_ns(). This makes confusions a lot less
likely.
There are other interfaces which take @ns before @name. They'll be
updated by following patches.
This patch doesn't introduce any functional changes.
v2: EXPORT_SYMBOL_GPL() wasn't updated leading to undefined symbol
error on module builds. Reported by build test robot. Fixed.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Kay Sievers <kay@vrfy.org>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/sysfs/file.c')
| -rw-r--r-- | fs/sysfs/file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index e784340f1599..0f3214a70985 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c | |||
| @@ -563,7 +563,7 @@ int sysfs_add_file_to_group(struct kobject *kobj, | |||
| 563 | int error; | 563 | int error; |
| 564 | 564 | ||
| 565 | if (group) | 565 | if (group) |
| 566 | dir_sd = sysfs_get_dirent(kobj->sd, NULL, group); | 566 | dir_sd = sysfs_get_dirent(kobj->sd, group); |
| 567 | else | 567 | else |
| 568 | dir_sd = sysfs_get(kobj->sd); | 568 | dir_sd = sysfs_get(kobj->sd); |
| 569 | 569 | ||
| @@ -645,7 +645,7 @@ void sysfs_remove_file_from_group(struct kobject *kobj, | |||
| 645 | struct sysfs_dirent *dir_sd; | 645 | struct sysfs_dirent *dir_sd; |
| 646 | 646 | ||
| 647 | if (group) | 647 | if (group) |
| 648 | dir_sd = sysfs_get_dirent(kobj->sd, NULL, group); | 648 | dir_sd = sysfs_get_dirent(kobj->sd, group); |
| 649 | else | 649 | else |
| 650 | dir_sd = sysfs_get(kobj->sd); | 650 | dir_sd = sysfs_get(kobj->sd); |
| 651 | if (dir_sd) { | 651 | if (dir_sd) { |
