diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2010-08-13 19:59:15 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2010-08-13 19:59:15 -0400 |
commit | 7d72e6fa56c4100b9669efe0044f77ed9eb785a1 (patch) | |
tree | 5e90bf4969809a1ab20b97432b85be20ccfaa1f4 /include/linux/fs_struct.h | |
parent | ba00376b0b13f234d839541a7b36a5bf5c2a4036 (diff) | |
parent | 2be1f3a73dd02e38e181cf5abacb3d45a6a2d6b8 (diff) |
Merge branch 'master' into for-linus
Diffstat (limited to 'include/linux/fs_struct.h')
-rw-r--r-- | include/linux/fs_struct.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h index 78a05bfcd8eb..eca3d5202138 100644 --- a/include/linux/fs_struct.h +++ b/include/linux/fs_struct.h | |||
@@ -21,4 +21,31 @@ extern void free_fs_struct(struct fs_struct *); | |||
21 | extern void daemonize_fs_struct(void); | 21 | extern void daemonize_fs_struct(void); |
22 | extern int unshare_fs_struct(void); | 22 | extern int unshare_fs_struct(void); |
23 | 23 | ||
24 | static inline void get_fs_root(struct fs_struct *fs, struct path *root) | ||
25 | { | ||
26 | read_lock(&fs->lock); | ||
27 | *root = fs->root; | ||
28 | path_get(root); | ||
29 | read_unlock(&fs->lock); | ||
30 | } | ||
31 | |||
32 | static inline void get_fs_pwd(struct fs_struct *fs, struct path *pwd) | ||
33 | { | ||
34 | read_lock(&fs->lock); | ||
35 | *pwd = fs->pwd; | ||
36 | path_get(pwd); | ||
37 | read_unlock(&fs->lock); | ||
38 | } | ||
39 | |||
40 | static inline void get_fs_root_and_pwd(struct fs_struct *fs, struct path *root, | ||
41 | struct path *pwd) | ||
42 | { | ||
43 | read_lock(&fs->lock); | ||
44 | *root = fs->root; | ||
45 | path_get(root); | ||
46 | *pwd = fs->pwd; | ||
47 | path_get(pwd); | ||
48 | read_unlock(&fs->lock); | ||
49 | } | ||
50 | |||
24 | #endif /* _LINUX_FS_STRUCT_H */ | 51 | #endif /* _LINUX_FS_STRUCT_H */ |