aboutsummaryrefslogtreecommitdiffstats
path: root/fs/kernfs/kernfs-internal.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-12-11 14:11:53 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-11 18:28:36 -0500
commit324a56e16e44baecac3ca799fd216154145c14bf (patch)
tree4fb43421bfe884cf4e245e3a4672295bae4c7bd9 /fs/kernfs/kernfs-internal.h
parenta8b1c0193602b7ecdeaa7aa8c15c9c3da33244c8 (diff)
kernfs: s/sysfs_dirent/kernfs_node/ and rename its friends accordingly
kernfs has just been separated out from sysfs and we're already in full conflict mode. Nothing can make the situation any worse. Let's take the chance to name things properly. This patch performs the following renames. * s/sysfs_elem_dir/kernfs_elem_dir/ * s/sysfs_elem_symlink/kernfs_elem_symlink/ * s/sysfs_elem_attr/kernfs_elem_file/ * s/sysfs_dirent/kernfs_node/ * s/sd/kn/ in kernfs proper * s/parent_sd/parent/ * s/target_sd/target/ * s/dir_sd/parent/ * s/to_sysfs_dirent()/rb_to_kn()/ * misc renames of local vars when they conflict with the above Because md, mic and gpio dig into sysfs details, this patch ends up modifying them. All are sysfs_dirent renames and trivial. While we can avoid these by introducing a dummy wrapping struct sysfs_dirent around kernfs_node, given the limited usage outside kernfs and sysfs proper, I don't think such workaround is called for. This patch is strictly rename only and doesn't introduce any functional difference. - mic / gpio renames were missing. Spotted by kbuild test robot. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Neil Brown <neilb@suse.de> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Cc: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/kernfs/kernfs-internal.h')
-rw-r--r--fs/kernfs/kernfs-internal.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/fs/kernfs/kernfs-internal.h b/fs/kernfs/kernfs-internal.h
index 910e485b7333..b7ea76c6fb33 100644
--- a/fs/kernfs/kernfs-internal.h
+++ b/fs/kernfs/kernfs-internal.h
@@ -31,24 +31,24 @@ struct sysfs_inode_attrs {
31/* SYSFS_TYPE_MASK and types are defined in include/linux/kernfs.h */ 31/* SYSFS_TYPE_MASK and types are defined in include/linux/kernfs.h */
32 32
33/** 33/**
34 * kernfs_root - find out the kernfs_root a sysfs_dirent belongs to 34 * kernfs_root - find out the kernfs_root a kernfs_node belongs to
35 * @sd: sysfs_dirent of interest 35 * @kn: kernfs_node of interest
36 * 36 *
37 * Return the kernfs_root @sd belongs to. 37 * Return the kernfs_root @kn belongs to.
38 */ 38 */
39static inline struct kernfs_root *kernfs_root(struct sysfs_dirent *sd) 39static inline struct kernfs_root *kernfs_root(struct kernfs_node *kn)
40{ 40{
41 /* if parent exists, it's always a dir; otherwise, @sd is a dir */ 41 /* if parent exists, it's always a dir; otherwise, @sd is a dir */
42 if (sd->s_parent) 42 if (kn->s_parent)
43 sd = sd->s_parent; 43 kn = kn->s_parent;
44 return sd->s_dir.root; 44 return kn->s_dir.root;
45} 45}
46 46
47/* 47/*
48 * Context structure to be used while adding/removing nodes. 48 * Context structure to be used while adding/removing nodes.
49 */ 49 */
50struct sysfs_addrm_cxt { 50struct sysfs_addrm_cxt {
51 struct sysfs_dirent *removed; 51 struct kernfs_node *removed;
52}; 52};
53 53
54/* 54/*
@@ -62,10 +62,10 @@ struct sysfs_super_info {
62 struct kernfs_root *root; 62 struct kernfs_root *root;
63 63
64 /* 64 /*
65 * Each sb is associated with one namespace tag, currently the network 65 * Each sb is associated with one namespace tag, currently the
66 * namespace of the task which mounted this sysfs instance. If multiple 66 * network namespace of the task which mounted this sysfs instance.
67 * tags become necessary, make the following an array and compare 67 * If multiple tags become necessary, make the following an array
68 * sysfs_dirent tag against every entry. 68 * and compare kernfs_node tag against every entry.
69 */ 69 */
70 const void *ns; 70 const void *ns;
71}; 71};
@@ -76,7 +76,7 @@ extern struct kmem_cache *sysfs_dir_cachep;
76/* 76/*
77 * inode.c 77 * inode.c
78 */ 78 */
79struct inode *sysfs_get_inode(struct super_block *sb, struct sysfs_dirent *sd); 79struct inode *sysfs_get_inode(struct super_block *sb, struct kernfs_node *kn);
80void sysfs_evict_inode(struct inode *inode); 80void sysfs_evict_inode(struct inode *inode);
81int sysfs_permission(struct inode *inode, int mask); 81int sysfs_permission(struct inode *inode, int mask);
82int sysfs_setattr(struct dentry *dentry, struct iattr *iattr); 82int sysfs_setattr(struct dentry *dentry, struct iattr *iattr);
@@ -98,21 +98,21 @@ extern const struct dentry_operations sysfs_dentry_ops;
98extern const struct file_operations sysfs_dir_operations; 98extern const struct file_operations sysfs_dir_operations;
99extern const struct inode_operations sysfs_dir_inode_operations; 99extern const struct inode_operations sysfs_dir_inode_operations;
100 100
101struct sysfs_dirent *sysfs_get_active(struct sysfs_dirent *sd); 101struct kernfs_node *sysfs_get_active(struct kernfs_node *kn);
102void sysfs_put_active(struct sysfs_dirent *sd); 102void sysfs_put_active(struct kernfs_node *kn);
103void sysfs_addrm_start(struct sysfs_addrm_cxt *acxt); 103void sysfs_addrm_start(struct sysfs_addrm_cxt *acxt);
104int sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd, 104int sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct kernfs_node *kn,
105 struct sysfs_dirent *parent_sd); 105 struct kernfs_node *parent);
106void sysfs_addrm_finish(struct sysfs_addrm_cxt *acxt); 106void sysfs_addrm_finish(struct sysfs_addrm_cxt *acxt);
107struct sysfs_dirent *sysfs_new_dirent(struct kernfs_root *root, 107struct kernfs_node *sysfs_new_dirent(struct kernfs_root *root,
108 const char *name, umode_t mode, int type); 108 const char *name, umode_t mode, int type);
109 109
110/* 110/*
111 * file.c 111 * file.c
112 */ 112 */
113extern const struct file_operations kernfs_file_operations; 113extern const struct file_operations kernfs_file_operations;
114 114
115void sysfs_unmap_bin_file(struct sysfs_dirent *sd); 115void sysfs_unmap_bin_file(struct kernfs_node *kn);
116 116
117/* 117/*
118 * symlink.c 118 * symlink.c