aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-06-13 15:27:22 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-11 19:09:08 -0400
commit608e266a2d4e62c1b98c1c573064b6afe8c06a58 (patch)
tree73d670ab6c315b42273bc9d2731ec2b8e7c199af /include
parentf0b0af4792d751106e2003f96af76fa95e10c68d (diff)
sysfs: make kobj point to sysfs_dirent instead of dentry
As kobj sysfs dentries and inodes are gonna be made reclaimable, dentry can't be used as naming token for sysfs file/directory, replace kobj->dentry with kobj->sd. The only external interface change is shadow directory handling. All other changes are contained in kobj and sysfs. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/kobject.h9
-rw-r--r--include/linux/sysfs.h19
2 files changed, 16 insertions, 12 deletions
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index c288e41ba331..06cbf41d32d2 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -55,7 +55,7 @@ struct kobject {
55 struct kobject * parent; 55 struct kobject * parent;
56 struct kset * kset; 56 struct kset * kset;
57 struct kobj_type * ktype; 57 struct kobj_type * ktype;
58 struct dentry * dentry; 58 struct sysfs_dirent * sd;
59 wait_queue_head_t poll; 59 wait_queue_head_t poll;
60}; 60};
61 61
@@ -71,13 +71,14 @@ extern void kobject_init(struct kobject *);
71extern void kobject_cleanup(struct kobject *); 71extern void kobject_cleanup(struct kobject *);
72 72
73extern int __must_check kobject_add(struct kobject *); 73extern int __must_check kobject_add(struct kobject *);
74extern int __must_check kobject_shadow_add(struct kobject *, struct dentry *); 74extern int __must_check kobject_shadow_add(struct kobject *kobj,
75 struct sysfs_dirent *shadow_parent);
75extern void kobject_del(struct kobject *); 76extern void kobject_del(struct kobject *);
76 77
77extern int __must_check kobject_rename(struct kobject *, const char *new_name); 78extern int __must_check kobject_rename(struct kobject *, const char *new_name);
78extern int __must_check kobject_shadow_rename(struct kobject *kobj, 79extern int __must_check kobject_shadow_rename(struct kobject *kobj,
79 struct dentry *new_parent, 80 struct sysfs_dirent *new_parent,
80 const char *new_name); 81 const char *new_name);
81extern int __must_check kobject_move(struct kobject *, struct kobject *); 82extern int __must_check kobject_move(struct kobject *, struct kobject *);
82 83
83extern int __must_check kobject_register(struct kobject *); 84extern int __must_check kobject_register(struct kobject *);
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 2a6df6444e69..4c43030fae5d 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -19,6 +19,7 @@ struct kobject;
19struct module; 19struct module;
20struct nameidata; 20struct nameidata;
21struct dentry; 21struct dentry;
22struct sysfs_dirent;
22 23
23/* FIXME 24/* FIXME
24 * The *owner field is no longer used, but leave around 25 * The *owner field is no longer used, but leave around
@@ -92,13 +93,14 @@ extern int sysfs_schedule_callback(struct kobject *kobj,
92 void (*func)(void *), void *data, struct module *owner); 93 void (*func)(void *), void *data, struct module *owner);
93 94
94extern int __must_check 95extern int __must_check
95sysfs_create_dir(struct kobject *, struct dentry *); 96sysfs_create_dir(struct kobject *kobj, struct sysfs_dirent *shadow_parent_sd);
96 97
97extern void 98extern void
98sysfs_remove_dir(struct kobject *); 99sysfs_remove_dir(struct kobject *);
99 100
100extern int __must_check 101extern int __must_check
101sysfs_rename_dir(struct kobject *, struct dentry *, const char *new_name); 102sysfs_rename_dir(struct kobject *kobj, struct sysfs_dirent *new_parent_sd,
103 const char *new_name);
102 104
103extern int __must_check 105extern int __must_check
104sysfs_move_dir(struct kobject *, struct kobject *); 106sysfs_move_dir(struct kobject *, struct kobject *);
@@ -138,8 +140,8 @@ void sysfs_notify(struct kobject * k, char *dir, char *attr);
138 140
139extern int sysfs_make_shadowed_dir(struct kobject *kobj, 141extern int sysfs_make_shadowed_dir(struct kobject *kobj,
140 void * (*follow_link)(struct dentry *, struct nameidata *)); 142 void * (*follow_link)(struct dentry *, struct nameidata *));
141extern struct dentry *sysfs_create_shadow_dir(struct kobject *kobj); 143extern struct sysfs_dirent *sysfs_create_shadow_dir(struct kobject *kobj);
142extern void sysfs_remove_shadow_dir(struct dentry *dir); 144extern void sysfs_remove_shadow_dir(struct sysfs_dirent *shadow_sd);
143 145
144extern int __must_check sysfs_init(void); 146extern int __must_check sysfs_init(void);
145 147
@@ -151,7 +153,8 @@ static inline int sysfs_schedule_callback(struct kobject *kobj,
151 return -ENOSYS; 153 return -ENOSYS;
152} 154}
153 155
154static inline int sysfs_create_dir(struct kobject * k, struct dentry *shadow) 156static inline int sysfs_create_dir(struct kobject *kobj,
157 struct sysfs_dirent *shadow_parent_sd)
155{ 158{
156 return 0; 159 return 0;
157} 160}
@@ -161,9 +164,9 @@ static inline void sysfs_remove_dir(struct kobject * k)
161 ; 164 ;
162} 165}
163 166
164static inline int sysfs_rename_dir(struct kobject * k, 167static inline int sysfs_rename_dir(struct kobject *kobj,
165 struct dentry *new_parent, 168 struct sysfs_dirent *new_parent_sd,
166 const char *new_name) 169 const char *new_name)
167{ 170{
168 return 0; 171 return 0;
169} 172}