History

btrfs: add "no file data" flag to btrfs send ioctl

This patch adds the flag, BTRFS_SEND_FLAG_NO_FILE_DATA to the btrfs send ioctl code. When this flag is set, the btrfs send code will never write file data into the stream (thus also avoiding expensive reads of that data in the first place). BTRFS_SEND_C_UPDATE_EXTENT commands will be sent (instead of BTRFS_SEND_C_WRITE) with an offset, length pair indicating the extent in question. This patch does not affect the operation of BTRFS_SEND_C_CLONE commands - they will continue to be sent when a search finds an appropriate extent to clone from.

Mark Fasheh committed 13 years ago

Commit cb95e7b1 parent 2f697dc3 files · +54 −4Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/btrfs.h+7−0
@@ -407,6 +407,13 @@ struct btrfs_ioctl_received_subvol_args { · 406 unmodified lines
407407 __u64 reserved[16]; /* in */
408408 };
409409
410+/*
411+ * Caller doesn't want file data in the send stream, even if the
412+ * search of clone sources doesn't find an extent. UPDATE_EXTENT
413+ * commands will be sent instead of WRITE commands.
414+ */
415+#define BTRFS_SEND_FLAG_NO_FILE_DATA 0x1
416+
410417 struct btrfs_ioctl_send_args {
411418 __s64 send_fd; /* in */
412419 __u64 clone_sources_count; /* in */