head	1.1;
access;
symbols
	LKML-branch:1.1.0.2;
locks; strict;
comment	@# @;


1.1
date	2006.10.22.04.16.41;	author jsipek;	state dead;
branches
	1.1.2.1;
next	;

1.1.2.1
date	2006.10.22.04.16.41;	author jsipek;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	2006.10.22.05.12.06;	author jsipek;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	2006.10.23.19.22.21;	author jsipek;	state Exp;
branches;
next	1.1.2.4;

1.1.2.4
date	2006.10.25.06.51.26;	author jsipek;	state Exp;
branches;
next	1.1.2.5;

1.1.2.5
date	2006.10.28.21.56.36;	author jsipek;	state Exp;
branches;
next	1.1.2.6;

1.1.2.6
date	2006.10.28.23.24.43;	author jsipek;	state Exp;
branches;
next	1.1.2.7;

1.1.2.7
date	2006.10.29.00.27.02;	author jsipek;	state Exp;
branches;
next	1.1.2.8;

1.1.2.8
date	2006.11.07.04.55.34;	author jsipek;	state Exp;
branches;
next	;


desc
@@


1.1
log
@file fsstack-structs was initially added on branch LKML-branch.
@
text
@@


1.1.2.1
log
@Struct for fsstack
@
text
@a0 113
diff -r a92c009993fd include/linux/fs_stack.h
--- a/include/linux/fs_stack.h	Sat Oct 21 21:03:59 2006 -0400
+++ b/include/linux/fs_stack.h	Sat Oct 21 22:30:48 2006 -0400
@@@@ -5,7 +5,109 @@@@
  * filesystems; none of these functions require i_mutex to be held.
  */
 
+#include <linux/namei.h>
 #include <linux/fs.h>
