patch-2.3.99-pre7 linux/include/linux/fs_struct.h
Next file: linux/include/linux/hdlcdrv.h
Previous file: linux/include/linux/fs.h
Back to the patch index
Back to the overall index
- Lines: 26
- Date:
Fri Apr 28 22:46:37 2000
- Orig file:
v2.3.99-pre6/linux/include/linux/fs_struct.h
- Orig date:
Wed Apr 26 16:34:09 2000
diff -u --recursive --new-file v2.3.99-pre6/linux/include/linux/fs_struct.h linux/include/linux/fs_struct.h
@@ -31,8 +31,10 @@
struct vfsmount *old_rootmnt = fs->rootmnt;
fs->rootmnt = mntget(mnt);
fs->root = dget(dentry);
- dput(old_root);
- mntput(old_rootmnt);
+ if (old_root) {
+ dput(old_root);
+ mntput(old_rootmnt);
+ }
}
/*
@@ -48,8 +50,10 @@
struct vfsmount *old_pwdmnt = fs->pwdmnt;
fs->pwdmnt = mntget(mnt);
fs->pwd = dget(dentry);
- dput(old_pwd);
- mntput(old_pwdmnt);
+ if (old_pwd) {
+ dput(old_pwd);
+ mntput(old_pwdmnt);
+ }
}
struct fs_struct *copy_fs_struct(struct fs_struct *old);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)