All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: clinew@onid.orst.edu
Cc: fio@vger.kernel.org, kcastiglia@aereo.com
Subject: Re: [PATCH] Fix fallocate erroneously returning ENOSYS on Linux systems
Date: Tue, 31 Jul 2012 22:22:13 +0200	[thread overview]
Message-ID: <50183E75.8040705@kernel.dk> (raw)
In-Reply-To: <20120731124922.18191l6yyd1pno4k@webmail.oregonstate.edu>

On 07/31/2012 09:49 PM, clinew@onid.orst.edu wrote:
> Currently, the helpers.c file provides a function defintion for Linux fallocate
> that sets errno to ENOSYS and returns failure; this is useful for a non-Linux
> OS. However, this definition will override the Linux implementation of
> fallocate when 'fallocate=keep' is set. Adding a preprocessor macro to check
> if Linux fallocate is defined fixes this issue.
> 
> Signed-off-by: Wade Cline <wcline@us.ibm.com>
> ---
>  helpers.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/helpers.c b/helpers.c
> index 9562567..714842e 100644
> --- a/helpers.c
> +++ b/helpers.c
> @@ -9,11 +9,13 @@
>  #include "arch/arch.h"
>  #include "os/os.h"
> 
> +#ifndef FIO_HAVE_LINUX_FALLOCATE
>  int _weak fallocate(int fd, int mode, off_t offset, off_t len)
>  {
>         errno = ENOSYS;
>         return -1;
>  }
> +#endif

Hmm, the purpose of the _weak would be to NOT override a fallocate() if
we have one. Why isn't this working?

-- 
Jens Axboe


  reply	other threads:[~2012-07-31 20:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-31 19:49 [PATCH] Fix fallocate erroneously returning ENOSYS on Linux systems clinew
2012-07-31 20:22 ` Jens Axboe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-07-31 20:57 clinew
2012-08-01  6:45 ` Jens Axboe

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=50183E75.8040705@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=clinew@onid.orst.edu \
    --cc=fio@vger.kernel.org \
    --cc=kcastiglia@aereo.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.