From: Anton Altaparmakov <aia21@cam.ac.uk>
To: Zach Brown <zab@zabbo.net>
Cc: Matthew Wilcox <matthew@wil.cx>, linux-fsdevel@vger.kernel.org
Subject: Re: Efficient handling of sparse files
Date: Tue, 1 Mar 2005 07:50:16 +0000 (GMT) [thread overview]
Message-ID: <Pine.LNX.4.60.0503010742320.13997@hermes-1.csi.cam.ac.uk> (raw)
In-Reply-To: <422384D7.4060002@zabbo.net>
On Mon, 28 Feb 2005, Zach Brown wrote:
> > Please keep one thing in mind and that is that there are file systems
> > where ->bmap actually makes no sense whatsoever
>
> Of course, so return -ESORRY.
Ah but it gets even worse, ->bmap uses 0 to mean sparse when in NTFS 0 is
a valid block so it cannot be sparse, sparse needs its own namespace
outside 0-2^63-1. Internally in NTFS I use -1 for sparse for example.
> > This is one of the reasons why noone should be using ->bmap. It is a
> > stupid interface that only fits very particular sets of file systems and
> > cannot be applied generically.
>
> No, it's a reason to only ask about the details of block mapping in
> cases where it actually makes sense (like, wanting to find out of
> concurrent file extension is getting good batched contiguous allocation,
> etc). Just because file systems x, y, and z can't answer the question
> meaningfully doesn't mean it isn't a reasonble thing to ask of file
> systems m, n, and o.
>
> Now, I'm not at all opposed to an explicit sparse-testing interface that
> doesn't confuse that functionality with querying specific block mappings.
That's cool. Just an array of zero-data[file offset, length]n would be
sufficient, no? Note I think doing just sparse is not as good as doing
zero-data because on NTFS you can have on-disk blocks allocated but the
file can be marked as empty beyond a certain offset (in that case the
on-disk blocks contain random garbage and the driver just knows to fill in
with zero on read - i.e. no disk access needed at all on reads and to do
actual writes to disk on non-zero write). This is actually used in
Windows by applications (office and outlook for example) that want to have
guaranteed storage allocations (e.g. for the mail INBOX) so deliveries
cannot fail but want to efficiently clear the file contents beyond a
certain offset. I suppose the ntfs driver could simply pretend that this
non-initialized but allocated space is sparse if a
sys_get_sparse_regions() rather than a sys_get_zero_regions() is
implemented so it wouldn't be such a big problem.
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
prev parent reply other threads:[~2005-03-01 7:50 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
2005-02-28 20:40 ` Anton Altaparmakov
2005-02-28 20:53 ` Zach Brown
2005-03-01 7:50 ` Anton Altaparmakov [this message]
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=Pine.LNX.4.60.0503010742320.13997@hermes-1.csi.cam.ac.uk \
--to=aia21@cam.ac.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=zab@zabbo.net \
/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).