[PATCH] introduce shared mounts
[safe/jmp/linux-2.6] / fs / pnode.c
1 /*
2  *  linux/fs/pnode.c
3  *
4  * (C) Copyright IBM Corporation 2005.
5  *      Released under GPL v2.
6  *      Author : Ram Pai (linuxram@us.ibm.com)
7  *
8  */
9 #include <linux/namespace.h>
10 #include <linux/mount.h>
11 #include <linux/fs.h>
12 #include "pnode.h"
13
14 /* return the next shared peer mount of @p */
15 static inline struct vfsmount *next_peer(struct vfsmount *p)
16 {
17         return list_entry(p->mnt_share.next, struct vfsmount, mnt_share);
18 }
19
20 void change_mnt_propagation(struct vfsmount *mnt, int type)
21 {
22         if (type == MS_SHARED) {
23                 mnt->mnt_flags |= MNT_SHARED;
24         } else {
25                 list_del_init(&mnt->mnt_share);
26                 mnt->mnt_flags &= ~MNT_PNODE_MASK;
27         }
28 }