From: Niv Sardi <xaiki@sgi.com>
To: xfs@oss.sgi.com
Subject: Re: Default mount options (that suck less).
Date: Thu, 1 Nov 2007 10:40:28 +1100 [thread overview]
Message-ID: <20071031234027.GC88034736@melbourne.sgi.com> (raw)
In-Reply-To: <20071031233516.GB88034736@melbourne.sgi.com>
[-- Attachment #1: Type: text/plain, Size: 78 bytes --]
Oops, the last patch should have been this one, sorry for the noise.
--
Niv
[-- Attachment #2: 0006-less-AGs-for-single-disks-configs.patch --]
[-- Type: text/plain, Size: 3778 bytes --]
>From 1defd8358a7ee693176875ebc3a670a347c87d11 Mon Sep 17 00:00:00 2001
From: Niv Sardi <xaiki@cxhome.ath.cx>
Date: Tue, 30 Oct 2007 12:26:35 +1100
Subject: [PATCH] less AGs for single disks configs.
This patch modifies get_subvol_stripe_wrapper() to return 0 on multi disk configs,
<0 on error, and >0 on single disk configs (Ideally I'd like it to be able to return the
count of disks or something more usefull).
it then uses the output of the new get_subvol_stripe_wrapper() in calc_default_ag_geometry()
to get bigger AGs when in single disk configs (currently only x2 bigger).
---
xfsprogs/include/volume.h | 2 +-
xfsprogs/libdisk/drivers.c | 15 ++++++++-------
xfsprogs/mkfs/xfs_mkfs.c | 18 ++++++++++++------
3 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/xfsprogs/include/volume.h b/xfsprogs/include/volume.h
index 0cc931d..e4cd26c 100644
--- a/xfsprogs/include/volume.h
+++ b/xfsprogs/include/volume.h
@@ -46,7 +46,7 @@ typedef enum sv_type_e {
SVTYPE_LAST =255
} sv_type_t;
-extern void get_subvol_stripe_wrapper (char *, sv_type_t, int *, int *, int *);
+extern int get_subvol_stripe_wrapper (char *, sv_type_t, int *, int *, int *);
extern int get_driver_block_major (const char *, int);
#endif /* __VOLUME_H__ */
diff --git a/xfsprogs/libdisk/drivers.c b/xfsprogs/libdisk/drivers.c
index 26c6ec1..9bdc270 100644
--- a/xfsprogs/libdisk/drivers.c
+++ b/xfsprogs/libdisk/drivers.c
@@ -18,7 +18,7 @@
#include "drivers.h"
-void
+int
get_subvol_stripe_wrapper(
char *dev,
sv_type_t type,
@@ -29,7 +29,7 @@ get_subvol_stripe_wrapper(
struct stat64 sb;
if (dev == NULL)
- return;
+ return -ENODEV;
if (stat64(dev, &sb)) {
fprintf(stderr, _("Cannot stat %s: %s\n"),
@@ -38,16 +38,17 @@ get_subvol_stripe_wrapper(
}
if ( dm_get_subvol_stripe(dev, type, sunit, swidth, sectalign, &sb))
- return;
+ return 0;
if ( md_get_subvol_stripe(dev, type, sunit, swidth, sectalign, &sb))
- return;
+ return 0;
if ( lvm_get_subvol_stripe(dev, type, sunit, swidth, sectalign, &sb))
- return;
+ return 0;
if ( xvm_get_subvol_stripe(dev, type, sunit, swidth, sectalign, &sb))
- return;
+ return 0;
if (evms_get_subvol_stripe(dev, type, sunit, swidth, sectalign, &sb))
- return;
+ return 0;
+ return 1;
/* ... add new device drivers here */
}
diff --git a/xfsprogs/mkfs/xfs_mkfs.c b/xfsprogs/mkfs/xfs_mkfs.c
index 78c2c77..ea5cd86 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 singled,
__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 - (singled > 0);
else if (dblocks > GIGABYTES(8, blocklog))
- shift = 4;
+ shift = 4 - (singled > 0);
else if (dblocks >= MEGABYTES(128, blocklog))
- shift = 3;
+ shift = 3 - (singled > 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 {
+ calc_default_ag_geometry(blocklog, dblocks,
+ get_subvol_stripe_wrapper(dfile, SVTYPE_DATA,
+ &xlv_dsunit, &xlv_dswidth, §oralign),
+ &agsize, &agcount);
+ }
/*
* If the last AG is too small, reduce the filesystem size
--
1.5.3.4
next prev parent reply other threads:[~2007-10-31 23:40 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-29 7:56 Default mount options (that suck less) Niv Sardi
2007-10-29 8:55 ` David Chinner
2007-10-29 10:44 ` nscott
2007-10-29 14:01 ` Eric Sandeen
2007-10-29 21:26 ` David Chinner
2007-10-29 14:03 ` Eric Sandeen
2007-10-29 15:05 ` Hannes Dorbath
2007-10-29 15:07 ` Eric Sandeen
2007-10-30 8:40 ` Stewart Smith
2007-10-31 4:11 ` Nathan Scott
2007-10-31 4:13 ` Eric Sandeen
2007-10-29 21:05 ` David Chinner
2007-10-29 15:26 ` Eric Sandeen
2007-10-29 15:44 ` Chris Wedgwood
2007-10-29 15:51 ` Eric Sandeen
2007-10-30 0:45 ` Timothy Shimmin
2007-10-31 11:05 ` James Braid
2007-10-31 11:27 ` Justin Piszcz
2007-11-01 0:47 ` James Braid
2007-10-31 15:21 ` Eric Sandeen
2007-10-31 15:41 ` Chris Wedgwood
2007-11-01 0:32 ` James Braid
2007-10-29 23:48 ` David Chinner
2007-10-31 23:35 ` Niv Sardi
2007-10-31 23:40 ` Niv Sardi [this message]
2007-11-01 1:17 ` Niv Sardi
2007-11-01 2:27 ` Eric Sandeen
2007-11-12 2:28 ` Niv Sardi
2007-11-12 3:10 ` David Chinner
2007-11-12 3:48 ` [[PATCH, RESEND]] Default to log version 2 xaiki
2007-11-12 3:48 ` [[PATCH, RESEND]] Default to version 2 attributes xaiki
2007-11-12 3:48 ` [[PATCH, RESEND]] Drop the ability to turn unwritten extents off completly xaiki
2007-11-12 3:48 ` [[PATCH, RESEND]] V2 inodes per default, and move DFL bits to XFS_DFL_SB_VERSION_BITS, xaiki
2007-11-12 3:48 ` [[PATCH, RESEND]] reduce imaxpct for big filesystems, xaiki
2007-11-12 3:48 ` [[PATCH, RESEND]] less AGs for single disks configs xaiki
2007-11-12 9:01 ` David Chinner
2007-11-12 14:57 ` Justin Piszcz
2007-11-12 20:31 ` David Chinner
2007-11-12 6:33 ` [[PATCH, RESEND]] reduce imaxpct for big filesystems, David Chinner
2007-11-12 6:31 ` [[PATCH, RESEND]] V2 inodes per default, and move DFL bits to XFS_DFL_SB_VERSION_BITS, David Chinner
2007-11-13 0:51 ` Niv Sardi
2007-11-12 6:27 ` [[PATCH, RESEND]] Drop the ability to turn unwritten extents off completly David Chinner
2007-11-12 6:24 ` [[PATCH, RESEND]] Default to version 2 attributes David Chinner
2007-11-12 6:23 ` [[PATCH, RESEND]] Default to log version 2 David Chinner
2007-11-13 4:10 ` RESEND(2) xaiki
2007-11-13 4:10 ` [PATCH TAKE 2 1/6] Default to log version 2 xaiki
2007-11-13 4:10 ` [PATCH TAKE 2 2/6] Default to version 2 attributes xaiki
2007-11-13 4:10 ` [PATCH TAKE 2 3/6] Drop the ability to turn unwritten extents off completly xaiki
2007-11-13 4:10 ` [PATCH TAKE 2 4/6] V2 inodes per default, and move DFL bits to XFS_DFL_SB_VERSION_BITS, xaiki
2007-11-13 4:10 ` [PATCH TAKE 2 5/6] reduce imaxpct for big filesystems, xaiki
2007-11-13 4:10 ` [PATCH TAKE 2 6/6] less AGs for single disks configs xaiki
2007-11-13 4:47 ` RESEND(2) David Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071031234027.GC88034736@melbourne.sgi.com \
--to=xaiki@sgi.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.