aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs_struct.h
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2011-03-09 10:15:44 -0500
committerMichal Marek <mmarek@suse.cz>2011-03-09 10:15:44 -0500
commit2d8ad8719591fa803b0d589ed057fa46f49b7155 (patch)
tree4ae051577dad1161c91dafbf4207bb10a9dc91bb /include/linux/fs_struct.h
parent9b4ce7bce5f30712fd926ab4599a803314a07719 (diff)
parentc56eb8fb6dccb83d9fe62fd4dc00c834de9bc470 (diff)
Merge commit 'v2.6.38-rc1' into kbuild/packaging
Diffstat (limited to 'include/linux/fs_struct.h')
-rw-r--r--include/linux/fs_struct.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
index 78a05bfcd8eb..003dc0fd7347 100644
--- a/include/linux/fs_struct.h
+++ b/include/linux/fs_struct.h
@@ -2,10 +2,13 @@
2#define _LINUX_FS_STRUCT_H 2#define _LINUX_FS_STRUCT_H
3 3
4#include <linux/path.h> 4#include <linux/path.h>
5#include <linux/spinlock.h>
6#include <linux/seqlock.h>
5 7
6struct fs_struct { 8struct fs_struct {
7 int users; 9 int users;
8 rwlock_t lock; 10 spinlock_t lock;
11 seqcount_t seq;
9 int umask; 12 int umask;
10 int in_exec; 13 int in_exec;
11 struct path root, pwd; 14 struct path root, pwd;
@@ -21,4 +24,31 @@ extern void free_fs_struct(struct fs_struct *);
21extern void daemonize_fs_struct(void); 24extern void daemonize_fs_struct(void);
22extern int unshare_fs_struct(void); 25extern int unshare_fs_struct(void);
23 26
27static inline void get_fs_root(struct fs_struct *fs, struct path *root)
28{
29 spin_lock(&fs->lock);
30 *root = fs->root;
31 path_get(root);
32 spin_unlock(&fs->lock);
33}
34
35static inline void get_fs_pwd(struct fs_struct *fs, struct path *pwd)
36{
37 spin_lock(&fs->lock);
38 *pwd = fs->pwd;
39 path_get(pwd);
40 spin_unlock(&fs->lock);
41}
42
43static inline void get_fs_root_and_pwd(struct fs_struct *fs, struct path *root,
44 struct path *pwd)
45{
46 spin_lock(&fs->lock);
47 *root = fs->root;
48 path_get(root);
49 *pwd = fs->pwd;
50 path_get(pwd);
51 spin_unlock(&fs->lock);
52}
53
24#endif /* _LINUX_FS_STRUCT_H */ 54#endif /* _LINUX_FS_STRUCT_H */