vfs: move get_fs_root_and_pwd() to single caller
Changes
2 files changed · +11 −11
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| fs/dcache.c | modified | +11 | −0 | View file |
| include/linux/fs_struct.h | modified | +0 | −11 | View file |
fs/dcache.c
View filediff --git a/fs/dcache.c b/fs/dcache.c
index f3dcc63..4df68e2 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
include/linux/fs_struct.h
View filediff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
index 2b93a9a..0efc3e6 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 */