mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-25 16:11:45 +00:00
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>
This commit is contained in:
parent
b7c09ad401
commit
5762482f54
2 changed files with 11 additions and 11 deletions
11
fs/dcache.c
11
fs/dcache.c
|
@ -3015,6 +3015,17 @@ Elong:
|
||||||
return ERR_PTR(-ENAMETOOLONG);
|
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
|
* NOTE! The user-level library version returns a
|
||||||
* character pointer. The kernel system call just
|
* character pointer. The kernel system call just
|
||||||
|
|
|
@ -39,17 +39,6 @@ static inline void get_fs_pwd(struct fs_struct *fs, struct path *pwd)
|
||||||
spin_unlock(&fs->lock);
|
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);
|
extern bool current_chrooted(void);
|
||||||
|
|
||||||
#endif /* _LINUX_FS_STRUCT_H */
|
#endif /* _LINUX_FS_STRUCT_H */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue