Merge tag 'gpio-v3.13-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
[linux-2.6.git] / include / linux / fs_struct.h
blob0efc3e62843ae74592128dc7e34bd11fbaca4a3c
1 #ifndef _LINUX_FS_STRUCT_H
2 #define _LINUX_FS_STRUCT_H
4 #include <linux/path.h>
5 #include <linux/spinlock.h>
6 #include <linux/seqlock.h>
8 struct fs_struct {
9 int users;
10 spinlock_t lock;
11 seqcount_t seq;
12 int umask;
13 int in_exec;
14 struct path root, pwd;
17 extern struct kmem_cache *fs_cachep;
19 extern void exit_fs(struct task_struct *);
20 extern void set_fs_root(struct fs_struct *, const struct path *);
21 extern void set_fs_pwd(struct fs_struct *, const struct path *);
22 extern struct fs_struct *copy_fs_struct(struct fs_struct *);
23 extern void free_fs_struct(struct fs_struct *);
24 extern int unshare_fs_struct(void);
26 static inline void get_fs_root(struct fs_struct *fs, struct path *root)
28 spin_lock(&fs->lock);
29 *root = fs->root;
30 path_get(root);
31 spin_unlock(&fs->lock);
34 static inline void get_fs_pwd(struct fs_struct *fs, struct path *pwd)
36 spin_lock(&fs->lock);
37 *pwd = fs->pwd;
38 path_get(pwd);
39 spin_unlock(&fs->lock);
42 extern bool current_chrooted(void);
44 #endif /* _LINUX_FS_STRUCT_H */