This is the user mode part of the device replace patch series.
The command group "btrfs replace" is added with three commands:
- btrfs replace start srcdev|srcdevid targetdev [-Bfr] mount_point
- btrfs replace status mount_point [-1]
- btrfs replace cancel mount_point
Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
"btrfs device stats" is used to retrieve and print the device stats.
"btrfs device stats -z" is used to atomically retrieve, reset and
print the stats.
Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
This command will be used by things like dracut that wish to know very
simply if all of the devices have been added to the kernel cache yet for the
device to be fully mounted. This keeps initrd's from constantly having to
try to mount the file system until it succeeds every time a device is added
to the system. Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Gene Czarcinski <gene@czarc.net>
Btrfs send/receive and btrfs props needs this ioctl. This patch
requires a recent kernel with the "Btrfs: use _IOR for
BTRFS_IOC_SUBVOL_GETFLAGS" patch applied.
Signed-off-by: Alexander Block <ablock84@googlemail.com>
two new commands that make use of the new path resolving functions
implemented for scrub, doing the resolving in-kernel. the result for both
commands is a list of files belonging to that inode / logical address.
Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
- scrub structs added
- ioctls for scrub
- BTRFS_FSID_SIZE moved
Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
Added BTRFS_IOC_SNAP_CREATE_V2 and struct btrfs_ioctl_vol_args_v2 as
defined in fs/btrfs/ioctl.h in the kernel sources.
Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
[Btrfs-Progs][V2] Update for lzo support
- Add incompat flag, otherwise btrfs-progs will report error
when operating on btrfs filesystems mounted with lzo option.
- Update man page.
- Allow to turn on lzo compression for defrag operation:
# btrfs filesystem defragment -c[zlib, lzo] <file>
Note: "-c zlib" will fail, because that's how getopt() works
for optional arguments.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
btrfs-subvol find-new <subvol> <id> will search through a given subvol
and print out all the files with extents newer than a given id.
Care must be taken to make sure any pending delalloc is on disk before
running this because that won't show up in the output.
This goes along with the new space info ioctl. This will spit out the space
info all nice and pretty with the type, it's flags (DUP, RAID) and how much
space is in that group and how much is in use.
Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.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>
The structure used to send device in btrfs ioctl calls was not
properly aligned, and so 32 bit ioctls would not work properly on
64 bit kernels.
We could fix this with compat ioctls, but we're just one byte away
and it doesn't make sense at this stage to carry about the compat ioctls
forever at this stage in the project.
This patch brings the ioctl arg up to an evenly aligned 4k.
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>
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.