| To: | David Chinner <dgc@xxxxxxx> |
|---|---|
| Subject: | Re: Review: fix test 004 to account for reserved space |
| From: | Tim Shimmin <tes@xxxxxxx> |
| Date: | Sat, 16 Jun 2007 14:10:53 +1000 |
| Cc: | xfs-dev <xfs-dev@xxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>, asg-qa <asg-qa@xxxxxxxxxxxxxxxxx> |
| In-reply-to: | <20070615062335.GO86004887@sgi.com> |
| References: | <20070604063328.GT85884050@sgi.com> <20070615062335.GO86004887@sgi.com> |
| Sender: | xfs-bounce@xxxxxxxxxxx |
| User-agent: | Thunderbird 1.5.0.10 (Windows/20070221) |
Hi Dave, Yes that looks not bad. However, your last proposal, prompted from Nathan, was to adjust f_bavail differently than bfree to account for how much was available in the reserved block space. struct statfs { long f_type; /* type of filesystem (see below) */ long f_bsize; /* optimal transfer block size */ long f_blocks; /* total data blocks in file system */ long f_bfree; /* free blocks in fs */ <------ includes reserved long f_bavail; /* free blocks avail to non-superuser */ <------ doesn't include reserved long f_files; /* total file nodes in file system */ long f_ffree; /* free file nodes in fs */ fsid_t f_fsid; /* file system id */ long f_namelen; /* maximum length of filenames */ long f_spare[6]; /* spare for later */ }; And looking at df code it uses bfree in calculation of space used... the 3rd field of df output. df code:
---------------------------------------------------------------
total = fsu.fsu_blocks;
available = fsu.fsu_bavail;
negate_available = (fsu.fsu_bavail_top_bit_set
& (available != UINTMAX_MAX));
available_to_root = fsu.fsu_bfree;
}used = UINTMAX_MAX;
negate_used = false;
if (total != UINTMAX_MAX && available_to_root != UINTMAX_MAX)
{
used = total - available_to_root;
negate_used = (total < available_to_root);
}printf (" %*s %*s %*s ",
width + col1_adjustment,
df_readable (false, total,
buf[0], input_units, output_units),
width, df_readable (negate_used, used,
buf[1], input_units, output_units),
width, df_readable (negate_available, available,
buf[2], input_units, output_units));
-----------------------------------------------------------------
example df output:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 18864128 7476720 11387408 40% /
-------------------------------------------------------------------And indeed we set "used" as a shell variable in test 004 from df but don't seem to do anything with it. I think we should check it to verify that we have set bfree correctly. Cheers, Tim. David Chinner wrote: Ping? |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Work Opportunity, Anglican Mission House |
|---|---|
| Next by Date: | Re: iov_iter_fault_in_readable fix, Dmitriy Monakhov |
| Previous by Thread: | Re: Review: fix test 004 to account for reserved space, Timothy Shimmin |
| Next by Thread: | Re: Review: fix test 004 to account for reserved space, Christoph Hellwig |
| Indexes: | [Date] [Thread] [Top] [All Lists] |