[PATCH 1/1] JFS: Add back directory i_size calculations for legacy partitions

[email protected] (Dave Kleikamp) Fri, 11 Nov 2005 10:17:34 -0600 (CST)
Newsgroups gmane.comp.file-systems.jfs.patches
Message-ID <[email protected]>
JFS: Add back directory i_size calculations for legacy partitions

Linux-formatted jfs partitions have a different idea about what i_size
represents than partitions formatted on OS/2.  The i_size calculation is
now based on the size of the directory index.  For legacy partitions, which
have no directory index, the i_size is never being updated.

This patch adds back the original i_size calculations for legacy partitions.

Signed-off-by: Dave Kleikamp <[email protected]>

---
commit dd8a306ac0c918268bd2ae89da2dea627f6e352d
tree e3f2c244505931d93b09f7d314014cf3832b0176
parent 3b44f137b9a846c5452d9e6e1271b79b1dbcc942
author Dave Kleikamp <[email protected]> Thu, 10 Nov 2005 07:50:03 -0600
committer Dave Kleikamp <[email protected]> Thu, 10 Nov 2005 07:50:03 -0600

 fs/jfs/jfs_dtree.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index 404f33e..6c3f083 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -1005,6 +1005,9 @@ static int dtSplitUp(tid_t tid,
 
 		DT_PUTPAGE(smp);
 
+		if (!DO_INDEX(ip))
+			ip->i_size = xlen << sbi->l2bsize;
+
 		goto freeKeyName;
 	}
 
@@ -1055,7 +1058,9 @@ static int dtSplitUp(tid_t tid,
 				xaddr = addressPXD(pxd) + xlen;
 				dbFree(ip, xaddr, (s64) n);
 			}
-		}
+		} else if (!DO_INDEX(ip))
+			ip->i_size = lengthPXD(pxd) << sbi->l2bsize;
+
 
 	      extendOut:
 		DT_PUTPAGE(smp);
@@ -1098,6 +1103,9 @@ static int dtSplitUp(tid_t tid,
 		goto splitOut;
 	}
 
+	if (!DO_INDEX(ip))
+		ip->i_size += PSIZE;
+
 	/*
 	 * propagate up the router entry for the leaf page just split
 	 *
@@ -2424,6 +2432,9 @@ static int dtDeleteUp(tid_t tid, struct 
 		break;
 	}
 
+	if (!DO_INDEX(ip))
+		ip->i_size -= PSIZE;
+
 	return 0;
 }
 


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php