Commit dd8a306a authored by Dave Kleikamp's avatar Dave Kleikamp

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: default avatarDave Kleikamp <shaggy@austin.ibm.com>
parent 3b44f137
...@@ -1005,6 +1005,9 @@ static int dtSplitUp(tid_t tid, ...@@ -1005,6 +1005,9 @@ static int dtSplitUp(tid_t tid,
DT_PUTPAGE(smp); DT_PUTPAGE(smp);
if (!DO_INDEX(ip))
ip->i_size = xlen << sbi->l2bsize;
goto freeKeyName; goto freeKeyName;
} }
...@@ -1055,7 +1058,9 @@ static int dtSplitUp(tid_t tid, ...@@ -1055,7 +1058,9 @@ static int dtSplitUp(tid_t tid,
xaddr = addressPXD(pxd) + xlen; xaddr = addressPXD(pxd) + xlen;
dbFree(ip, xaddr, (s64) n); dbFree(ip, xaddr, (s64) n);
} }
} } else if (!DO_INDEX(ip))
ip->i_size = lengthPXD(pxd) << sbi->l2bsize;
extendOut: extendOut:
DT_PUTPAGE(smp); DT_PUTPAGE(smp);
...@@ -1098,6 +1103,9 @@ static int dtSplitUp(tid_t tid, ...@@ -1098,6 +1103,9 @@ static int dtSplitUp(tid_t tid,
goto splitOut; goto splitOut;
} }
if (!DO_INDEX(ip))
ip->i_size += PSIZE;
/* /*
* propagate up the router entry for the leaf page just split * propagate up the router entry for the leaf page just split
* *
...@@ -2424,6 +2432,9 @@ static int dtDeleteUp(tid_t tid, struct inode *ip, ...@@ -2424,6 +2432,9 @@ static int dtDeleteUp(tid_t tid, struct inode *ip,
break; break;
} }
if (!DO_INDEX(ip))
ip->i_size -= PSIZE;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment