static int agcount;
static xfs_agnumber_t *aglist;
+static int alignment;
static int countflag;
static int dumpflag;
static int equalsize;
static const cmdinfo_t freesp_cmd =
{ "freesp", NULL, freesp_f, 0, -1, 0,
- "[-bcdfs] [-a agno]... [-e binsize] [-h h1]... [-m binmult]",
+ "[-bcdfs] [-A alignment] [-a agno]... [-e binsize] [-h h1]... [-m binmult]",
"summarize free space for filesystem", NULL };
static int
totblocks = totexts = 0;
aglist = NULL;
hist = NULL;
- while ((c = getopt(argc, argv, "a:bcde:h:m:s")) != EOF) {
+ while ((c = getopt(argc, argv, "A:a:bcde:h:m:s")) != EOF) {
switch (c) {
+ case 'A':
+ alignment = atoi(optarg);
+ break;
case 'a':
aglistadd(optarg);
break;
{
int i;
+ if (alignment && (XFS_AGB_TO_FSB(mp,agno,agbno) % alignment))
+ return;
+
if (dumpflag)
dbprintf("%8d %8d %8d\n", agno, agbno, len);
totexts++;
enables processing of realtime file data.
.RE
.TP
-.BI "freesp [\-bcds] [\-a " ag "] ... [\-e " i "] [\-h " h1 "] ... [\-m " m ]
+.BI "freesp [\-bcds] [\-A " alignment "] [\-a " ag "] ... [\-e " i "] [\-h " h1 "] ... [\-m " m ]
Summarize free space for the filesystem. The free blocks are examined
and totalled, and displayed in the form of a histogram, with a count
of extents in each range of free extent sizes.
.RS 1.0i
.TP 0.4i
+.B \-A
+reports only free extents with starting blocks aligned to
+.I alignment
+blocks.
+.TP
.B \-a
adds
.I ag