aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-21 11:54:32 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-21 11:54:32 -0400
commit2fb59d623ad85dfdb8ce03a660051743f7361896 (patch)
tree3991ab2b88cc369444c136089d9c1570c26c6072 /fs/namespace.c
parentefdc31319d43050a5742fb690b1a4beb68092a94 (diff)
parent74c3cbe33bc077ac1159cadfea608b501e100344 (diff)
Merge branch 'audit.b43' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current
* 'audit.b43' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current: [PATCH] audit: watching subtrees [PATCH] new helper - inotify_evict_watch() [PATCH] new helper - inotify_clone_watch() [PATCH] new helpers - collect_mounts() and release_collected_mounts() [PATCH] pass dentry to audit_inode()/audit_inode_child()
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 860752998fb3..06083885b21e 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -246,7 +246,7 @@ static struct vfsmount *clone_mnt(struct vfsmount *old, struct dentry *root,
246 list_add(&mnt->mnt_slave, &old->mnt_slave_list); 246 list_add(&mnt->mnt_slave, &old->mnt_slave_list);
247 mnt->mnt_master = old; 247 mnt->mnt_master = old;
248 CLEAR_MNT_SHARED(mnt); 248 CLEAR_MNT_SHARED(mnt);
249 } else { 249 } else if (!(flag & CL_PRIVATE)) {
250 if ((flag & CL_PROPAGATION) || IS_MNT_SHARED(old)) 250 if ((flag & CL_PROPAGATION) || IS_MNT_SHARED(old))
251 list_add(&mnt->mnt_share, &old->mnt_share); 251 list_add(&mnt->mnt_share, &old->mnt_share);
252 if (IS_MNT_SLAVE(old)) 252 if (IS_MNT_SLAVE(old))
@@ -746,6 +746,26 @@ Enomem:
746 return NULL; 746 return NULL;
747} 747}
748 748
749struct vfsmount *collect_mounts(struct vfsmount *mnt, struct dentry *dentry)
750{
751 struct vfsmount *tree;
752 down_read(&namespace_sem);
753 tree = copy_tree(mnt, dentry, CL_COPY_ALL | CL_PRIVATE);
754 up_read(&namespace_sem);
755 return tree;
756}
757
758void drop_collected_mounts(struct vfsmount *mnt)
759{
760 LIST_HEAD(umount_list);
761 down_read(&namespace_sem);
762 spin_lock(&vfsmount_lock);
763 umount_tree(mnt, 0, &umount_list);
764 spin_unlock(&vfsmount_lock);
765 up_read(&namespace_sem);
766 release_mounts(&umount_list);
767}
768
749/* 769/*
750 * @source_mnt : mount tree to be attached 770 * @source_mnt : mount tree to be attached
751 * @nd : place the mount tree @source_mnt is attached 771 * @nd : place the mount tree @source_mnt is attached