linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Gao Xiang via Linux-erofs <linux-erofs@lists.ozlabs.org>
To: Pratik Shinde <pratikshinde320@gmail.com>
Cc: linux-erofs@lists.ozlabs.org
Subject: Re: Support for uncompressed sparse files.
Date: Mon, 25 Nov 2019 03:10:02 +0800	[thread overview]
Message-ID: <20191124190959.GA2029@hsiangkao-HP-ZHAN-66-Pro-G1> (raw)
In-Reply-To: <CAGu0czTT=s8xU0uLruAE3a3jnPDd_eQS290u45OACYrb3Z3L0Q@mail.gmail.com>

Hi Pratik,

On Mon, Nov 25, 2019 at 12:00:28AM +0530, Pratik Shinde wrote:
> Hi Gao,
> 
> In the current design, for uncompressed files, we only maintain the
> starting block address.because rest of the data blocks will follow it
> (continuous allocation).
> For sparse files we have to do following
> 1) We don't want to allocate space for holes (Holes will be multiple of
> EROFS_BLKSZ ?)
> 2) For read() operation on holes, return null data  = '\0'.
> 
> I have few thoughts about it:
> 1) Without changing the current design much, we want to keep track of holes
> in file.
>     e.g maintaining some table OR bitmap(per inode), to check if given
> offset falls inside hole or real data.
> 2) Accordingly changing the readpage() aop.
> 
> Let me know you thoughts on this.

I think it's roughly correct. Assume that holes aren't greatly fragmented,
I think it's useful to introduce extent table format rather than
some bitmap for sparse inodes.

Maybe we can start off with RFC PATCH of sparse files for mkfs, and thus
we can have common sense with on-disk format as well.

Thanks,
Gao Xiang

> 
> --Pratik.
> 
> On Sun, Nov 17, 2019 at 11:01 PM Gao Xiang <hsiangkao@aol.com> wrote:
> 
> > Hi Pratik,
> >
> > On Sun, Nov 17, 2019 at 03:40:43PM +0530, Pratik Shinde wrote:
> > > Hello Gao,
> > >
> > > I have started working on above functionality for erofs.
> > > First thing we need to do is detect sparse files & determine location of
> > > holes in it.
> > >
> > > I was thinking of using lseek() with SEEK_HOLE & SEEK_DATA for detecting
> > > holes.
> > > Let me know what you think about the approach OR any other better
> > approach
> > > in your mind.
> > >
> > > PS : support for SEEK_HOLE & SEEK_DATA came in 3.4 kernel.
> >
> > That is a good start to detect sparse files by SEEK_HOLE & SEEK_DATA.
> >
> > And as the first step, we need to design the on-disk extent format
> > for uncompressed sparse files. Is there some preliminary proposed
> > ideas for this as well? :-) (I'm not sure whether Chao is busy in
> > other stuffs now, we'd get in line with sparse on-disk format.)
> >
> > Thanks,
> > Gao Xiang
> >
> >

      reply	other threads:[~2019-11-24 19:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-17 10:10 Support for uncompressed sparse files Pratik Shinde
2019-11-17 17:30 ` Gao Xiang via Linux-erofs
2019-11-24 18:30   ` Pratik Shinde
2019-11-24 19:10     ` Gao Xiang via Linux-erofs [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=20191124190959.GA2029@hsiangkao-HP-ZHAN-66-Pro-G1 \
    --to=linux-erofs@lists.ozlabs.org \
    --cc=hsiangkao@aol.com \
    --cc=pratikshinde320@gmail.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 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).