Skip to content

Commit

Permalink
btrfs: sync some cleanups from progs into uapi/btrfs.h
Browse files Browse the repository at this point in the history
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: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
josefbacik authored and kdave committed Dec 5, 2022
1 parent 162d053 commit a281353
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions include/uapi/linux/btrfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@

#ifndef _UAPI_LINUX_BTRFS_H
#define _UAPI_LINUX_BTRFS_H

#ifdef __cplusplus
extern "C" {
#endif

#include <linux/types.h>
#include <linux/ioctl.h>
#include <linux/fs.h>

#define BTRFS_IOCTL_MAGIC 0x94
#define BTRFS_VOL_NAME_MAX 255
Expand Down Expand Up @@ -333,6 +339,12 @@ struct btrfs_ioctl_feature_flags {
*/
struct btrfs_balance_args {
__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 {
__u64 usage;
struct {
Expand Down Expand Up @@ -549,7 +561,7 @@ struct btrfs_ioctl_search_header {
__u64 offset;
__u32 type;
__u32 len;
};
} __attribute__ ((__may_alias__));

#define BTRFS_SEARCH_ARGS_BUFSIZE (4096 - sizeof(struct btrfs_ioctl_search_key))
/*
Expand All @@ -562,6 +574,10 @@ struct btrfs_ioctl_search_args {
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_key key; /* in/out - search parameters */
__u64 buf_size; /* in - size of buffer
Expand All @@ -570,10 +586,11 @@ struct btrfs_ioctl_search_args_v2 {
__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 {
__s64 src_fd;
__u64 src_offset, src_length;
__u64 dest_offset;
__s64 src_fd;
__u64 src_offset, src_length;
__u64 dest_offset;
};

/*
Expand Down Expand Up @@ -677,8 +694,11 @@ struct btrfs_ioctl_logical_ino_args {
/* struct btrfs_data_container *inodes; out */
__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)

enum btrfs_dev_stat_values {
Expand Down Expand Up @@ -1144,4 +1164,8 @@ enum btrfs_err_code {
#define BTRFS_IOC_ENCODED_WRITE _IOW(BTRFS_IOCTL_MAGIC, 64, \
struct btrfs_ioctl_encoded_io_args)

#ifdef __cplusplus
}
#endif

#endif /* _UAPI_LINUX_BTRFS_H */

0 comments on commit a281353

Please sign in to comment.