btrfs-progs: add option to run balance as daemon
authorAustin S. Hemmelgarn <ahferroin7@gmail.com>
Tue, 21 Jun 2016 15:16:59 +0000 (11:16 -0400)
committerDavid Sterba <dsterba@suse.com>
Tue, 26 Jul 2016 17:26:29 +0000 (19:26 +0200)
commitfe520b5cdc46bc7f34d55b16292d5be805ffd339
tree661b1fec603b30711be21fa13e88e5fc208580be
parent1d6c7cb725bb7d25981d44915b316e24751b7b72
btrfs-progs: add option to run balance as daemon

Currently, balance operations are run synchronously in the foreground.
This is nice for interactive management, but is kind of crappy when you
start looking at automation and similar things.

This patch adds an option to `btrfs balance start` to tell it to
daemonize prior to running the balance operation, thus allowing us to
preform balances asynchronously.  The two biggest use cases I have for
this are starting a balance on a remote server without establishing a
full shell session, and being able to background the balance in a
recovery shell (which usually has no job control) so I can still get
progress information.

Because it simply daemonizes prior to calling the balance ioctl, this
doesn't actually need any kernel support.

Signed-off-by: Austin S. Hemmelgarn <ahferroin7@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Documentation/btrfs-balance.asciidoc
cmds-balance.c