From: Sidong Yang <realwakka@gmail.com>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>,
Qu Wenruo <quwenruo.btrfs@gmx.com>,
David Sterba <dsterba@suse.cz>
Subject: Re: [PATCH v2] btrfs-progs: cmds: Add subcommand that dumps file extents
Date: Tue, 13 Jul 2021 16:45:32 +0000 [thread overview]
Message-ID: <20210713164532.GA71156@realwakka> (raw)
In-Reply-To: <933cc012-1b8e-3d5c-d8ed-76e81f461d34@suse.com>
On Mon, Jul 12, 2021 at 02:46:39PM +0800, Qu Wenruo wrote:
>
>
> On 2021/7/12 下午2:40, Sidong Yang wrote:
> [...]
> > > > + sk->max_offset = UINT64_MAX;
> > > > + sk->min_transid = 0;
> > > > + sk->max_transid = UINT64_MAX;
> > > > + sk->min_type = sk->max_type = BTRFS_EXTENT_DATA_KEY;
> > > > + sk->nr_items = 4096;
> > >
> > > You may want to do the tree search ioctl in a loop, as it's pretty common
> > > for super large or heavily fragmented inode to have way more items than one
> > > ioctl can return.
> >
> > I don't think much about this. I wonder if it's proper way to search
> > tree. is there any better way than this code?
>
> Here is one example:
>
> https://github.com/kilobyte/compsize/blob/master/compsize.c#L179
>
> It goes @again label to restart from last offset + 1.
Thanks, I read the code you provided. It seems that compsize is also
doing to what this patch do.
The 'do_file' function checks if nr_items is larger than 512. I wonder
that the number '512' is such an magic number. I'll check it by my own
effort.
Thanks,
Sidong
>
> Thanks,
> Qu
>
next prev parent reply other threads:[~2021-07-13 16:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-11 16:10 [PATCH v2] btrfs-progs: cmds: Add subcommand that dumps file extents Sidong Yang
2021-07-12 1:16 ` Qu Wenruo
2021-07-12 6:40 ` Sidong Yang
2021-07-12 6:46 ` Qu Wenruo
2021-07-13 16:45 ` Sidong Yang [this message]
2021-07-12 6:52 ` Johannes Thumshirn
2021-07-13 16:54 ` Sidong Yang
2021-07-13 22:16 ` Qu Wenruo
2021-07-14 6:41 ` Sidong Yang
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=20210713164532.GA71156@realwakka \
--to=realwakka@gmail.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo.btrfs@gmx.com \
--cc=wqu@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox