linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: "Yan, Zheng " <yanzheng@21cn.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	Zheng <zheng.z.yan@intel.com>
Subject: Re: [RFC] Btrfs design defect in extent backref ?
Date: Fri, 26 Aug 2011 11:04:39 +0800	[thread overview]
Message-ID: <4E570D47.2080207@cn.fujitsu.com> (raw)
In-Reply-To: <CAAM7YA=o0pALbSpHqPHwM+3M2DEmShzxcpUXReVD=vjOt=fhuQ@mail.gmail.com>

Yan, Zheng wrote:
> On Fri, Aug 26, 2011 at 10:00 AM, Li Zefan <lizf@cn.fujitsu.com> wrote:
>> Yan, Zheng wrote:
>>> On Thu, Aug 25, 2011 at 3:56 PM, Li Zefan <lizf@cn.fujitsu.com> wrote:
>>>> We have an offset in file extent to indicate its position in the
>>>> corresponding extent item in extent tree. We also have an offset in
>>>> extent item to indicate the start position of the file extent that
>>>> uses this item.
>>>>
>>>> The math is:
>>>>
>>>>    extent_item.extent_data_ref.offset = file_pos - file_extent.extent_offset.
>>>>
>>>>                       e1
>>>> disk extents:    |--------------|
>>>>                 ^
>>>>                 |                  e2
>>>>                 |          |-----------------|
>>>>                 |          |   ^
>>>>                 |          |   |
>>>>                 v          v   |
>>>> file extents:    |----- f1 -----|----- f2 -----|
>>>>
>>>> So it looks like e2.offset points to f1 not f2. Therefore given an extent item,
>>>> we'll have to search through all the file extents in an inode to find the
>>>> relative file extent in the worst case, which makes this field somewhat useless.
>>>>
>>>
>>> The reason for this is reducing number of file extent backref itmes.
>>
>> It seems to me a rare case, which isn't worth the complexity and inconvenience
>> it brings, and it requires an extra field (.count).
>>
> Random write workload isn't a rare case.
> 

Ah, I was thinking about the clone ioctl, and ignoring other situations.

Thanks for your clarification.

      reply	other threads:[~2011-08-26  3:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25  7:56 [RFC] Btrfs design defect in extent backref ? Li Zefan
2011-08-25  8:47 ` Yan, Zheng 
2011-08-26  2:00   ` Li Zefan
2011-08-26  2:38     ` Yan, Zheng 
2011-08-26  3:04       ` Li Zefan [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=4E570D47.2080207@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=yanzheng@21cn.com \
    --cc=zheng.z.yan@intel.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).