Lines Matching defs: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)
20 spin_lock(&fs->lock);
21 write_seqcount_begin(&fs->seq);
22 old_root = fs->root;
23 fs->root = *path;
24 write_seqcount_end(&fs->seq);
25 spin_unlock(&fs->lock);
31 * Replace the fs->{pwdmnt,pwd} with {mnt,dentry}. Put the old values.
34 void set_fs_pwd(struct fs_struct *fs, const struct path *path)
39 spin_lock(&fs->lock);
40 write_seqcount_begin(&fs->seq);
41 old_pwd = fs->pwd;
42 fs->pwd = *path;
43 write_seqcount_end(&fs->seq);
44 spin_unlock(&fs->lock);
61 struct fs_struct *fs;
67 fs = p->fs;
68 if (fs) {
70 spin_lock(&fs->lock);
71 write_seqcount_begin(&fs->seq);
72 hits += replace_path(&fs->root, old_root, new_root);
73 hits += replace_path(&fs->pwd, old_root, new_root);
74 write_seqcount_end(&fs->seq);
79 spin_unlock(&fs->lock);
88 void free_fs_struct(struct fs_struct *fs)
90 path_put(&fs->root);
91 path_put(&fs->pwd);
92 kmem_cache_free(fs_cachep, fs);
97 struct fs_struct *fs = tsk->fs;
99 if (fs) {
102 spin_lock(&fs->lock);
103 tsk->fs = NULL;
104 kill = !--fs->users;
105 spin_unlock(&fs->lock);
108 free_fs_struct(fs);
114 struct fs_struct *fs = kmem_cache_alloc(fs_cachep, GFP_KERNEL);
115 /* We don't need to lock fs - think why ;-) */
116 if (fs) {
117 fs->users = 1;
118 fs->in_exec = 0;
119 spin_lock_init(&fs->lock);
120 seqcount_spinlock_init(&fs->seq, &fs->lock);
121 fs->umask = old->umask;
124 fs->root = old->root;
125 path_get(&fs->root);
126 fs->pwd = old->pwd;
127 path_get(&fs->pwd);
130 return fs;
135 struct fs_struct *fs = current->fs;
136 struct fs_struct *new_fs = copy_fs_struct(fs);
143 spin_lock(&fs->lock);
144 kill = !--fs->users;
145 current->fs = new_fs;
146 spin_unlock(&fs->lock);
150 free_fs_struct(fs);
158 return current->fs->umask;