linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: "Theodore Ts'o" <tytso@MIT.EDU>
Cc: linux-ext4@vger.kernel.org
Subject: Re: Getting direct support for fallocate(2) into glibc
Date: Tue, 09 Dec 2008 10:58:19 -0600	[thread overview]
Message-ID: <493EA3AB.2080308@redhat.com> (raw)
In-Reply-To: <E1L9wQt-0003dz-DE@closure.thunk.org>

Theodore Ts'o wrote:
> Hey Eric,
> 
> Can you or Ric put in a good word with Ulrich (through appropriate Red
> Hat channels, if that would be helpful) for this glibc enhancement request:
> 
> 	http://sources.redhat.com/bugzilla/show_bug.cgi?id=7083
> 
> Given that glibc 2.9 was just released, presumably this won't show up
> until glibc 2.10, and it'll probably be a *long* time before it this
> will show up in real distributions, but it would be good to get this
> into functionality into glibc ASAP.

Hm... I thought it was already there.  posix_fallocate() is indeed
calling sys_fallocate; doing a very simple test:

        fd = open("testfile", O_RDWR|O_CREAT);
        error = posix_fallocate(fd, 0, 16384);

and then asking xfs about the allocation (sorry for the xfs, but
xfs_bmap is still so handy for this...):

# xfs_bmap -vv testfile
testfile:
 EXT: FILE-OFFSET   BLOCK-RANGE        AG AG-OFFSET          TOTAL FLAGS
   0: [0..31]:      34984576..34984607  2 (1256112..1256143)    32 10000
 FLAG Values:
    010000 Unwritten preallocated extent

it looks like it's doing the Right Thing.  This is on:

# rpm -q glibc
glibc-2.9-2.x86_64

... oh, ok, but plain old fallocate() isn't yet hooked up, odd.

# gcc -o test-fallocate test-fallocate.c
/tmp/ccQTk6an.o: In function `main':
test-fallocate.c:(.text+0x3e): undefined reference to `fallocate'

Especially odd because we have a man page shipping, but no actual
implemented interface  :)  OK, I'll go bug people.

-Eric

  reply	other threads:[~2008-12-09 16:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-09  6:50 Getting direct support for fallocate(2) into glibc Theodore Ts'o
2008-12-09 16:58 ` Eric Sandeen [this message]
2008-12-09 17:31   ` Theodore Tso
2008-12-09 18:03     ` Eric Sandeen
2008-12-11 19:00   ` Andreas Dilger

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=493EA3AB.2080308@redhat.com \
    --to=sandeen@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@MIT.EDU \
    /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;
as well as URLs for NNTP newsgroup(s).