1 #ifndef _LINUX_FS_STRUCT_H
2 #define _LINUX_FS_STRUCT_H
9 struct dentry * root, * pwd, * altroot;
10 struct vfsmount * rootmnt, * pwdmnt, * altrootmnt;
17 NULL, NULL, NULL, NULL, NULL, NULL \
20 extern void exit_fs(struct task_struct *);
21 extern void set_fs_altroot(void);
24 * Replace the fs->{rootmnt,root} with {mnt,dentry}. Put the old values.
25 * It can block. Requires the big lock held.
28 static inline void set_fs_root(struct fs_struct *fs,
30 struct dentry *dentry)
32 struct dentry *old_root;
33 struct vfsmount *old_rootmnt;
34 write_lock(&fs->lock);
36 old_rootmnt = fs->rootmnt;
37 fs->rootmnt = mntget(mnt);
38 fs->root = dget(dentry);
39 write_unlock(&fs->lock);
47 * Replace the fs->{pwdmnt,pwd} with {mnt,dentry}. Put the old values.
48 * It can block. Requires the big lock held.
51 static inline void set_fs_pwd(struct fs_struct *fs,
53 struct dentry *dentry)
55 struct dentry *old_pwd;
56 struct vfsmount *old_pwdmnt;
57 write_lock(&fs->lock);
59 old_pwdmnt = fs->pwdmnt;
60 fs->pwdmnt = mntget(mnt);
61 fs->pwd = dget(dentry);
62 write_unlock(&fs->lock);
69 struct fs_struct *copy_fs_struct(struct fs_struct *old);
70 void put_fs_struct(struct fs_struct *fs);