From: Jens Axboe <axboe@kernel.dk>
To: Eric Gouriou <egouriou@google.com>
Cc: fio@vger.kernel.org, Nauman Rafique <nauman@google.com>,
Daniel Ehrenberg <dehrenberg@google.com>
Subject: Re: [PATCH] Add fallocate_keep_size option and functionality
Date: Tue, 14 Jun 2011 21:58:53 +0200 [thread overview]
Message-ID: <4DF7BD7D.3040708@kernel.dk> (raw)
In-Reply-To: <1308080427-31011-1-git-send-email-egouriou@google.com>
On 2011-06-14 21:40, Eric Gouriou wrote:
> Linux offers fallocate() and the FALLOC_FL_KEEP_SIZE option as
> an alternative to posix_fallocate(). When FALLOC_FL_KEEP_SIZE is
> specified for an falloc request going beyond the end of the file,
> the requested blocks get preallocated without changing the apparent
> size of the file. This is is a commonly recommended use of fallocate()
> for workloads performing append writes.
>
> On systems where FALLOC_FL_KEEP_SIZE is available (i.e., Linux at this
> time), this patch add a fallocate_keep_size option, which is off by
> default. When *both* the options fallocate and fallocate_keep_size are
> set, then fallocate() will be used with FALLOC_FL_KEEP_SIZE set,
> instead of the default posix_fallocate().
>
> Signed-off-by: Eric Gouriou <egouriou@google.com>
> ---
> I tried to follow the existing style and practices. I am wondering
> whether introducing 'fallocate_keep_size' is the best way, or whether
> I should have changed the existing 'fallocate' option from a boolean
> option to a string option. Let me know what you think.
Perhaps we could use just the one option, and have 0/1 retain they
meaning and add "keep" or something as the new variant. Other than that,
just one comment:
> diff --git a/helpers.c b/helpers.c
> index 377dd02..0da2fd7 100644
> --- a/helpers.c
> +++ b/helpers.c
> @@ -14,6 +14,11 @@ int __weak posix_fallocate(int fd, off_t offset, off_t len)
> {
> return 0;
> }
> +
> +int __weak fallocate(int fd, int mode, off_t offset, off_t len)
> +{
> + return 0;
> +}
> #endif
Say we have posix_fallocate() and not fallocate(), have it call
posix_fallocate()?
--
Jens Axboe
next prev parent reply other threads:[~2011-06-14 19:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-14 19:40 [PATCH] Add fallocate_keep_size option and functionality Eric Gouriou
2011-06-14 19:58 ` Jens Axboe [this message]
2011-06-15 1:08 ` Eric Gouriou
2011-06-16 20:57 ` [PATCH v2] Add ability to invoke fallocate() FALLOC_FL_KEEP_SIZE Eric Gouriou
2011-06-17 7:14 ` Jens Axboe
2011-06-17 19:11 ` Eric Gouriou
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=4DF7BD7D.3040708@kernel.dk \
--to=axboe@kernel.dk \
--cc=dehrenberg@google.com \
--cc=egouriou@google.com \
--cc=fio@vger.kernel.org \
--cc=nauman@google.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.