linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* synchronous removal?
@ 2010-08-01 21:11 K. Richard Pixley
  2010-08-02 11:35 ` Leonidas Spyropoulos
  2010-08-02 15:02 ` Bruce Guenter
  0 siblings, 2 replies; 6+ messages in thread
From: K. Richard Pixley @ 2010-08-01 21:11 UTC (permalink / raw)
  To: linux-btrfs@vger.kernel.org

  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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-03-08  8:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-01 21:11 synchronous removal? K. Richard Pixley
2010-08-02 11:35 ` 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

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).