From: "Josef 'Jeff' Sipek" <jeffpc@josefsipek.net>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: xfs mailing list <xfs@oss.sgi.com>
Subject: Re: [PATCH, RFC] xfstests: random fallocate calls in fsx
Date: Wed, 3 Jun 2009 19:19:39 -0400 [thread overview]
Message-ID: <20090603231939.GA9167@josefsipek.net> (raw)
In-Reply-To: <4A0B420E.3070908@sandeen.net>
Good idea.
On Wed, May 13, 2009 at 04:56:30PM -0500, Eric Sandeen wrote:
> Seems to work for me. Any comments/suggestions?
>
> I can probably make it fall back to the xfs ioctl if fallocate
> isn't supported, if strongly desired.
Is the ioctl going away anytime soon? If not, it might be worth having fsx
use _both_ if possible, or just the ioctl if fallocate doesn't seem to be
available.
> @@ -770,6 +788,64 @@ dotruncate(unsigned size)
> }
> }
>
> +#ifdef FALLOCATE
> +/* fallocate is basically a no-op unless extending, then a lot like a truncate */
> +void
> +dofallocate(unsigned offset, unsigned length)
> +{
> + unsigned end_offset;
> + int keep_size;
> +
> + if (length == 0) {
> + if (!quiet && testcalls > simulatedopcount)
> + prt("skipping zero length fallocate\n");
> + log4(OP_SKIPPED, OP_FALLOCATE, offset, length);
> + return;
> + }
> +
> + keep_size = random() % 2;
> +
> + end_offset = keep_size ? 0 : offset + length;
I prefer seeing explicit ( ) in this case.
...
--
Reality is merely an illusion, albeit a very persistent one.
- Albert Einstein
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2009-06-03 23:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-13 21:56 [PATCH, RFC] xfstests: random fallocate calls in fsx Eric Sandeen
2009-06-03 20:46 ` Eric Sandeen
2009-06-03 23:19 ` Josef 'Jeff' Sipek [this message]
2009-07-27 2:46 ` Eric Sandeen
2010-03-31 4:58 ` Eric Sandeen
2010-03-31 5:41 ` Dave 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=20090603231939.GA9167@josefsipek.net \
--to=jeffpc@josefsipek.net \
--cc=sandeen@sandeen.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox