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>
This commit is contained in:
Tejun Heo 2007-06-14 04:27:22 +09:00 committed by Greg Kroah-Hartman
parent f0b0af4792
commit 608e266a2d
10 changed files with 156 additions and 152 deletions

View file

@ -19,6 +19,7 @@ struct kobject;
struct module;
struct nameidata;
struct dentry;
struct sysfs_dirent;
/* FIXME
* The *owner field is no longer used, but leave around
@ -92,13 +93,14 @@ extern int sysfs_schedule_callback(struct kobject *kobj,
void (*func)(void *), void *data, struct module *owner);
extern int __must_check
sysfs_create_dir(struct kobject *, struct dentry *);
sysfs_create_dir(struct kobject *kobj, struct sysfs_dirent *shadow_parent_sd);
extern void
sysfs_remove_dir(struct kobject *);
extern int __must_check
sysfs_rename_dir(struct kobject *, struct dentry *, const char *new_name);
sysfs_rename_dir(struct kobject *kobj, struct sysfs_dirent *new_parent_sd,
const char *new_name);
extern int __must_check
sysfs_move_dir(struct kobject *, struct kobject *);
@ -138,8 +140,8 @@ void sysfs_notify(struct kobject * k, char *dir, char *attr);
extern int sysfs_make_shadowed_dir(struct kobject *kobj,
void * (*follow_link)(struct dentry *, struct nameidata *));
extern struct dentry *sysfs_create_shadow_dir(struct kobject *kobj);
extern void sysfs_remove_shadow_dir(struct dentry *dir);
extern struct sysfs_dirent *sysfs_create_shadow_dir(struct kobject *kobj);
extern void sysfs_remove_shadow_dir(struct sysfs_dirent *shadow_sd);
extern int __must_check sysfs_init(void);
@ -151,7 +153,8 @@ static inline int sysfs_schedule_callback(struct kobject *kobj,
return -ENOSYS;
}
static inline int sysfs_create_dir(struct kobject * k, struct dentry *shadow)
static inline int sysfs_create_dir(struct kobject *kobj,
struct sysfs_dirent *shadow_parent_sd)
{
return 0;
}
@ -161,9 +164,9 @@ static inline void sysfs_remove_dir(struct kobject * k)
;
}
static inline int sysfs_rename_dir(struct kobject * k,
struct dentry *new_parent,
const char *new_name)
static inline int sysfs_rename_dir(struct kobject *kobj,
struct sysfs_dirent *new_parent_sd,
const char *new_name)
{
return 0;
}