Lines Matching full:fs
5 #include <linux/fs.h>
12 * Replace the fs->{rootmnt,root} with {mnt,dentry}. Put the old values.
15 void set_fs_root(struct fs_struct *fs, const struct path *path) in set_fs_root() argument
20 write_seqlock(&fs->seq); in set_fs_root()
21 old_root = fs->root; in set_fs_root()
22 fs->root = *path; in set_fs_root()
23 write_sequnlock(&fs->seq); in set_fs_root()
29 * Replace the fs->{pwdmnt,pwd} with {mnt,dentry}. Put the old values.
32 void set_fs_pwd(struct fs_struct *fs, const struct path *path) in set_fs_pwd() argument
37 write_seqlock(&fs->seq); in set_fs_pwd()
38 old_pwd = fs->pwd; in set_fs_pwd()
39 fs->pwd = *path; in set_fs_pwd()
40 write_sequnlock(&fs->seq); in set_fs_pwd()
57 struct fs_struct *fs; in chroot_fs_refs() local
63 fs = p->fs; in chroot_fs_refs()
64 if (fs) { in chroot_fs_refs()
66 write_seqlock(&fs->seq); in chroot_fs_refs()
67 hits += replace_path(&fs->root, old_root, new_root); in chroot_fs_refs()
68 hits += replace_path(&fs->pwd, old_root, new_root); in chroot_fs_refs()
73 write_sequnlock(&fs->seq); in chroot_fs_refs()
82 void free_fs_struct(struct fs_struct *fs) in free_fs_struct() argument
84 path_put(&fs->root); in free_fs_struct()
85 path_put(&fs->pwd); in free_fs_struct()
86 kmem_cache_free(fs_cachep, fs); in free_fs_struct()
91 struct fs_struct *fs = tsk->fs; in exit_fs() local
93 if (fs) { in exit_fs()
96 read_seqlock_excl(&fs->seq); in exit_fs()
97 tsk->fs = NULL; in exit_fs()
98 kill = !--fs->users; in exit_fs()
99 read_sequnlock_excl(&fs->seq); in exit_fs()
102 free_fs_struct(fs); in exit_fs()
108 struct fs_struct *fs = kmem_cache_alloc(fs_cachep, GFP_KERNEL); in copy_fs_struct() local
109 /* We don't need to lock fs - think why ;-) */ in copy_fs_struct()
110 if (fs) { in copy_fs_struct()
111 fs->users = 1; in copy_fs_struct()
112 fs->in_exec = 0; in copy_fs_struct()
113 seqlock_init(&fs->seq); in copy_fs_struct()
114 fs->umask = old->umask; in copy_fs_struct()
117 fs->root = old->root; in copy_fs_struct()
118 path_get(&fs->root); in copy_fs_struct()
119 fs->pwd = old->pwd; in copy_fs_struct()
120 path_get(&fs->pwd); in copy_fs_struct()
123 return fs; in copy_fs_struct()
128 struct fs_struct *fs = current->fs; in unshare_fs_struct() local
129 struct fs_struct *new_fs = copy_fs_struct(fs); in unshare_fs_struct()
136 read_seqlock_excl(&fs->seq); in unshare_fs_struct()
137 kill = !--fs->users; in unshare_fs_struct()
138 current->fs = new_fs; in unshare_fs_struct()
139 read_sequnlock_excl(&fs->seq); in unshare_fs_struct()
143 free_fs_struct(fs); in unshare_fs_struct()
151 return current->fs->umask; in current_umask()