summaryrefslogtreecommitdiff
path: root/ioctl.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-11-18 11:26:35 -0500
committerChris Mason <chris.mason@oracle.com>2008-11-18 11:26:35 -0500
commit6c771595afad6e04c25b5adaea8ffbbbfe9c728c (patch)
tree57abff520ec457c8493c2d9ccaf7696fb51196be /ioctl.h
parent4d1d3a59d6debe80ce1e2da60e82233ab8f1f886 (diff)
Modify the subvol and snapshot creation ioctls to work anywhere in the tree
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>
Diffstat (limited to 'ioctl.h')
-rw-r--r--ioctl.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/ioctl.h b/ioctl.h
index 85ed35a7..5fb2ad18 100644
--- a/ioctl.h
+++ b/ioctl.h
@@ -18,13 +18,15 @@
#ifndef __IOCTL_
#define __IOCTL_
+#include <asm/types.h>
#include <linux/ioctl.h>
#define BTRFS_IOCTL_MAGIC 0x94
#define BTRFS_VOL_NAME_MAX 255
-#define BTRFS_PATH_NAME_MAX 4095
+#define BTRFS_PATH_NAME_MAX 3072
struct btrfs_ioctl_vol_args {
+ __s64 fd;
char name[BTRFS_PATH_NAME_MAX + 1];
};
@@ -51,5 +53,7 @@ struct btrfs_ioctl_vol_args {
struct btrfs_ioctl_vol_args)
#define BTRFS_IOC_BALANCE _IOW(BTRFS_IOCTL_MAGIC, 12, \
struct btrfs_ioctl_vol_args)
-
+/* 13 is for CLONE_RANGE */
+#define BTRFS_IOC_SUBVOL_CREATE _IOW(BTRFS_IOCTL_MAGIC, 14, \
+ struct btrfs_ioctl_vol_args)
#endif