+
+/* structs to maintain pointers to the lower VFS objects */
+struct fsstack_sb_info {
+	union {
+		struct super_block *sb;
+		struct super_block **sbs;
+	};
+};
+
+struct fsstack_inode_info {
+	union {
+		struct inode *inode;
+		struct inode **inodes;
+	};
+};
+
+struct fsstack_dentry_info {
+	union {
+		struct path path;
+		struct path *paths;
+	};
+};
+
+struct fsstack_file_info {
+	union {
+		struct file *file;
+		struct file **files;
+	};
+};
+
+/*
+ * Functions to get lower objects from an upper one.
+ *
+ * NOTE: These functions expect struct fsstack_*_info to be the first member
+ * in the filesystem-specific info structures and that inode->i_private
+ * points at the beginning of the inode container.
+ */
+static inline struct super_block *
+__fsstack_lower_sb(struct super_block *sb, unsigned long branch_idx)
+{
+	struct fsstack_sb_info *info = sb->s_fs_info;
+	return info->sbs[branch_idx];
+}
+
+static inline struct super_block *fsstack_lower_sb(struct super_block *sb)
+{
+	struct fsstack_sb_info *info = sb->s_fs_info;
+	return info->sb;
+}
+
+static inline struct inode *
+__fsstack_lower_inode(struct inode *inode, unsigned long branch_idx)
+{
+	struct fsstack_inode_info *info = inode->i_private;
+	return info->inodes[branch_idx];
+}
+
+static inline struct inode *fsstack_lower_inode(struct inode *inode)
+{
+	struct fsstack_inode_info *info = inode->i_private;
+	return info->inode;
+}
+
+static inline struct dentry *
+__fsstack_lower_dentry(struct dentry *dentry, unsigned long branch_idx)
+{
+	struct fsstack_dentry_info *info = dentry->d_fsdata;
+	return info->paths[branch_idx].dentry;
+}
+
+static inline struct dentry *fsstack_lower_dentry(struct dentry *dentry)
+{
+	struct fsstack_dentry_info *info = dentry->d_fsdata;
+	return info->path.dentry;
+}
+
+static inline struct vfsmount *
+__fsstack_lower_dentry_mnt(struct dentry *dentry, unsigned long branch_idx)
+{
+	struct fsstack_dentry_info *info = dentry->d_fsdata;
+	return info->paths[branch_idx].mnt;
+}
+
+static inline struct vfsmount *fsstack_lower_dentry_mnt(struct dentry *dentry)
+{
+	struct fsstack_dentry_info *info = dentry->d_fsdata;
+	return info->path.mnt;
+}
+
+static inline struct file *
+__fsstack_lower_file(struct file *file, unsigned long branch_idx)
+{
+	struct fsstack_file_info *info = file->private_data;
+	return info->files[branch_idx];
+}
+
+static inline struct file *fsstack_lower_file(struct file *file)
+{
+	struct fsstack_file_info *info = file->private_data;
+	return info->file;
+}
 
 /* externs for fs/stack.c */
 extern void fsstack_copy_attr_all(struct inode *dest, const struct inode *src,
@


1.1.2.2
log
@Setter functions & ecryptfs conversion
@
text
@d3 2
a4 2
+++ b/include/linux/fs_stack.h	Sun Oct 22 00:49:52 2006 -0400
@@@@ -5,7 +5,144 @@@@
a59 7
+static inline void
+fsstack_set_lower_sb(struct super_block *sb, struct super_block *lower_sb)
+{
+	struct fsstack_sb_info *info = sb->s_fs_info;
+	info->sb = lower_sb;
+}
+
a72 7
+static inline void
+fsstack_set_lower_inode(struct inode *inode, struct inode *lower_inode)
+{
+	struct fsstack_inode_info *info = inode->i_private;
+	info->inode = lower_inode;
+}
+
a85 7
+static inline void
+fsstack_set_lower_dentry(struct dentry *dentry, struct dentry *lower_dentry)
+{
+	struct fsstack_dentry_info *info = dentry->d_fsdata;
+	info->path.dentry = lower_dentry;
+}
+
d87 1
a87 1
+__fsstack_lower_mnt(struct dentry *dentry, unsigned long branch_idx)
d93 1
a93 1
+static inline struct vfsmount *fsstack_lower_mnt(struct dentry *dentry)
a98 7
+static inline void
+fsstack_set_lower_mnt(struct dentry *dentry, struct vfsmount *lower_mnt)
+{
+	struct fsstack_dentry_info *info = dentry->d_fsdata;
+	info->path.mnt = lower_mnt;
+}
+
a109 7
+}
+
+static inline void
+fsstack_set_lower_file(struct file *file, struct file *lower_file)
+{
+	struct fsstack_file_info *info = file->private_data;
+	info->file = lower_file;
@


1.1.2.3
log
@fsstack set functions for fanout & struct file changes are in -mm
@
text
@d1 4
a4 19
diff -r c764e4ebcdaf fs/unionfs/fanout.h
--- a/fs/unionfs/fanout.h	Sun Oct 22 23:16:21 2006 -0400
+++ b/fs/unionfs/fanout.h	Sun Oct 22 23:18:25 2006 -0400
@@@@ -48,8 +48,9 @@@@ static inline struct unionfs_inode_info 
 /* FIXME: temporary */
 #define ftohf(f)		__fsstack_lower_file((f), fbstart(f))
 #define ftohf_index(f,i)	__fsstack_lower_file((f), (i))
-#define set_ftohf(f)		__fsstack_set_lower_file((f), fbstart(f))
-#define set_ftohf_index(f,idx) 	__fsstack_set_lower_file((f), (idx))
+#define set_ftohf(f,lf)		__fsstack_set_lower_file((f), fbstart(f), (lf))
+#define set_ftohf_index(f,idx,lf) \
+				__fsstack_set_lower_file((f), (idx), (lf))
 
 /* Inode to hidden inode. */
 /* FIXME: temporary */
diff -r c764e4ebcdaf include/linux/fs_stack.h
--- a/include/linux/fs_stack.h	Sun Oct 22 23:16:21 2006 -0400
+++ b/include/linux/fs_stack.h	Sun Oct 22 23:33:12 2006 -0400
@@@@ -5,7 +5,184 @@@@
a53 8
+static inline void
+__fsstack_set_lower_sb(struct super_block *sb, unsigned long branch_idx,
+		       struct super_block *lower_sb)
+{
+	struct fsstack_sb_info *info = sb->s_fs_info;
+	info->sbs[branch_idx] = lower_sb;
+}
+
a73 8
+static inline void
+__fsstack_set_lower_inode(struct inode *inode, unsigned long branch_idx,
+			  struct inode *lower_inode)
+{
+	struct fsstack_inode_info *info = inode->i_private;
+	info->inodes[branch_idx] = lower_inode;
+}
+
a93 8
+static inline void
+__fsstack_set_lower_dentry(struct dentry *dentry, unsigned long branch_idx,
+			   struct dentry *lower_dentry)
+{
+	struct fsstack_dentry_info *info = dentry->d_fsdata;
+	info->paths[branch_idx].dentry = lower_dentry;
+}
+
a113 8
+static inline void
+__fsstack_set_lower_mnt(struct dentry *dentry, unsigned long branch_idx,
+			struct vfsmount *lower_mnt)
+{
+	struct fsstack_dentry_info *info = dentry->d_fsdata;
+	info->paths[branch_idx].mnt = lower_mnt;
+}
+
a131 8
+}
+
+static inline void
+__fsstack_set_lower_file(struct file *file, unsigned long branch_idx,
+			 struct file *lower_file)
+{
+	struct fsstack_file_info *info = file->private_data;
+	info->files[branch_idx] = lower_file;
@


1.1.2.4
log
@Part of a unionfs patch crept into a fsstack patch & Move struct file
patches earlier in the series
@
text
@d1 18
a18 3
diff -r e7a356f318ba include/linux/fs_stack.h
--- a/include/linux/fs_stack.h	Wed Oct 25 02:38:24 2006 -0400
+++ b/include/linux/fs_stack.h	Wed Oct 25 02:38:41 2006 -0400
@


1.1.2.5
log
@Collapse container and struct patches for fsstack
@
text
@d1 4
a4 4
diff -r 8995da925ea3 include/linux/fs_stack.h
--- a/include/linux/fs_stack.h	Sat Oct 28 17:20:32 2006 -0400
+++ b/include/linux/fs_stack.h	Sat Oct 28 17:21:08 2006 -0400
@@@@ -5,7 +5,249 @@@@
a39 11
+/* DO NOT USE!
+ *
+ * The following structure is used during the container_of calls to allow
+ * for as generic as possible way of accessing fsstack_inode_info given a
+ * pointer to the inode.
+ */
+struct __fsstack_inode_generic_info {
+	struct inode vfs_inode;		/* vfs inode */
+	struct fsstack_inode_info info;	/* fsstack inode info */
+};
+
d43 3
a45 8
+ * NOTE: The filesystem specific info structure _must_ have the following
+ * layout:
+ *
+ * 	struct foo {
+ * 		struct inode vfs_inode;
+ * 		struct fsstack_inode_info info;
+ * 		...
+ * 	};
a74 6
+/* get the fs dependent data */
+static inline void * fsstack_inode_data(struct inode *inode)
+{
+	return &((struct __fsstack_inode_generic_info*) inode)->info;
+}
+
d78 1
a78 2
+	struct fsstack_inode_info *info = fsstack_inode_data(inode);
+		
a81 7
+static inline struct inode **
+__fsstack_lower_inodes(struct inode *inode)
+{
+	struct fsstack_inode_info *info = fsstack_inode_data(inode);
+	return info->inodes;
+}
+
d86 1
a86 1
+	struct fsstack_inode_info *info = fsstack_inode_data(inode);
a89 7
+static inline void
+__fsstack_set_lower_inodes(struct inode *inode, struct inode **lower_inodes)
+{
+	struct fsstack_inode_info *info = fsstack_inode_data(inode);
+	info->inodes = lower_inodes;
+}
+
d92 1
a92 1
+	struct fsstack_inode_info *info = fsstack_inode_data(inode);
d99 1
a99 1
+	struct fsstack_inode_info *info = fsstack_inode_data(inode);
a109 7
+static inline struct path *
+__fsstack_lower_paths(struct dentry *dentry)
+{
+	struct fsstack_dentry_info *info = dentry->d_fsdata;
+	return info->paths;
+}
+
a117 7
+static inline void
+__fsstack_set_lower_paths(struct dentry *dentry, struct path *lower_paths)
+{
+	struct fsstack_dentry_info *info = dentry->d_fsdata;
+	info->paths = lower_paths;
+}
+
a165 7
+static inline struct file **
+__fsstack_lower_files(struct file *file)
+{
+	struct fsstack_file_info *info = file->private_data;
+	return info->files;
+}
+
a171 7
+}
+
+static inline void
+__fsstack_set_lower_files(struct file *file, struct file **lower_files)
+{
+	struct fsstack_file_info *info = file->private_data;
+	info->files = lower_files;
@


1.1.2.6
log
@Some comments to fsstack and ecryptfs-fsstack fixup
@
text
@d3 2
a4 2
+++ b/include/linux/fs_stack.h	Sat Oct 28 19:19:40 2006 -0400
@@@@ -5,7 +5,257 @@@@
d54 2
a55 2
+ * NOTE: The filesystem specific info structures (for dentries, superblocks
+ * and files) _must_ have the following layout:
d57 1
a57 9
+ *	struct foo {
+ *		struct fsstack_{dentry,sb,file}_info info;
+ *		...
+ *	};
+ *
+ * Because of the useage of containers, the inode container structure _must_
+ * have the following layout:
+ *
+ * 	struct bar {
@


1.1.2.7
log
@Most of the patch headers for fsstack struct patches
@
text
@a0 20
fsstack: Generic get/set lower object functions

From: Josef "Jeff" Sipek <jsipek@@cs.sunysb.edu>

This patch introduces generic structures and functions to get/set the
structure members. 



The patch is loosely based on Pekka Enberg's patches from October 13th
(http://lkml.org/lkml/2006/10/13/82).

Cc: Pekka Enberg <penberg@@cs.helsinki.fi>
Cc: Michael Halcrow <mhalcrow@@us.ibm.com>
Cc: Erez Zadok <ezk@@cs.sunysb.edu>
Cc: Christoph Hellwig <hch@@infradead.org>
Cc: Al Viro <viro@@ftp.linux.org.uk>
Cc: Andrew Morton <akpm@@osdl.org>
Signed-off-by: Josef "Jeff" Sipek <jsipek@@cs.sunysb.edu>

d62 1
a62 1
+ * Because of the usage of containers, the inode container structure _must_
@


1.1.2.8
log
@Move patches over to a real git tree
@
text
@d5 2
a6 5
Every stackable filesystem needs to track what the corresponding lower
objects are. The stackable fs superblock needs to maintain pointers to the
lower superblock(s); the inodes need to maintain pointers to the lower
inodes; dentries need to maintain pointers to the lower dentries and
vfsmounts.
a7 4
Currently, every stackable filesystem maintains this information in the
private data of the object in question (the inode pointers may be also
stored in the inode's container - which is what the following patch
requires.)
a8 4
This patch introduces generic structures to maintain the lower object
references, and functions to get/set the lower object structure members.
These functions are the generalized forms, which work with both linear and
fanout stackable filesystem (eCryptfs and Unionfs to name some).
d23 2
a24 2
+++ b/include/linux/fs_stack.h	Sun Oct 29 18:47:09 2006 -0500
@@@@ -5,7 +5,271 @@@@
a97 7
+static inline struct super_block **
+__fsstack_lower_sbs(struct super_block *sb)
+{
+	struct fsstack_sb_info *info = sb->s_fs_info;
+	return info->sbs;
+}
+
a103 7
+}
+
+static inline void
+__fsstack_set_lower_sbs(struct super_block *sb, struct super_block **lower_sbs)
+{
+	struct fsstack_sb_info *info = sb->s_fs_info;
+	info->sbs = lower_sbs;
@


