X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fsysfs%2Fsysfs.h;h=4a8c21544bdfa873cd11ba308e3977a6417f9167;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=96e390a7b99fdfa7b4697473ba3a6d1645917d39;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h index 96e390a7b..4a8c21544 100644 --- a/fs/sysfs/sysfs.h +++ b/fs/sysfs/sysfs.h @@ -11,3 +11,19 @@ extern void sysfs_hash_and_remove(struct dentry * dir, const char * name); extern int sysfs_create_subdir(struct kobject *, const char *, struct dentry **); extern void sysfs_remove_subdir(struct dentry *); + +extern int sysfs_follow_link(struct dentry *, struct nameidata *); +extern void sysfs_put_link(struct dentry *, struct nameidata *); +extern struct rw_semaphore sysfs_rename_sem; + +static inline struct kobject *sysfs_get_kobject(struct dentry *dentry) +{ + struct kobject * kobj = NULL; + + spin_lock(&dcache_lock); + if (!d_unhashed(dentry)) + kobj = kobject_get(dentry->d_fsdata); + spin_unlock(&dcache_lock); + + return kobj; +}