Linux filesystem development
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Eli Carter <eli.carter@inet.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: File perforation.
Date: Wed, 08 Jan 2003 23:14:59 +0000	[thread overview]
Message-ID: <23586.1042067699@passion.cambridge.redhat.com> (raw)
In-Reply-To: <3E1CAC90.6050303@inet.com>


eli.carter@inet.com said:
>  On a compressed fs like jffs2, wouldn't a block of 0's compress down
> to  next-to-nothing already? 

Well, sort of. In fact each page would get zlib-compressed down to about 
40-odd bytes of payload and a datanode header of 70-odd bytes. 

> Can the fs recognize a big block of 0's and make it sparse on-the-fly
> without needing the user to specify it?  (On block-based fs's, that
> might not always be desirable due to out-of-space errors on modifying
> a  file, but for a compressed fs, that's not a new issue.) 

Yeah -- JFFS2 has a special compression type for a datanode payload which 
is all zeroes, but doesn't currently _detect_ that in a write, it only gets 
used for holes. I was dubious about adding a check for all zeroes before 
falling back to zlib, since it'll slow down the common case where we write 
non-zero data. I suppose we could always compare _after_ zlib compression 
though :)

The other thing about hole nodes (i.e. nodes with this special compression
type and hence no actual compressed data payload on the medium) is that
they're an exception to the rule that data nodes may not cross a page
boundary. So when we write zeroes to a file, even if we fix the compression
to notice and use JFFS2_COMPR_ZERO instead of zlib hence have no data
payload on the nodes, we still get a 70-odd-byte node header for every
(typ.) 4KiB, whereas with a 'proper' hole we'd write out a single node to
cover the whole range.

I suppose we could also munge the garbage collection to notice adjacent hole
nodes and merge them... on the whole, I think I prefer sys_perforate()
though.

--
dwmw2



  reply	other threads:[~2003-01-08 23:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-08 22:06 File perforation David Woodhouse
2003-01-08 22:28 ` Eli Carter
2003-01-08 22:34   ` David Woodhouse
2003-01-08 22:56     ` Eli Carter
2003-01-08 23:14       ` David Woodhouse [this message]
2003-01-09  1:22         ` Andrew Morton
2003-01-09  3:23           ` Andreas Dilger
2003-01-08 23:17     ` Steven Whitehouse
2003-01-08 23:16       ` David Woodhouse
2003-01-08 23:36         ` Steven Whitehouse
2003-01-08 23:25           ` David Woodhouse
2003-01-10  1:39         ` Bryan Henderson
2003-01-08 22:45 ` Dave Kleikamp
2003-01-08 22:55 ` Matthew Wilcox
2003-01-08 23:02   ` David Woodhouse
2003-01-11  9:47   ` Christoph Hellwig
2003-01-10  1:34 ` Bryan Henderson
  -- strict thread matches above, loose matches on Subject: below --
2003-01-10 22:24 Steven French
2003-01-11  1:46 ` Bryan Henderson
2003-01-13  3:52 Steven French

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=23586.1042067699@passion.cambridge.redhat.com \
    --to=dwmw2@infradead.org \
    --cc=eli.carter@inet.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /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