btrfs-progs/common
David Sterba e198c6674a btrfs-progs: add enqueue parameter for exclusive ops
The exclusive ops will not start if there's one already running. Now
that we have the sysfs export (since kernel 5.10) to check if there's
one already running, use it to allow enqueueing of the operations as a
convenience.

Supported enqueuing:

  btrfs balance start --enqueue
  btrfs filesystem resize --enqueue
  btrfs device add --enqueue
  btrfs device delete --enqueue
  btrfs replace start --enqueue

This patch implements the functionality based on Goldwyn's patch
https://lore.kernel.org/linux-btrfs/?q=20200825150338.32610-4-rgoldwyn%40suse.de
but on top of previous preparatory patches.

Note that 'filesystem resize' options could confuse getopt as the
negative size change looks like a series of short options and there's no
way to make getopt ignore the short options, so there's a custom option
parser.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.de>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-12-16 17:08:12 +01:00
..
box.h btrfs-progs: build most common tools into one binary (busybox style) 2019-07-04 15:30:40 +02:00
defs.h btrfs-progs: move common-defs to common/ 2020-03-31 18:37:35 +02:00
device-scan.c btrfs-progs: move volumes.c to kernel-shared/ 2020-08-31 17:01:06 +02:00
device-scan.h btrfs-progs: refactor btrfs_scan_devices() to accept verbose argument 2020-06-12 19:31:58 +02:00
device-utils.c btrfs-progs: move disk-io.c to kernel-shared/ 2020-08-31 17:01:05 +02:00
device-utils.h btrfs-progs: utils: split device handling functions to own file 2019-07-04 02:06:34 +02:00
extent-cache.c btrfs-progs: move extent-cache.c to common/ 2020-08-31 17:01:04 +02:00
extent-cache.h btrfs-progs: move extent-cache.c to common/ 2020-08-31 17:01:04 +02:00
format-output.c btrfs-progs: move common-defs to common/ 2020-03-31 18:37:35 +02:00
format-output.h btrfs-progs: lots of typo fixes (codespell) 2020-03-31 18:37:38 +02:00
fsfeatures.c btrfs-progs: mkfs: refactor how we handle sectorsize override 2020-12-10 17:10:30 +01:00
fsfeatures.h btrfs-progs: mkfs: refactor how we handle sectorsize override 2020-12-10 17:10:30 +01:00
help.c btrfs-progs: split global help HELPINFO_INSERT_GLOBALS 2020-06-12 19:30:36 +02:00
help.h btrfs-progs: add global verbose and quiet options and helper functions 2020-06-12 19:30:43 +02:00
internal.h btrfs-progs: move internal.h to common/ 2019-07-03 20:49:03 +02:00
messages.c btrfs-progs: add global verbose and quiet options and helper functions 2020-06-12 19:30:43 +02:00
messages.h btrfs-progs: add separate verbosity level for on-by-default messages 2020-06-12 19:32:29 +02:00
path-utils.c btrfs-progs: move path_cat_out helpers to path-utils 2020-11-04 23:26:43 +01:00
path-utils.h btrfs-progs: move path_cat_out helpers to path-utils 2020-11-04 23:26:43 +01:00
rbtree-utils.c btrfs-progs: move rbtree-utils.[ch] to common/ 2019-07-03 20:49:04 +02:00
rbtree-utils.h btrfs-progs: move rbtree-utils.[ch] to common/ 2019-07-03 20:49:04 +02:00
send-stream.c btrfs-progs: move send-stream.c to common/ 2020-08-31 17:01:04 +02:00
send-stream.h btrfs-progs: move send-stream.c to common/ 2020-08-31 17:01:04 +02:00
send-utils.c btrfs-progs: move path_cat_out helpers to path-utils 2020-11-04 23:26:43 +01:00
send-utils.h btrfs-progs: move ctree.c to kernel-shared/ 2020-08-31 17:01:05 +02:00
string-table.c btrfs-progs: move string-table.[ch] to common/ 2019-07-03 20:49:03 +02:00
string-table.h btrfs-progs: move string-table.[ch] to common/ 2019-07-03 20:49:03 +02:00
task-utils.c btrfs-progs: move task-utils.[ch] to common/ 2019-07-03 20:49:03 +02:00
task-utils.h btrfs-progs: move task-utils.[ch] to common/ 2019-07-03 20:49:03 +02:00
utils-lib.c btrfs-progs: move ctree.c to kernel-shared/ 2020-08-31 17:01:05 +02:00
utils.c btrfs-progs: add enqueue parameter for exclusive ops 2020-12-16 17:08:12 +01:00
utils.h btrfs-progs: add enqueue parameter for exclusive ops 2020-12-16 17:08:12 +01:00