All of lore.kernel.org
 help / color / mirror / Atom feed
From: "K. Richard Pixley" <rich@noir.com>
To: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: synchronous removal?
Date: Sun, 01 Aug 2010 14:11:15 -0700	[thread overview]
Message-ID: <4C55E2F3.3030202@noir.com> (raw)

  I have an application where I want to snapshot, then do something, and 
based on the result, snapshot either the result or the previous state 
and then repeat.

So far, so good.  But eventually my disk fills and I want to remove the 
oldest snapshots, as many as I need to in order to make room enough for 
the next cycle.

I notice that when I remove old snapshots and delete old directories, 
the free space on my disk, (according to df), doesn't rise immediately.  
But instead, I see an active btrfs_cleaner for a while and my free space 
rises while it runs.  I'm presuming that the removed files and snapshots 
aren't fully reclaimed immediately but rather wait for something akin to 
a garbage collection much the way modern berkeley file systems do.

How can I either:

a) wait for the cleaner to digest the free space
b) determine that the cleaner has digested all available free space for 
now, (if not I can sleep for a while)
c) synchronously force the cleaner to digest available free space
d) something else I haven't thought of yet

Basically, I want to check to see if there's enough space available.  If 
not, I want to remove some things, (including at least one snapshot), 
wait for the cleaner to digest, and then start over with the checking to 
see if there's enough space available and loop until I've removed enough 
things that there is enough space available.  How can I do that on a 
btrfs file system?

--rich

             reply	other threads:[~2010-08-01 21:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-01 21:11 K. Richard Pixley [this message]
2010-08-02 11:35 ` synchronous removal? Leonidas Spyropoulos
2010-08-02 15:25   ` K. Richard Pixley
2011-03-08  8:36     ` Andreas Philipp
2010-08-02 15:02 ` Bruce Guenter
2010-08-02 15:29   ` K. Richard Pixley

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=4C55E2F3.3030202@noir.com \
    --to=rich@noir.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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.