The definition of the function open_file_or_dir() is moved from common.c
to utils.c in order to be able to share some common code between scrub
and the device stats in the following step. That common code uses
open_file_or_dir(). Since open_file_or_dir() makes use of the function
dirfd(3), the required XOPEN version was raised from 6 to 7.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Original-Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Add user space commands for btrfs send/receive.
Signed-off-by: Alexander Block <ablock84@googlemail.com>
Reviewed-by: David Sterba <dave@jikos.cz>
Reviewed-by: Arne Jansen <sensille@gmx.net>
Reviewed-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Reviewed-by: Alex Lyakas <alex.bolshoy.btrfs@gmail.com>
Add balance command group under both 'btrfs' and 'btrfs filesystem'.
Preserve the old 'btrfs filesystem balance <path>' behaviour.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
The new infrastructure offloads checking number of arguments passed to a
command to individual command handlers. Fix them up accordingly.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This completely replaces the existing subcommand infrastructure, which
is not flexible enough to accomodate our needs. Instead of a global
command table we now have per-level tables and command group handlers,
which allows command-group-specific handling of options and subcommands.
The new parser exports a clear interface and gets out of the way - all
control over how matching is done is passed to commands and command
group handlers.
One side effect of this is that command implementors have to check the
number of arguments themselves - patch to fix up all existing commands
follows.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>