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


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

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

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

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

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

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

1.1.2.6
date	2006.10.17.22.27.42;	author jsipek;	state dead;
branches;
next	;


desc
@@


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


1.1.2.1
log
@Some generic bits for stackfs
@
text
@a0 66
diff -r 16c77c46f5c7 include/linux/stack_fs.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/linux/stack_fs.h	Fri Oct 13 05:15:39 2006 -0400
@@@@ -0,0 +1,62 @@@@
+#ifndef _LINUX_STACK_FS_H
+#define _LINUX_STACK_FS_H
+
+/* This file defines generic functions used primarily by stackable
+ * filesystems
+ */
+
+static inline void stackfs_copy_inode_size(struct inode *dst, const struct inode *src)
+{
+	i_size_write(dst, i_size_read((struct inode *)src));
+	dst->i_blocks = src->i_blocks;
+}
+
+static inline void stackfs_copy_attr_atime(struct inode *dest, const struct inode *src)
+{
+	dest->i_atime = src->i_atime;
+}
+
+static inline void stackfs_copy_attr_times(struct inode *dest,
+					   const struct inode *src)
+{
+	dest->i_atime = src->i_atime;
+	dest->i_mtime = src->i_mtime;
+	dest->i_ctime = src->i_ctime;
+}
+
+static inline void stackfs_copy_attr_timesizes(struct inode *dest,
+					       const struct inode *src)
+{
+	dest->i_atime = src->i_atime;
+	dest->i_mtime = src->i_mtime;
+	dest->i_ctime = src->i_ctime;
+	stackfs_copy_inode_size(dest, src);
+}
+
+static inline void __stackfs_copy_attr_all(struct inode *dest,
+				const struct inode *src,
+				int (*get_nlinks)(struct inode *))
+{
+	if (!get_nlinks)
+		dest->i_nlink = src->i_nlink;
+	else
+		dest->i_nlink = get_nlinks(dest);
+
+	dest->i_mode = src->i_mode;
+	dest->i_uid = src->i_uid;
+	dest->i_gid = src->i_gid;
+	dest->i_rdev = src->i_rdev;
+	dest->i_atime = src->i_atime;
+	dest->i_mtime = src->i_mtime;
+	dest->i_ctime = src->i_ctime;
+	dest->i_blkbits = src->i_blkbits;
+	dest->i_flags = src->i_flags;
+}
+
+static inline void stackfs_copy_attr_all(struct inode *dest, const struct inode *src)
+{
+	__stackfs_copy_attr_all(dest, src, NULL);
+}
+
+#endif /* _LINUX_STACK_FS_H */
+
@


1.1.2.2
log
@email text for stackfs and stackfs-ecryptfs
@
text
@a0 11
Stackfs: Introduce stackfs_copy_{attr,inode}_*

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

The following patch introduces several stackfs_copy_* functions which allow
stackable filesystems (such as eCryptfs and Unionfs) to easily copy over
(currently only) inode attributes. This prevents code duplication and allows
for code reuse.

Signed-off-by: Josef "Jeff" Sipek <jsipek@@cs.sunysb.edu>

@


1.1.2.3
log
@line wrapping
@
text
@d12 1
a12 1
diff -r 9c515a2cc148 include/linux/stack_fs.h
d14 2
a15 2
+++ b/include/linux/stack_fs.h	Fri Oct 13 07:16:50 2006 -0400
@@@@ -0,0 +1,65 @@@@
d23 1
a23 2
+static inline void stackfs_copy_inode_size(struct inode *dst,
+					   const struct inode *src)
d29 1
a29 2
+static inline void stackfs_copy_attr_atime(struct inode *dest,
+					   const struct inode *src)
d52 2
a53 2
+					   const struct inode *src,
+					   int (*get_nlinks)(struct inode *))
d71 1
a71 2
+static inline void stackfs_copy_attr_all(struct inode *dest,
+					 const struct inode *src)
@


1.1.2.4
log
@Andrew's comments about fsstack
@
text
@d1 1
a1 1
fsstack: Introduce fsstack_copy_{attr,inode}_*
d5 1
a5 1
The following patch introduces several fsstack_copy_* functions which allow
d12 1
a12 14
diff -r 9c515a2cc148 fs/Makefile
--- a/fs/Makefile	Thu Oct 12 20:30:12 2006 -0400
+++ b/fs/Makefile	Mon Oct 16 19:20:30 2006 -0400
@@@@ -10,7 +10,8 @@@@ obj-y :=	open.o read_write.o file_table.
 		ioctl.o readdir.o select.o fifo.o locks.o dcache.o inode.o \
 		attr.o bad_inode.o file.o filesystems.o namespace.o aio.o \
 		seq_file.o xattr.o libfs.o fs-writeback.o \
