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


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

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


desc
@@


1.1
log
@file fsstack-unionfs-more-struct was initially added on branch LKML-branch.
@
text
@@


1.1.2.1
log
@Move patches over to a real git tree
@
text
@a0 69
diff -r 8695ca1a6869 fs/unionfs/fanout.h
--- a/fs/unionfs/fanout.h	Sun Oct 29 01:16:14 2006 -0500
+++ b/fs/unionfs/fanout.h	Sun Oct 29 02:13:39 2006 -0500
@@@@ -30,7 +30,7 @@@@ static inline struct unionfs_inode_info 
 #define ibend(ino) (itopd(ino)->b_end)
 
 /* Superblock to private data */
-#define stopd(super) ((struct unionfs_sb_info *)(super)->s_fs_info)
+#define stopd(super)	((struct unionfs_sb_info *)(super)->s_fs_info)
 #define stopd_lhs(super) ((super)->s_fs_info)
 #define sbstart(sb) 0
 #define sbend(sb) stopd(sb)->b_end
diff -r 8695ca1a6869 fs/unionfs/main.c
--- a/fs/unionfs/main.c	Sun Oct 29 01:16:14 2006 -0500
+++ b/fs/unionfs/main.c	Sun Oct 29 02:22:21 2006 -0500
@@@@ -253,6 +253,13 @@@@ static int parse_dirs_option(struct supe
 			branches++;
 
 	/* allocate space for underlying pointers to hidden dentry */
+	__fsstack_set_lower_sbs(sb, kcalloc(branches,
+			sizeof(struct super_block*), GFP_KERNEL));
+	if (!__fsstack_lower_sbs(sb)) {
+		err = -ENOMEM;
+		goto out;
+	}
+
 	stopd(sb)->usi_data = kcalloc(branches,
 			sizeof(struct unionfs_usi_data), GFP_KERNEL);
 	if (!stopd(sb)->usi_data) {
@@@@ -342,12 +349,14 @@@@ out:
 
 		kfree(hidden_root_info->info.paths);
 		kfree(stopd(sb)->usi_data);
+		kfree(__fsstack_lower_sbs(sb));
 
 		/* MUST clear the pointers to prevent potential double free if
 		 * the caller dies later on
 		 */
 		hidden_root_info->info.paths = NULL;
 		stopd(sb)->usi_data = NULL;
+		__fsstack_set_lower_sbs(sb, NULL);
 	}
 	return err;
 }
diff -r 8695ca1a6869 fs/unionfs/super.c
--- a/fs/unionfs/super.c	Sun Oct 29 01:16:14 2006 -0500
+++ b/fs/unionfs/super.c	Sun Oct 29 15:47:43 2006 -0500
@@@@ -102,11 +102,6 @@@@ static void unionfs_put_super(struct sup
 		
 	bstart = sbstart(sb);
 	bend = sbend(sb);
-#if 0
-	/* this shouldn't be needed */
-	for (bindex = bstart; bindex <= bend; bindex++)
-		mntput(stohiddenmnt_index(sb, bindex));
-#endif
 
 	/* Make sure we have no leaks of branchget/branchput. */
 	for (bindex = bstart; bindex <= bend; bindex++)
@@@@ -201,7 +196,8 @@@@ static struct inode *unionfs_alloc_inode
 
 static void unionfs_destroy_inode(struct inode *inode)
 {
-	kmem_cache_free(unionfs_inode_cachep, itopd(inode));
+	/* struct inode is the first field in the container */
+	kmem_cache_free(unionfs_inode_cachep, inode);
 }
 
 static void init_once(void *v, struct kmem_cache * cachep, unsigned long flags)
@

