Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.24-rc6 /fs/namespace.c

Filename:/fs/namespace.c
Lines Added:23
Lines Deleted:3
Also changed in: (Previous) 2.6.24-rc5  2.6.24-rc4  2.6.24-rc3  2.6.24-rc2  2.6.24-rc1  2.6.23-git19 
(Following) 2.6.24-rc7  2.6.24-rc8  2.6.24  2.6.24-git1  2.6.24-git2  2.6.24-git3 

Location
[  2.6.24-rc6
  [  fs
     o  namespace.c

Patch

diff --git a/fs/namespace.c b/fs/namespace.c
index ddbda13..0608388 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -246,7 +246,7 @@ static struct vfsmount *clone_mnt(struct vfsmount *old, struct dentry *root,
          list_add(&mnt->mnt_slave, &old->mnt_slave_list);
          mnt->mnt_master = old;
          CLEAR_MNT_SHARED(mnt);
-      } else {
+      } else if (!(flag & CL_PRIVATE)) {
          if ((flag & CL_PROPAGATION) || IS_MNT_SHARED(old))
             list_add(&mnt->mnt_share, &old->mnt_share);
          if (IS_MNT_SLAVE(old))
@@ -746,6 +746,26 @@ Enomem:
    return NULL;
 }
 
+struct vfsmount *collect_mounts(struct vfsmount *mnt, struct dentry *dentry)
+{
+   struct vfsmount *tree;
+   down_read(&namespace_sem);
+   tree = copy_tree(mnt, dentry, CL_COPY_ALL | CL_PRIVATE);
+   up_read(&namespace_sem);
+   return tree;
+}
+
+void drop_collected_mounts(struct vfsmount *mnt)
+{
+   LIST_HEAD(umount_list);
+   down_read(&namespace_sem);
+   spin_lock(&vfsmount_lock);
+   umount_tree(mnt, 0, &umount_list);
+   spin_unlock(&vfsmount_lock);
+   up_read(&namespace_sem);
+   release_mounts(&umount_list);
+}
+
 /*
  *  @source_mnt : mount tree to be attached
  *  @nd         : place the mount tree @source_mnt is attached
@@ -1411,7 +1431,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
       mnt_flags |= MNT_RELATIME;
 
    flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE |
-         MS_NOATIME | MS_NODIRATIME | MS_RELATIME);
+         MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT);
 
    /* ... and get the mountpoint */
    retval = path_lookup(dir_name, LOOKUP_FOLLOW, &nd);
@@ -1791,7 +1811,7 @@ static void __init init_mount_tree(void)
    set_fs_root(current->fs, ns->root, ns->root->mnt_root);
 }
 
-void __init mnt_init(unsigned long mempages)
+void __init mnt_init(void)
 {
    struct list_head *d;
    unsigned int nr_hash;


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.