History

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs

Pull btrfs updates from Chris Mason: "This is against 3.11-rc7, but was pulled and tested against your tree as of yesterday. We do have two small incrementals queued up, but I wanted to get this bunch out the door before I hop on an airplane. This is a fairly large batch of fixes, performance improvements, and cleanups from the usual Btrfs suspects. We've included Stefan Behren's work to index subvolume UUIDs, which is targeted at speeding up send/receive with many subvolumes or snapshots in place. It closes a long standing performance issue that was built in to the disk format. Mark Fasheh's offline dedup work is also here. In this case offline means the FS is mounted and active, but the dedup work is not done inline during file IO. This is a building block where utilities are able to ask the FS to dedup a series of extents. The kernel takes care of verifying the data involved really is the same. Today this involves reading both extents, but we'll continue to evolve the patches" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (118 commits) Btrfs: optimize key searches in btrfs_search_slot Btrfs: don't use an async starter for most of our workers Btrfs: only update disk_i_size as we remove extents Btrfs: fix deadlock in uuid scan kthread Btrfs: stop refusing the relocation of chunk 0 Btrfs: fix memory leak of uuid_root in free_fs_info btrfs: reuse kbasename helper btrfs: return btrfs error code for dev excl ops err Btrfs: allow partial ordered extent completion Btrfs: convert all bug_ons in free-space-cache.c Btrfs: add support for asserts Btrfs: adjust the fs_devices->missing count on unmount Btrf: cleanup: don't check for root_refs == 0 twice Btrfs: fix for patch "cleanup: don't check the same thing twice" Btrfs: get rid of one BUG() in write_all_supers() Btrfs: allocate prelim_ref with a slab allocater Btrfs: pass gfp_t to __add_prelim_ref() to avoid always using GFP_ATOMIC Btrfs: fix race conditions in BTRFS_IOC_FS_INFO ioctl Btrfs: fix race between removing a dev and writing sbs Btrfs: remove ourselves from the cluster list under lock ...

Linus Torvalds committed 13 years ago

Commit b7c09ad2 parents 1812997 d7396f043 files · +4045 −2352Browse files

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

Unified · Split

include/uapi/linux/btrfs.h+29−1
@@ -305,6 +305,31 @@ struct btrfs_ioctl_clone_range_args { · 304 unmodified lines
305305 #define BTRFS_DEFRAG_RANGE_COMPRESS 1
306306 #define BTRFS_DEFRAG_RANGE_START_IO 2
307307
308+#define BTRFS_SAME_DATA_DIFFERS 1
309+/* For extent-same ioctl */
310+struct btrfs_ioctl_same_extent_info {
311+ __s64 fd; /* in - destination file */
312+ __u64 logical_offset; /* in - start of extent in destination */
313+ __u64 bytes_deduped; /* out - total # of bytes we were able
314+ * to dedupe from this file */
315+ /* status of this dedupe operation:
316+ * 0 if dedup succeeds
317+ * < 0 for error
318+ * == BTRFS_SAME_DATA_DIFFERS if data differs
319+ */
320+ __s32 status; /* out - see above description */
321+ __u32 reserved;
322+};
323+
324+struct btrfs_ioctl_same_args {
325+ __u64 logical_offset; /* in - start of extent in source */
326+ __u64 length; /* in - length of extent */
327+ __u16 dest_count; /* in - total elements in info array */
328+ __u16 reserved1;
329+ __u32 reserved2;
330+ struct btrfs_ioctl_same_extent_info info[0];
331+};
332+
308333 struct btrfs_ioctl_space_info {
309334 __u64 flags;
310335 __u64 total_bytes;
@@ -524,7 +549,7 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code) · 213 unmodified lines
524549 struct btrfs_ioctl_search_args)
525550 #define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, \
526551 struct btrfs_ioctl_ino_lookup_args)
527−#define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, u64)
552+#define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, __u64)
528553 #define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \
529554 struct btrfs_ioctl_space_args)
530555 #define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64)
@@ -579,4 +604,7 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code) · 48 unmodified lines
579604 struct btrfs_ioctl_get_dev_stats)
580605 #define BTRFS_IOC_DEV_REPLACE _IOWR(BTRFS_IOCTL_MAGIC, 53, \
581606 struct btrfs_ioctl_dev_replace_args)
607+#define BTRFS_IOC_FILE_EXTENT_SAME _IOWR(BTRFS_IOCTL_MAGIC, 54, \
608+ struct btrfs_ioctl_same_args)
609+
582610 #endif /* _UAPI_LINUX_BTRFS_H */