Thread (87 messages) 87 messages, 7 authors, 2012-03-28
STALE5223d

[PATCH 22/73] union-mount: Add two superblock fields for union mounts [ver #2]

From: David Howells <dhowells@redhat.com>
Date: 2012-02-21 18:00:19
Also in: lkml
Subsystem: filesystems (vfs and infrastructure), the rest · Maintainers: Alexander Viro, Christian Brauner, Linus Torvalds

From: Valerie Aurora <redacted>

Add two fields to struct super_block to support union mounts:

 (*) s_union_lower_mnts

     A pointer to a cloned vfsmount tree of all the lower (read-only) mounts
     unioned with the topmost (read-write) vfsmount.  These mounts may have
     submounts which will also be unioned; hence we copy the entire vfsmount
     tree, not just the root vfsmounts.

 (*) s_union_count

     The number of lower mounts unioned at the root of the file system.  This
     count is the maximum number of directories that will ever be unioned with
     a single directory.  We use it to allocate a union stack of the correct
     size for each directory.

Original-author: Valerie Aurora [off-list ref]
Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/fs.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index a014f0f..f19772c 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1509,6 +1509,16 @@ struct super_block {
 	 * free_vfsmnt() if MNT_HARD_READONLY is set.
 	 */
 	int s_hard_readonly_users;
+
+	/* Root of the private cloned vfsmount tree of the read-only
+	 * mounts in this union (set in topmost vfsmount only)
+	 */
+	struct vfsmount *s_union_lower_mnts;
+
+	/* Number of layers in this union, not counting the topmost or
+	 * submounts.
+	 */
+	unsigned int s_union_count;
 };
 
 /* superblock cache pruning functions */
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help