diff --git a/fs/mount/fs_mount.c b/fs/mount/fs_mount.c index 34b7f26c993fcadc71ad97b862e119a03d7784a7..0e1c5852c8ad2d404f0ebfc4a2d5b03e5d3f6acb 100755 --- a/fs/mount/fs_mount.c +++ b/fs/mount/fs_mount.c @@ -220,7 +220,7 @@ int mount(const char *source, const char *target, errcode = -EINVAL; goto errout_with_lock; } - if (mountpt_vnode->flag & VNODE_FLAG_MOUNT_ORIGIN) + if (mountpt_vnode->flag & VNODE_FLAG_MOUNT_NEW) { PRINT_ERR("can't mount to %s, already mounted.\n", target); errcode = -EINVAL; @@ -280,8 +280,8 @@ int mount(const char *source, const char *target, #endif goto errout_with_mountpt; } - mnt->vnodeBeCovered->flag |= VNODE_FLAG_MOUNT_NEW; - mnt->vnodeCovered->flag |= VNODE_FLAG_MOUNT_ORIGIN; + mnt->vnodeBeCovered->flag |= VNODE_FLAG_MOUNT_ORIGIN; + mnt->vnodeCovered->flag |= VNODE_FLAG_MOUNT_NEW; mnt->ops = mops; mnt->mountFlags = mountflags; ret = strcpy_s(mnt->pathName, PATH_MAX, target); diff --git a/fs/mount/fs_umount.c b/fs/mount/fs_umount.c index ede3b3656f80c1bda4ea9f9f7800a3a79e588072..c3688250869f3fb35f3f54de7d63b9add728b219 100755 --- a/fs/mount/fs_umount.c +++ b/fs/mount/fs_umount.c @@ -82,7 +82,7 @@ BOOL fs_in_use(struct Mount *mnt, const char *target) return TRUE; } } - return VnodeInUseIter(mnt->vnodeCovered); + return VnodeInUseIter(mnt); } int umount(const char *target) @@ -113,7 +113,7 @@ int umount(const char *target) goto errout; } /* Verify that the vnode is a mountpoint */ - if (!mountpt_vnode || !(mountpt_vnode->flag & VNODE_FLAG_MOUNT_ORIGIN)) + if (!mountpt_vnode || !(mountpt_vnode->flag & VNODE_FLAG_MOUNT_NEW)) { ret = -EINVAL; goto errout; @@ -127,7 +127,7 @@ int umount(const char *target) goto errout; } covered_vnode = mnt->vnodeBeCovered; - if (!covered_vnode || !(covered_vnode->flag & VNODE_FLAG_MOUNT_NEW)) + if (!covered_vnode || !(covered_vnode->flag & VNODE_FLAG_MOUNT_ORIGIN)) { ret = -EINVAL; goto errout; @@ -191,7 +191,7 @@ int umount(const char *target) } #endif covered_vnode->newMount = NULL; - covered_vnode->flag &= ~(VNODE_FLAG_MOUNT_NEW); + covered_vnode->flag &= ~(VNODE_FLAG_MOUNT_ORIGIN); VnodeDrop(); return OK; diff --git a/fs/vfs/fs_rename.c b/fs/vfs/fs_rename.c index 31aac41b4c723958ae0e006e4aef9505fb530c37..711bb2c1a53c3989e5059eb3e85888c2d8ed6ebf 100644 --- a/fs/vfs/fs_rename.c +++ b/fs/vfs/fs_rename.c @@ -86,13 +86,13 @@ static int check_rename_target(struct Vnode *old_vnode, struct Vnode *old_parent { return -EXDEV; } - if ((old_vnode->flag & VNODE_FLAG_MOUNT_NEW) - || (old_vnode->flag & VNODE_FLAG_MOUNT_ORIGIN)) + if ((old_vnode->flag & VNODE_FLAG_MOUNT_ORIGIN) + || (old_vnode->flag & VNODE_FLAG_MOUNT_NEW)) { return -EBUSY; } - if (new_vnode != NULL && ((new_vnode->flag & VNODE_FLAG_MOUNT_NEW) - || (new_vnode->flag & VNODE_FLAG_MOUNT_ORIGIN))) + if (new_vnode != NULL && ((new_vnode->flag & VNODE_FLAG_MOUNT_ORIGIN) + || (new_vnode->flag & VNODE_FLAG_MOUNT_NEW))) { return -EBUSY; } diff --git a/fs/vfs/fs_rmdir.c b/fs/vfs/fs_rmdir.c index d2ee890b50e54dd4d94db458bb5d0b31c23150eb..658285f1573b864c770b03c8f8ae567b94117236 100644 --- a/fs/vfs/fs_rmdir.c +++ b/fs/vfs/fs_rmdir.c @@ -68,8 +68,8 @@ static int check_target(struct Vnode *vnode, char *name) { return -EBUSY; } - if ((vnode->flag & VNODE_FLAG_MOUNT_NEW) - || (vnode->flag & VNODE_FLAG_MOUNT_ORIGIN)) + if ((vnode->flag & VNODE_FLAG_MOUNT_ORIGIN) + || (vnode->flag & VNODE_FLAG_MOUNT_NEW)) { return -EBUSY; }