History

btrfs: new ioctl TREE_SEARCH_V2

This new ioctl call allows the user to supply a buffer of varying size in which a tree search can store its results. This is much more flexible if you want to receive items which are larger than the current fixed buffer of 3992 bytes or if you want to fetch more items at once. Items larger than this buffer are for example some of the type EXTENT_CSUM.

Gerhard Heift committed 12 years ago

Commit cc68a8a1 parent ba346b32 files · +51 −0Browse files

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

Unified · Split

include/uapi/linux/btrfs.h+10−0
@@ -306,6 +306,14 @@ struct btrfs_ioctl_search_args { · 305 unmodified lines
306306 char buf[BTRFS_SEARCH_ARGS_BUFSIZE];
307307 };
308308
309+struct btrfs_ioctl_search_args_v2 {
310+ struct btrfs_ioctl_search_key key; /* in/out - search parameters */
311+ __u64 buf_size; /* in - size of buffer
312+ * out - on EOVERFLOW: needed size
313+ * to store item */
314+ __u64 buf[0]; /* out - found items */
315+};
316+
309317 struct btrfs_ioctl_clone_range_args {
310318 __s64 src_fd;
311319 __u64 src_offset, src_length;
@@ -558,6 +566,8 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code) · 246 unmodified lines
558566 struct btrfs_ioctl_defrag_range_args)
559567 #define BTRFS_IOC_TREE_SEARCH _IOWR(BTRFS_IOCTL_MAGIC, 17, \
560568 struct btrfs_ioctl_search_args)
569+#define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \
570+ struct btrfs_ioctl_search_args_v2)
561571 #define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, \
562572 struct btrfs_ioctl_ino_lookup_args)
563573 #define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, __u64)