Hi Alexander,
Looking at the comments you put next to may_umount() I implemented
maynot_umount() hopefully in the spirit of your MOUNT_REWRITE work.
Regards,
Tigran
diff -urN linux/include/linux/fs.h work/include/linux/fs.h
--- linux/include/linux/fs.h Sat Apr 29 16:06:34 2000
+++ work/include/linux/fs.h Tue May 2 19:44:53 2000
@@ -786,7 +786,7 @@
extern int register_filesystem(struct file_system_type *);
extern int unregister_filesystem(struct file_system_type *);
-extern int may_umount(struct super_block *);
+extern int maynot_umount(struct vfsmount *);
static inline int vfs_statfs(struct super_block *sb, struct statfs *buf)
{
diff -urN linux/fs/super.c work/fs/super.c
--- linux/fs/super.c Sat Apr 29 16:06:34 2000
+++ work/fs/super.c Tue May 2 19:44:42 2000
@@ -872,19 +872,18 @@
* give false negatives. The main reason why it's here is that we need
* a non-destructive way to look for easily umountable filesystems.
*/
- /* MOUNT_REWRITE: it should take vfsmount, not superblock */
-int may_umount(struct super_block *sb)
+int maynot_umount(struct vfsmount *mnt)
{
- struct dentry * root;
int count;
-
- root = sb->s_root;
+ struct dentry *root = mnt->mnt_sb->s_root;
count = d_active_refs(root);
- if (root->d_covers == root)
+ if (mnt->mnt_parent == mnt)
count--;
if (count != 2)
return -EBUSY;
+ if (root->d_inode->i_state)
+ return -EBUSY;
return 0;
}
@@ -892,7 +891,6 @@
static int do_umount(struct vfsmount *mnt, int umount_root, int flags)
{
struct super_block * sb = mnt->mnt_sb;
- int count;
if (mnt == current->fs->rootmnt && !umount_root) {
int retval = 0;
@@ -963,13 +961,7 @@
* Anything above that means that tree is busy.
*/
- count = d_active_refs(sb->s_root);
- if (mnt->mnt_parent == mnt)
- count--;
- if (count != 2)
- return -EBUSY;
-
- if (sb->s_root->d_inode->i_state)
+ if (maynot_umount(mnt))
return -EBUSY;
/* OK, that's the point of no return */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:10 EST