From htejun@gmail.com Fri Apr 20 11:01:18 2007 From: Tejun Heo Date: Sat, 21 Apr 2007 02:08:23 +0900 Subject: [PATCH 2/4] sysfs: rename object_depth() to sysfs_path_depth() and make it global To: , , , , , , htejun@gmail.com Cc: Tejun Heo Message-ID: <1177088903647-git-send-email-htejun@gmail.com> Rename and make global. It will be used by new drop_dentry implementation. Signed-off-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman --- fs/sysfs/symlink.c | 4 ++-- fs/sysfs/sysfs.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) --- a/fs/sysfs/symlink.c +++ b/fs/sysfs/symlink.c @@ -11,7 +11,7 @@ #include "sysfs.h" -static int object_depth(struct sysfs_dirent *sd) +int sysfs_path_depth(struct sysfs_dirent *sd) { int depth = 0; @@ -123,7 +123,7 @@ static int sysfs_get_target_path(struct char * s; int depth, size; - depth = object_depth(parent_sd); + depth = sysfs_path_depth(parent_sd); size = object_path_length(target_sd) + depth * 3 - 1; if (size > PATH_MAX) return -ENAMETOOLONG; --- a/fs/sysfs/sysfs.h +++ b/fs/sysfs/sysfs.h @@ -44,6 +44,8 @@ struct sysfs_dirent { extern struct vfsmount * sysfs_mount; extern struct kmem_cache *sysfs_dir_cachep; +extern int sysfs_path_depth(struct sysfs_dirent *sd); + extern void sysfs_delete_inode(struct inode *inode); extern struct inode * sysfs_new_inode(mode_t mode, struct sysfs_dirent *); extern int sysfs_create(struct dentry *, int mode, int (*init)(struct inode *));