diff options
author | Tejun Heo <tj@kernel.org> | 2013-11-28 23:54:14 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-11-30 05:19:16 +0400 |
commit | 7c6e2d362c19f01e6d6c8be59d83a89722032884 (patch) | |
tree | f47de0a95ae5de6016f19f949dacfe3a77326c31 /fs/sysfs/inode.c | |
parent | 45b4539309d82ae04e6ed7de494ae194ca0755aa (diff) | |
download | linux-7c6e2d362c19f01e6d6c8be59d83a89722032884.tar.xz |
sysfs, kernfs: replace sysfs_dirent->s_dir.kobj and ->s_attr.[bin_]attr with ->priv
A directory sysfs_dirent points to the associated kobj. A regular or
bin file points to the associated [bin_]attribute. This patch
replaces sysfs_dirent->s_dir.kobj and ->s_attr.[bin_]attr with void *
->priv.
This is to prepare for kernfs interface so that sysfs can specify the
private data in the same way for directories and files. This lower
debuggability but not by much - the whole thing was overlaid in a
union anyway. If debuggability becomes an issue, we can later add
->priv accessors which explicitly check for the sysfs_dirent type and
performs casting.
This patch doesn't introduce any behavior difference.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/sysfs/inode.c')
-rw-r--r-- | fs/sysfs/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 5f7e2afb3457..81cc8585b32c 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c @@ -275,7 +275,7 @@ static void sysfs_init_inode(struct sysfs_dirent *sd, struct inode *inode) inode->i_fop = &sysfs_file_operations; break; case SYSFS_KOBJ_BIN_ATTR: - bin_attr = sd->s_attr.bin_attr; + bin_attr = sd->priv; inode->i_size = bin_attr->size; inode->i_fop = &sysfs_bin_operations; break; |