From: Joel Becker <Joel.Becker@oracle.com>
To: jim owens <jowens@hp.com>
Cc: Christoph Hellwig <hch@infradead.org>,
Mark Fasheh <mfasheh@suse.com>,
linux-fsdevel@vger.kernel.org
Subject: Re: [RFC][PATCH 0/5] Fiemap, an extent mapping ioctl
Date: Thu, 29 May 2008 11:56:16 -0700 [thread overview]
Message-ID: <20080529185616.GA2655@mail.oracle.com> (raw)
In-Reply-To: <483ECCB5.5060909@hp.com>
On Thu, May 29, 2008 at 11:33:09AM -0400, jim owens wrote:
> Christoph Hellwig wrote:
>>
>> What use is there geeting the extent count for a range? I'd rather
>> do it only per-file like the xfs ioctl.
>
> I'll answer that from practical experience. Our api equivalents:
>
> __u64 fm_start; /* logical offset (inclusive) at
> * which to start mapping (in) */
> __u64 fm_length; /* logical length of mapping which
> * userspace cares about (in) */
> __u32 fm_extent_count; /* size of fm_extents array (in) */
> __u32 fm_mapped_extents; /* number of extents that were
> * mapped (out) */
>
> ... note it has no flags field and no separate ioctl_extent_count.
>
> "fm_extent_count" is
> IN == max_extents to return.
> OUT == number of extents remaining in-range after fm_mapped_extents
>
> Pass in fm_extent_count==0 and you get OUT number of extent entries
> within your fm_start + fm_length range. Which you can use to set
> your malloc size because the FS can have massive extent counts :(
See, that's a very natural API. I'd be much happier with that -
"extent_count == 0" is consistent with no extent structures passed in.
It also fits with many other API that do it the same way (eg, snprintf).
Joel
--
"I don't know anything about music. In my line you don't have
to."
- Elvis Presley
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127
next prev parent reply other threads:[~2008-05-29 19:00 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-25 0:01 [RFC][PATCH 0/5] Fiemap, an extent mapping ioctl Mark Fasheh
2008-05-25 19:42 ` Christoph Hellwig
2008-05-25 20:59 ` Brad Boyer
2008-05-26 10:59 ` Andreas Dilger
2008-05-26 18:04 ` Brad Boyer
2008-05-27 16:45 ` Christoph Hellwig
2008-05-27 21:10 ` Mark Fasheh
2008-05-27 13:48 ` Chris Mason
2008-05-27 16:21 ` Eric Sandeen
2008-05-27 16:47 ` Christoph Hellwig
2008-05-27 20:34 ` Joel Becker
2008-05-27 16:52 ` jim owens
2008-05-27 17:19 ` Chris Mason
2008-05-28 16:09 ` Andreas Dilger
2008-05-28 16:33 ` Chris Mason
2008-05-29 22:01 ` Andreas Dilger
2008-05-30 13:37 ` Chris Mason
2008-05-29 13:01 ` Christoph Hellwig
2008-05-29 20:17 ` Andreas Dilger
2008-05-27 18:56 ` Mark Fasheh
2008-05-27 20:31 ` Joel Becker
2008-05-27 20:49 ` Mark Fasheh
2008-05-28 5:14 ` Christoph Hellwig
2008-05-28 16:02 ` Andreas Dilger
2008-05-28 17:04 ` Joel Becker
2008-05-29 0:51 ` Dave Chinner
2008-05-29 13:02 ` Christoph Hellwig
2008-05-29 15:33 ` jim owens
2008-05-29 15:53 ` Jamie Lokier
2008-05-29 18:56 ` Joel Becker [this message]
2008-05-29 21:41 ` Andreas Dilger
2008-05-29 21:47 ` Joel Becker
2008-05-29 23:20 ` Andreas Dilger
2008-05-29 1:17 ` Andreas Dilger
2008-05-29 5:55 ` Christoph Hellwig
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=20080529185616.GA2655@mail.oracle.com \
--to=joel.becker@oracle.com \
--cc=hch@infradead.org \
--cc=jowens@hp.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mfasheh@suse.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.