-		pnode.o drop_caches.o splice.o sync.o utimes.o
+		pnode.o drop_caches.o splice.o sync.o utimes.o \
+		stack.o
 
 ifeq ($(CONFIG_BLOCK),y)
 obj-y +=	buffer.o bio.o block_dev.o direct-io.o mpage.o ioprio.o
diff -r 9c515a2cc148 fs/stack.c
d14 4
a17 33
+++ b/fs/stack.c	Mon Oct 16 19:43:20 2006 -0400
@@@@ -0,0 +1,25 @@@@
+#include <linux/module.h>
+#include <linux/fs.h>
+
+void __fsstack_copy_attr_all(struct inode *dest,
+			     const struct inode *src,
+			     int (*get_nlinks)(struct inode *))
+{
+	if (!get_nlinks)
+		dest->i_nlink = src->i_nlink;
+	else
+		dest->i_nlink = (*get_nlinks)(dest);
+
+	dest->i_mode = src->i_mode;
+	dest->i_uid = src->i_uid;
+	dest->i_gid = src->i_gid;
+	dest->i_rdev = src->i_rdev;
+	dest->i_atime = src->i_atime;
+	dest->i_mtime = src->i_mtime;
+	dest->i_ctime = src->i_ctime;
+	dest->i_blkbits = src->i_blkbits;
+	dest->i_flags = src->i_flags;
+}
+
+EXPORT_SYMBOL_GPL(__fsstack_copy_attr_all);
+
diff -r 9c515a2cc148 include/linux/fs_stack.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/linux/fs_stack.h	Mon Oct 16 20:01:47 2006 -0400
@@@@ -0,0 +1,44 @@@@
+#ifndef _LINUX_FS_STACK_H
+#define _LINUX_FS_STACK_H
d20 1
a20 1
+ * filesystems; none of these functions require i_mutex to be held.
d23 1
a23 9
+#include <linux/fs.h>
+
+/* externs for fs/stack.c */
+extern void __fsstack_copy_attr_all(struct inode *dest,
+				    const struct inode *src,
+				    int (*get_nlinks)(struct inode *));
+
+/* inlines */
+static inline void fsstack_copy_inode_size(struct inode *dst,
d30 1
a30 1
+static inline void fsstack_copy_attr_atime(struct inode *dest,
d36 1
a36 1
+static inline void fsstack_copy_attr_times(struct inode *dest,
d44 30
a73 1
+static inline void fsstack_copy_attr_all(struct inode *dest,
d76 1
a76 1
+	__fsstack_copy_attr_all(dest, src, NULL);
d79 1
a79 1
+#endif /* _LINUX_FS_STACK_H */
@


1.1.2.5
log
@made fsstack_copy_inode_size non-inline
@
text
@d27 2
a28 2
+++ b/fs/stack.c	Mon Oct 16 20:17:14 2006 -0400
@@@@ -0,0 +1,39 @@@@
a31 14
+/* does _NOT_ require i_mutex to be held.
+ *
+ * This function cannot be inlined since i_size_{read,write} is rather
+ * heavy-weight on 32-bit systems
+ */
+void fsstack_copy_inode_size(struct inode *dst, const struct inode *src)
+{
+	i_size_write(dst, i_size_read((struct inode *)src));
+	dst->i_blocks = src->i_blocks;
+}
+
+/* copy all attributes; get_nlinks is optional way to override the i_nlink
+ * copying
+ */
a51 1
+EXPORT_SYMBOL_GPL(fsstack_copy_inode_size);
d53 1
d56 2
a57 2
+++ b/include/linux/fs_stack.h	Mon Oct 16 20:17:24 2006 -0400
@@@@ -0,0 +1,39 @@@@
d72 7
a78 1
+extern void fsstack_copy_inode_size(struct inode *dst, const struct inode *src);
a79 1
+/* inlines */
@


1.1.2.6
log
@fsstack is now in -mm
@
text
@@


