Skip to content

Commit 5762482

Browse files
committed
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 <torvalds@linux-foundation.org>
1 parent b7c09ad commit 5762482

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎fs/dcache.c‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3015,6 +3015,17 @@ char *dentry_path(struct dentry *dentry, char *buf, int buflen)
30153015
return ERR_PTR(-ENAMETOOLONG);
30163016
}
30173017

3018+
static inline void get_fs_root_and_pwd(struct fs_struct *fs, struct path *root,
3019+
struct path *pwd)
3020+
{
3021+
spin_lock(&fs->lock);
3022+
*root = fs->root;
3023+
path_get(root);
3024+
*pwd = fs->pwd;
3025+
path_get(pwd);
3026+
spin_unlock(&fs->lock);
3027+
}
3028+
30183029
/*
30193030
* NOTE! The user-level library version returns a
30203031
* character pointer. The kernel system call just

‎include/linux/fs_struct.h‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,6 @@ static inline void get_fs_pwd(struct fs_struct *fs, struct path *pwd)
3939
spin_unlock(&fs->lock);
4040
}
4141

42-
static inline void get_fs_root_and_pwd(struct fs_struct *fs, struct path *root,
43-
struct path *pwd)
44-
{
45-
spin_lock(&fs->lock);
46-
*root = fs->root;
47-
path_get(root);
48-
*pwd = fs->pwd;
49-
path_get(pwd);
50-
spin_unlock(&fs->lock);
51-
}
52-
5342
extern bool current_chrooted(void);
5443

5544
#endif /* _LINUX_FS_STRUCT_H */

0 commit comments

Comments
 (0)