32 #define BITSPERPAGE (PSIZE << 3)
34 #define MEGABYTE (1 << L2MEGABYTE)
35 #define MEGABYTE32 (MEGABYTE << 5)
38 #define BLKTODMAPN(b)\
39 (((b) >> 13) + ((b) >> 23) + ((b) >> 33) + 3 + 1)
67 struct inode *ipbmap2;
71 s64 newLogAddress, newFSCKAddress;
73 s64 newMapSize = 0, mapSize;
74 s64 XAddress, XSize, nblocks,
xoff, xaddr, t64;
78 int newNpages = 0, nPages, newPage, xlen, t32;
80 int log_formatted = 0;
81 struct inode *iplist[1];
84 int agsizechanged = 0;
85 struct buffer_head *bh, *bh2;
95 if (oldLVSize >= newLVSize) {
97 "jfs_extendfs: volume hasn't grown, returning\n");
104 if (newLVSize > VolumeSize) {
111 bh = sb_bread(sb, newLVSize - 1);
122 if (isReadOnly(ipbmap)) {
139 if (newLogSize == 0) {
144 newLogSize = newLVSize >> 8;
145 t32 = (1 << (20 - sbi->
l2bsize)) - 1;
146 newLogSize = (newLogSize + t32) & ~t32;
162 newLogAddress = newLVSize - newLogSize;
178 newFSCKAddress = newLogAddress - newFSCKSize;
183 newFSSize = newLVSize - newLogSize - newFSCKSize;
197 if ((rc =
lmLogFormat(log, newLogAddress, newLogSize)))
261 if ((rc =
lmLogFormat(log, newLogAddress, newLogSize)))
267 log->
base = newLogAddress;
296 newMapSize = newFSSize;
313 mapSize = bmp->db_mapsize;
315 XSize = newMapSize - mapSize;
316 old_agsize = bmp->db_agsize;
322 (
long long) mapSize, (
long long) t64);
326 nblocks =
min(t64 - mapSize, XSize);
335 if ((rc =
dbExtendFS(ipbmap, XAddress, nblocks)))
338 agsizechanged |= (bmp->db_agsize != old_agsize);
358 if (nPages == newNpages)
389 xlen =
min(xlen, (
int) nblocks) & ~(sbi->
nbperpage - 1);
394 if ((rc =
xtAppend(tid, ipbmap, 0, xoff, nblocks, &xlen, &xaddr, 0))) {
444 if ((rc =
diSync(ipimap)))
467 if ((rc =
dbSync(ipbmap)))
475 if (ipbmap2 ==
NULL) {