linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arne Jansen <sensille@gmx.net>
To: linux-btrfs@vger.kernel.org
Cc: yanzheng@21cn.com
Subject: Purpose of block reserves
Date: Thu, 09 Dec 2010 09:34:52 +0100	[thread overview]
Message-ID: <4D0094AC.6090101@gmx.net> (raw)

Hi,

while reading btrfs source code, I try to make sense of the various uses
of block reserves. The working theory is as follows:

1. Every operation has to reserve upfront every single byte it needs to
   complete its operation fully.
2. If an operation cannot determine how much space it will need, it has
   to be able to cope with running out of space. Normally it does it by
   inserting an orphan item, doing its work in multiple transactions and
   removing the orphan item. The commits in between normally free up enough
   space to continue the operation.
3. All other enospc situations are errors in program logic and should result
   in BUG_ON.

It would be great of someone with a deeper knowledge could correct, expand
or just confirm this.

Thanks,
Arne

             reply	other threads:[~2010-12-09  8:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-09  8:34 Arne Jansen [this message]
2010-12-10  8:37 ` Purpose of block reserves Arne Jansen

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=4D0094AC.6090101@gmx.net \
    --to=sensille@gmx.net \
    --cc=linux-btrfs@vger.kernel.org \
    --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 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).