[PATCH 069/145] mkfs: set agsize prior to calculating minimum log size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Each btree has its own maxlevels variable.  Since the level count of
certain btrees depend on agblocks, it's necessary to know the AG size
prior to calculating the log reservations.  These reservations are
needed to calculate the log size and the kernel will refuse to mount
if we guess too low, so stuff in the real agsize when we're formatting
the log.

Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
---
 include/xfs_multidisk.h |    2 +-
 mkfs/maxtrres.c         |    3 ++-
 mkfs/xfs_mkfs.c         |    3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)


diff --git a/include/xfs_multidisk.h b/include/xfs_multidisk.h
index fe3e98f..4429dab 100644
--- a/include/xfs_multidisk.h
+++ b/include/xfs_multidisk.h
@@ -66,7 +66,7 @@ extern void parse_proto (xfs_mount_t *mp, struct fsxattr *fsx, char **pp);
 extern void res_failed (int err);
 
 /* maxtrres.c */
-extern int max_trans_res (int crcs_enabled, int dirversion,
+extern int max_trans_res(unsigned long agsize, int crcs_enabled, int dirversion,
 		int sectorlog, int blocklog, int inodelog, int dirblocklog,
 		int logversion, int log_sunit, int finobt);
 
diff --git a/mkfs/maxtrres.c b/mkfs/maxtrres.c
index f48a0f7..c0b1b5d 100644
--- a/mkfs/maxtrres.c
+++ b/mkfs/maxtrres.c
@@ -29,6 +29,7 @@
 
 int
 max_trans_res(
+	unsigned long	agsize,
 	int		crcs_enabled,
 	int		dirversion,
 	int		sectorlog,
@@ -50,7 +51,7 @@ max_trans_res(
 	sbp->sb_sectsize = 1 << sbp->sb_sectlog;
 	sbp->sb_blocklog = blocklog;
 	sbp->sb_blocksize = 1 << blocklog;
-	sbp->sb_agblocks = XFS_AG_MIN_BYTES / (1 << blocklog);
+	sbp->sb_agblocks = agsize;
 	sbp->sb_inodelog = inodelog;
 	sbp->sb_inopblog = blocklog - inodelog;
 	sbp->sb_inodesize = 1 << inodelog;
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 4b5df98..8b3cad8 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -2887,7 +2887,8 @@ an AG size that is one stripe unit smaller, for example %llu.\n"),
 		lsunit = (32 * 1024) >> blocklog;
 	}
 
-	min_logblocks = max_trans_res(sb_feat.crcs_enabled, sb_feat.dir_version,
+	min_logblocks = max_trans_res(agsize,
+				   sb_feat.crcs_enabled, sb_feat.dir_version,
 				   sectorlog, blocklog, inodelog, dirblocklog,
 				   sb_feat.log_version, lsunit, sb_feat.finobt);
 	ASSERT(min_logblocks);

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs



[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux