From: Zach Brown <zab@zabbo.net>
To: Matthew Wilcox <matthew@wil.cx>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: Efficient handling of sparse files
Date: Mon, 28 Feb 2005 11:55:54 -0800 [thread overview]
Message-ID: <4223774A.5020906@zabbo.net> (raw)
In-Reply-To: <20050228174149.GA28741@parcelfarce.linux.theplanet.co.uk>
> I was wondering if we could introduce a new system call (or ioctl?) that,
> given an fd would find the next block with data in it. We could use the
> ->bmap method ... except that has dire warnings about adding new callers
> and viro may soon be in testicle-gouging range.
Hmm. What you're talking about reminds me of some ioctl()s Alex has for
ext3+extents and it feels like the pagevec apis that want to find
populated pages across the page cache index space.
Sooo.
struct fs_extent {
u64 file_start;
u64 block_start;
u64 contig;
};
(I don't really care if those are in bytes or blocks or whatever.
someone with strong opinions can pick a unit :))
long sys_find_extents_please(int fd, off_t file_start,
struct fs_extent *extents, long nr_extents);
so it'll fill in as many extent structs in the caller as it finds
contiguous regions on disk starting with the given file position,
returning the number populated.
I'd, somewhat obviously, want to push this into an fs method perhaps
with a generic_ that just spins on bmap().
I think this would let Alex kill his ioctl() and ocfs2 could certainly
fill this with reasonable results.
To move into lala land, I wonder if we would want to consider the
difference between mapped blocks with data and mapped blocks that
haven't been touched and which are going to return zeros. One could
argue that it's marginally ridiculous that there isn't a shared
interface to reserve blocks without having to manually zero them. If we
did have such an interface, something like rsync doesn't actually care
that they're mapped if the fs knows that they're still just zeros. I
acknowledge that this is a bit out there :)
In any case, if you want help rolling proofs-of-concept I could lend a
few hours.
- z
next prev parent reply other threads:[~2005-02-28 19:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-28 17:41 Efficient handling of sparse files Matthew Wilcox
2005-02-28 17:44 ` Jeremy Allison
2005-02-28 20:13 ` Bryan Henderson
2005-02-28 21:49 ` Jamie Lokier
2005-03-01 18:37 ` Bryan Henderson
2005-02-28 18:57 ` Szakacsits Szabolcs
2005-02-28 19:55 ` Zach Brown [this message]
2005-02-28 20:40 ` Anton Altaparmakov
2005-02-28 20:53 ` Zach Brown
2005-03-01 7:50 ` Anton Altaparmakov
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=4223774A.5020906@zabbo.net \
--to=zab@zabbo.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=matthew@wil.cx \
/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.