From: "Yan, Zheng " <yanzheng@21cn.com>
To: Peter Macko <pmacko@eecs.harvard.edu>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Question about back references
Date: Mon, 7 Sep 2009 17:41:50 +0800 [thread overview]
Message-ID: <3d0408630909070241x78f043fdu9bf3f1ddd41a4ddd@mail.gmail.com> (raw)
In-Reply-To: <4AA2C7E6.40200@eecs.harvard.edu>
2009/9/6 Peter Macko <pmacko@eecs.harvard.edu>:
> I am trying to understand how exactly the file extent back references work
> in btrfs. Can please someone tell me if the following is correct? - The back
> references are accumulated in an in-memory balanced tree (delayed-ref.c and
> delayed-ref.h) and pushed to disk during the transaction commit (a part of a
> checkpoint). They are placed into the B-tree under the key (bytenr,
> BTRFS_EXTENT_REF_KEY, hash of the four fields of the record), so that they
> are stored next to the file extent forward references.
>
This was correct for btrfs in 2.6.30 and earlier version. We introduced a new
back references format in 2.6.31. For more information about the new format,
please read the comments in extent-tree.c
> I am also wondering about the implications of copy on write: Imagine that
> you have an inode with four file extents and thus also four back references.
> COW of one of the extents then causes the COW of the inode. The new version
> of the inode has a different transaction ID, which is also one of the fields
> of back reference records. This causes the file system to add four new back
> reference records - one for the modified extent and three for the unmodified
> ones (since the transaction ID field has to be updated). Does this really
> happen, or is there some scheme to avoid adding these extra records?
>
It's avoid by using the new back references format.
Yan, Zheng
next prev parent reply other threads:[~2009-09-07 9:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-05 20:19 Question about back references Peter Macko
2009-09-07 9:41 ` Yan, Zheng [this message]
2009-09-08 21:40 ` Peter Macko
2009-09-10 12:54 ` Chris Mason
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=3d0408630909070241x78f043fdu9bf3f1ddd41a4ddd@mail.gmail.com \
--to=yanzheng@21cn.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=pmacko@eecs.harvard.edu \
/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