All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Peter Macko <pmacko@eecs.harvard.edu>
Cc: "Yan, Zheng " <yanzheng@21cn.com>, linux-btrfs@vger.kernel.org
Subject: Re: Question about back references
Date: Thu, 10 Sep 2009 08:54:44 -0400	[thread overview]
Message-ID: <20090910125444.GF5106@think> (raw)
In-Reply-To: <4AA6CF37.3090206@eecs.harvard.edu>

On Tue, Sep 08, 2009 at 05:40:07PM -0400, Peter Macko wrote:
> Thanks! I have a follow up question: Are back references reference
> counted? If so, this should mean that after the file system COWs an
> inode, it must increase the reference counts of its file extent back
> references. Do we know what is the overhead? In the case they are
> not reference counted, how does the system know when to drop the
> reference?

The reference counts live in a tree that is maintained via cow
but not reference counted.

> 
> What are the bookend extents? Is the number of bookend requests in
> the fourth field of a file extent back reference  the number of
> times the extent occurs within the file?

bookends are how we do cow with large extents without needing to read in
the entire large extent.

Picture a large 128MB extent where you want to overwrite 4K in the
middle.  What we do is create two pointers to the original extent, and
then make a new extent for the new 4K mod.  Our pointers end up like
this:

[ old extent part 1 ] [ new 4k extent ] [ old extent part 2 ]

A future mod will be to split and modify the old extent when we know
there aren't any other reference holders on it.  The bookend system
assumes that a given extent is in use by multiple snapshots, where we
aren't allowed to change the actual extent records because it is in use in
other places.

-chris

      reply	other threads:[~2009-09-10 12:54 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 
2009-09-08 21:40   ` Peter Macko
2009-09-10 12:54     ` Chris Mason [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=20090910125444.GF5106@think \
    --to=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=pmacko@eecs.harvard.edu \
    --cc=yanzheng@21cn.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.