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