xfs
[Top] [All Lists]

[[PATCH, RESEND]] less AGs for single disks configs.

To: xfs@xxxxxxxxxxx
Subject: [[PATCH, RESEND]] less AGs for single disks configs.
From: xaiki@xxxxxxx
Date: Mon, 12 Nov 2007 14:48:49 +1100
Cc: Niv Sardi <xaiki@xxxxxxx>
In-reply-to: <1194839329-22003-5-git-send-email-xaiki@xxxxxxx>
References: <20071031233516.GB88034736@xxxxxxxxxxxxxxxxx> <1194839329-22003-1-git-send-email-xaiki@xxxxxxx> <1194839329-22003-2-git-send-email-xaiki@xxxxxxx> <1194839329-22003-3-git-send-email-xaiki@xxxxxxx> <1194839329-22003-4-git-send-email-xaiki@xxxxxxx> <1194839329-22003-5-git-send-email-xaiki@xxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
From: Niv Sardi <xaiki@xxxxxxx>

get the underlying structure with get_subvol_stripe_wrapper(),
and pass sunit | swidth as an argument to calc_default_ag_geometry().

if it is set, get the AG sizes bigger.

this also cleans up a typo:
-       } else if (daflag)      /* User-specified AG size */
+       } else if (daflag)      /* User-specified AG count */
---
 xfsprogs/mkfs/xfs_mkfs.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/xfsprogs/mkfs/xfs_mkfs.c b/xfsprogs/mkfs/xfs_mkfs.c
index 78c2c77..4cf9975 100644
--- a/xfsprogs/mkfs/xfs_mkfs.c
+++ b/xfsprogs/mkfs/xfs_mkfs.c
@@ -393,6 +393,7 @@ void
 calc_default_ag_geometry(
        int             blocklog,
        __uint64_t      dblocks,
+       int             multidisk,
        __uint64_t      *agsize,
        __uint64_t      *agcount)
 {
@@ -428,12 +429,13 @@ calc_default_ag_geometry(
         *
         * This scales us up smoothly between min/max AG sizes.
         */
+
        if (dblocks > GIGABYTES(512, blocklog))
-               shift = 5;
+               shift = 5 - (multidisk == 0);
        else if (dblocks > GIGABYTES(8, blocklog))
-               shift = 4;
+               shift = 4 - (multidisk == 0);
        else if (dblocks >= MEGABYTES(128, blocklog))
-               shift = 3;
+               shift = 3 - (multidisk == 0);
        else
                ASSERT(0);
        blocks = dblocks >> shift;
@@ -1771,10 +1773,14 @@ _("size %s specified for log subvolume is too large, 
maximum is %lld blocks\n"),
                agsize /= blocksize;
                agcount = dblocks / agsize + (dblocks % agsize != 0);
 
-       } else if (daflag)      /* User-specified AG size */
+       } else if (daflag)      /* User-specified AG count */
                agsize = dblocks / agcount + (dblocks % agcount != 0);
-       else
-               calc_default_ag_geometry(blocklog, dblocks, &agsize, &agcount);
+       else {
+               get_subvol_stripe_wrapper(dfile, SVTYPE_DATA,
+                                         &xlv_dsunit, &xlv_dswidth, 
&sectoralign),
+                       calc_default_ag_geometry(blocklog, dblocks, xlv_dsunit 
| xlv_dswidth,
+                                                &agsize, &agcount);
+       }
 
        /*
         * If the last AG is too small, reduce the filesystem size
-- 
1.5.3.5


<Prev in Thread] Current Thread [Next in Thread>