Commit a2813530 authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba

btrfs: sync some cleanups from progs into uapi/btrfs.h

When syncing this code into btrfs-progs Dave noticed there's some things
we were losing in the sync that are needed.  This syncs those changes
into the kernel, which include a few comments that weren't in the
kernel, some whitespace changes, an attribute, and the cplusplus bit.
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 162d053e
...@@ -19,8 +19,14 @@ ...@@ -19,8 +19,14 @@
#ifndef _UAPI_LINUX_BTRFS_H #ifndef _UAPI_LINUX_BTRFS_H
#define _UAPI_LINUX_BTRFS_H #define _UAPI_LINUX_BTRFS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <linux/types.h> #include <linux/types.h>
#include <linux/ioctl.h> #include <linux/ioctl.h>
#include <linux/fs.h>
#define BTRFS_IOCTL_MAGIC 0x94 #define BTRFS_IOCTL_MAGIC 0x94
#define BTRFS_VOL_NAME_MAX 255 #define BTRFS_VOL_NAME_MAX 255
...@@ -333,6 +339,12 @@ struct btrfs_ioctl_feature_flags { ...@@ -333,6 +339,12 @@ struct btrfs_ioctl_feature_flags {
*/ */
struct btrfs_balance_args { struct btrfs_balance_args {
__u64 profiles; __u64 profiles;
/*
* usage filter
* BTRFS_BALANCE_ARGS_USAGE with a single value means '0..N'
* BTRFS_BALANCE_ARGS_USAGE_RANGE - range syntax, min..max
*/
union { union {
__u64 usage; __u64 usage;
struct { struct {
...@@ -549,7 +561,7 @@ struct btrfs_ioctl_search_header { ...@@ -549,7 +561,7 @@ struct btrfs_ioctl_search_header {
__u64 offset; __u64 offset;
__u32 type; __u32 type;
__u32 len; __u32 len;
}; } __attribute__ ((__may_alias__));
#define BTRFS_SEARCH_ARGS_BUFSIZE (4096 - sizeof(struct btrfs_ioctl_search_key)) #define BTRFS_SEARCH_ARGS_BUFSIZE (4096 - sizeof(struct btrfs_ioctl_search_key))
/* /*
...@@ -562,6 +574,10 @@ struct btrfs_ioctl_search_args { ...@@ -562,6 +574,10 @@ struct btrfs_ioctl_search_args {
char buf[BTRFS_SEARCH_ARGS_BUFSIZE]; char buf[BTRFS_SEARCH_ARGS_BUFSIZE];
}; };
/*
* Extended version of TREE_SEARCH ioctl that can return more than 4k of bytes.
* The allocated size of the buffer is set in buf_size.
*/
struct btrfs_ioctl_search_args_v2 { struct btrfs_ioctl_search_args_v2 {
struct btrfs_ioctl_search_key key; /* in/out - search parameters */ struct btrfs_ioctl_search_key key; /* in/out - search parameters */
__u64 buf_size; /* in - size of buffer __u64 buf_size; /* in - size of buffer
...@@ -570,10 +586,11 @@ struct btrfs_ioctl_search_args_v2 { ...@@ -570,10 +586,11 @@ struct btrfs_ioctl_search_args_v2 {
__u64 buf[]; /* out - found items */ __u64 buf[]; /* out - found items */
}; };
/* With a @src_length of zero, the range from @src_offset->EOF is cloned! */
struct btrfs_ioctl_clone_range_args { struct btrfs_ioctl_clone_range_args {
__s64 src_fd; __s64 src_fd;
__u64 src_offset, src_length; __u64 src_offset, src_length;
__u64 dest_offset; __u64 dest_offset;
}; };
/* /*
...@@ -677,8 +694,11 @@ struct btrfs_ioctl_logical_ino_args { ...@@ -677,8 +694,11 @@ struct btrfs_ioctl_logical_ino_args {
/* struct btrfs_data_container *inodes; out */ /* struct btrfs_data_container *inodes; out */
__u64 inodes; __u64 inodes;
}; };
/* Return every ref to the extent, not just those containing logical block.
* Requires logical == extent bytenr. */ /*
* Return every ref to the extent, not just those containing logical block.
* Requires logical == extent bytenr.
*/
#define BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET (1ULL << 0) #define BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET (1ULL << 0)
enum btrfs_dev_stat_values { enum btrfs_dev_stat_values {
...@@ -1144,4 +1164,8 @@ enum btrfs_err_code { ...@@ -1144,4 +1164,8 @@ enum btrfs_err_code {
#define BTRFS_IOC_ENCODED_WRITE _IOW(BTRFS_IOCTL_MAGIC, 64, \ #define BTRFS_IOC_ENCODED_WRITE _IOW(BTRFS_IOCTL_MAGIC, 64, \
struct btrfs_ioctl_encoded_io_args) struct btrfs_ioctl_encoded_io_args)
#ifdef __cplusplus
}
#endif
#endif /* _UAPI_LINUX_BTRFS_H */ #endif /* _UAPI_LINUX_BTRFS_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment