GIT: unionfs2-2.6.27.y: fs_stack: simplify generic attribute-copying function

Erez Zadok ezk at fsl.cs.sunysb.edu
Thu Aug 12 23:16:39 EDT 2010


commit c26abd3b3c49d9a04d2cd376e2aaf9495e996940
Author: Erez_Zadok <ezk at cs.sunysb.edu>
Date:   Sun Jun 17 22:34:47 2007 -0400

    fs_stack: simplify generic attribute-copying function
    
    Remove special get_nlinks callback from fsstack_copy_attr_all, because the
    callback was only used by Unionfs (and always used by Unionfs).  Unionfs now
    needs a more complex version of fsstack_copy_attr_all, with two callbacks:
    therefore it's easier to simplify this method for simple linear-stacking
    stackable file system, and introduce a more complex fan-out version of it
    for Unionfs.
    
    This is an API change which requires that every stackable file system in the
    kernel be updated to reflect that (currently only eCryptfs).
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

diff --git a/fs/stack.c b/fs/stack.c
index 0b3e93b..56fd0df 100644
--- a/fs/stack.c
+++ b/fs/stack.c
@@ -30,8 +30,7 @@ EXPORT_SYMBOL_GPL(fsstack_copy_inode_size);
  * copy all attributes; get_nlinks is optional way to override the i_nlink
  * copying
  */
-void fsstack_copy_attr_all(struct inode *dest, const struct inode *src,
-			   int (*get_nlinks)(struct inode *))
+void fsstack_copy_attr_all(struct inode *dest, const struct inode *src)
 {
 	dest->i_mode = src->i_mode;
 	dest->i_uid = src->i_uid;
@@ -42,14 +41,6 @@ void fsstack_copy_attr_all(struct inode *dest, const struct inode *src,
 	dest->i_ctime = src->i_ctime;
 	dest->i_blkbits = src->i_blkbits;
 	dest->i_flags = src->i_flags;
-
-	/*
-	 * Update the nlinks AFTER updating the above fields, because the
-	 * get_links callback may depend on them.
-	 */
-	if (!get_nlinks)
-		dest->i_nlink = src->i_nlink;
-	else
-		dest->i_nlink = (*get_nlinks)(dest);
+	dest->i_nlink = src->i_nlink;
 }
 EXPORT_SYMBOL_GPL(fsstack_copy_attr_all);
diff --git a/include/linux/fs_stack.h b/include/linux/fs_stack.h
index 5bbdca4..2599c5b 100644
--- a/include/linux/fs_stack.h
+++ b/include/linux/fs_stack.h
@@ -20,8 +20,7 @@
 #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 *));
+extern void fsstack_copy_attr_all(struct inode *dest, const struct inode *src);
 extern void fsstack_copy_inode_size(struct inode *dst,
 				    const struct inode *src);
 


More information about the unionfs-cvs mailing list