From: Linus Torvalds Date: Thu, 12 Sep 2013 17:12:47 +0000 (-0700) Subject: vfs: move get_fs_root_and_pwd() to single caller X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5762482f5496cb1dd86acd2aace3ea25d1404e1f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git vfs: move get_fs_root_and_pwd() to single caller Let's not pollute the include files with inline functions that are only used in a single place. Especially not if we decide we might want to change the semantics of said function to make it more efficient.. Signed-off-by: Linus Torvalds --- diff --git a/fs/dcache.c b/fs/dcache.c index f3dcc6351a16..4df68e27cbc7 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -3015,6 +3015,17 @@ Elong: return ERR_PTR(-ENAMETOOLONG); } +static inline void get_fs_root_and_pwd(struct fs_struct *fs, struct path *root, + struct path *pwd) +{ + spin_lock(&fs->lock); + *root = fs->root; + path_get(root); + *pwd = fs->pwd; + path_get(pwd); + spin_unlock(&fs->lock); +} + /* * NOTE! The user-level library version returns a * character pointer. The kernel system call just diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h index 2b93a9a5a1e6..0efc3e62843a 100644 --- a/include/linux/fs_struct.h +++ b/include/linux/fs_struct.h @@ -39,17 +39,6 @@ static inline void get_fs_pwd(struct fs_struct *fs, struct path *pwd) spin_unlock(&fs->lock); } -static inline void get_fs_root_and_pwd(struct fs_struct *fs, struct path *root, - struct path *pwd) -{ - spin_lock(&fs->lock); - *root = fs->root; - path_get(root); - *pwd = fs->pwd; - path_get(pwd); - spin_unlock(&fs->lock); -} - extern bool current_chrooted(void); #endif /* _LINUX_FS_STRUCT_H */