Blame view
include/linux/fs_struct.h
1.19 KB
1da177e4c
|
1 2 |
#ifndef _LINUX_FS_STRUCT_H #define _LINUX_FS_STRUCT_H |
6ac08c39a
|
3 |
#include <linux/path.h> |
c28cc3646
|
4 5 |
#include <linux/spinlock.h> #include <linux/seqlock.h> |
1da177e4c
|
6 7 |
struct fs_struct { |
498052bba
|
8 |
int users; |
2a4419b5b
|
9 |
spinlock_t lock; |
c28cc3646
|
10 |
seqcount_t seq; |
1da177e4c
|
11 |
int umask; |
498052bba
|
12 |
int in_exec; |
7f2da1e7d
|
13 |
struct path root, pwd; |
1da177e4c
|
14 |
}; |
aa362a83e
|
15 |
extern struct kmem_cache *fs_cachep; |
1da177e4c
|
16 |
extern void exit_fs(struct task_struct *); |
ac748a09f
|
17 18 |
extern void set_fs_root(struct fs_struct *, struct path *); extern void set_fs_pwd(struct fs_struct *, struct path *); |
1da177e4c
|
19 |
extern struct fs_struct *copy_fs_struct(struct fs_struct *); |
498052bba
|
20 |
extern void free_fs_struct(struct fs_struct *); |
3e93cd671
|
21 22 |
extern void daemonize_fs_struct(void); extern int unshare_fs_struct(void); |
1da177e4c
|
23 |
|
f7ad3c6be
|
24 25 |
static inline void get_fs_root(struct fs_struct *fs, struct path *root) { |
2a4419b5b
|
26 |
spin_lock(&fs->lock); |
f7ad3c6be
|
27 28 |
*root = fs->root; path_get(root); |
2a4419b5b
|
29 |
spin_unlock(&fs->lock); |
f7ad3c6be
|
30 31 32 33 |
} static inline void get_fs_pwd(struct fs_struct *fs, struct path *pwd) { |
2a4419b5b
|
34 |
spin_lock(&fs->lock); |
f7ad3c6be
|
35 36 |
*pwd = fs->pwd; path_get(pwd); |
2a4419b5b
|
37 |
spin_unlock(&fs->lock); |
f7ad3c6be
|
38 39 40 41 42 |
} static inline void get_fs_root_and_pwd(struct fs_struct *fs, struct path *root, struct path *pwd) { |
2a4419b5b
|
43 |
spin_lock(&fs->lock); |
f7ad3c6be
|
44 45 46 47 |
*root = fs->root; path_get(root); *pwd = fs->pwd; path_get(pwd); |
2a4419b5b
|
48 |
spin_unlock(&fs->lock); |
f7ad3c6be
|
49 |
} |
1da177e4c
|
50 |
#endif /* _LINUX_FS_STRUCT_H */ |