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>
When building on ppc64 I hit a number of warnings in printf:
btrfs-map-logical.c:69: error: format ‘%Lu’ expects type ‘long long
unsigned int’, but argument 4 has type ‘u64’
Fix them.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
Hi all,
the patch below deprecates the following programs
* btrfsctl
* btrfs-vol
* btrfs-show
the reason is simple, these programs are superseded by the btrfs utility,
both in terms of documentation, usability and bug. The goal is to avoid
to duplicate codes and avoid update two programs.
The patch adds a warning in the man pages, in the INSTALL file and in the
programs.
$ ./btrfsctl
**
** WARNING: this program is considered deprecated
** Please consider to switch to the btrfs utility
**
no valid commands given
usage: btrfsctl [ -d file|dir] [ -s snap_name subvol|tree ]
[-r size] [-A device] [-a] [-c] [-D dir .]
-d filename: defragments one file
-d directory: defragments the entire Btree
-s snap_name dir: creates a new snapshot of dir
-S subvol_name dir: creates a new subvolume
-r [+-]size[gkm]: resize the FS by size amount
-A device: scans the device file for a Btrfs filesystem
-a: scans all devices for Btrfs filesystems
-c: forces a single FS sync
-D: delete snapshot
-m [tree id] directory: set the default mounted subvolume to the [tree
id] or the
directory
Below the patch, but it is possible to pull the changes from:
http://cassiopea.homelinux.net/git/btrfs-progs-unstable.git
branch
btrfs-deprecated
Comments are welcome.
G.Baroncelli
INSTALL | 5 +++++
btrfs-show.c | 5 +++++
btrfs-vol.c | 5 +++++
btrfsctl.c | 5 +++++
man/btrfs-show.8.in | 3 +++
man/btrfsctl.8.in | 3 +++
6 files changed, 26 insertions(+), 0 deletions(-)
the tool to create a new snapshot for the filesystem.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
For now, btrfsctl does not check whether subvolume name contains slash
or not. If someone specify subvolume with trailing slash (in case
using shell completion), ioctl returns with EINVAL and this error
may confuse some careless users like me. So, this patch adds check
slashes in subvolume name in deletion same as snapshot/subvolume
creating. But considering shell completion, this fix allows trailing
slash.
Signed-off-by: TARUISI Hiroaki <taruishi.hiroak@jp.fujitsu.com>
This introduces a new btrfsctl option, -m, to allow you to set the default'ly
mounted subvolume. You can do
btrfsctl -m /your/subvolume
and that will make that subvolume the subvolume that is mounted by default, or
you can do
btrfsctl -m <treeid> /any/subvolume
and this will make the subvolume with tree id <treeid> the default'ly mounted
subvolume. You can get the treeid by using the listing option. Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
This changes the snapshot and subvol ioctl API and command lines so
that new snapshots and subvols can be created anywhere.
Subvolume creation hasn't changed much:
btrfsctl -S subvol_name directory
This creates a new subvolume under 'directory'
Snapshot creation looks the same, but is actually different:
btrfsctl -s full_path_to_new_snapshot file_or_dir
For example: btrfsctl -s /mnt/new_snap /mnt/subvol
Will create a new snapshot named new_snap under /mnt of the root
found in /mnt/subvol. It always snapshots the entire root regardless of
which file or directory inside the root you give it.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Many options were not mentioned in the usage message, fix that and
cleaning up the brackets
Signed-Off-By: Ahmed Kamal <email.ahmedkamal@googlemail.com>
btrfsctl -c forces a single FS sync
The transaction ioctls are unsafe for general use because they can lead
to deadlocks if the application is not very careful. But, ceph is
experimenting with btrfs as a backing store, and these ioctls are required
for testing.