Skip to content

Commit 33ca913

Browse files
jeffmahoneykdave
authored andcommitted
btrfs: uapi/linux/btrfs.h migration, move struct btrfs_ioctl_defrag_range_args
struct btrfs_ioctl_defrag_range_args is used by the BTRFS_IOC_DEFRAG_RANGE ioctl. Signed-off-by: Jeff Mahoney <[email protected]> Reviewed-by: Liu Bo <[email protected]> Reviewed-by: Josef Bacik <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 04cd01d commit 33ca913

File tree

2 files changed

+37
-32
lines changed

2 files changed

+37
-32
lines changed

fs/btrfs/ctree.h

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,37 +1992,6 @@ struct btrfs_root {
19921992
atomic_t qgroup_meta_rsv;
19931993
};
19941994

1995-
struct btrfs_ioctl_defrag_range_args {
1996-
/* start of the defrag operation */
1997-
__u64 start;
1998-
1999-
/* number of bytes to defrag, use (u64)-1 to say all */
2000-
__u64 len;
2001-
2002-
/*
2003-
* flags for the operation, which can include turning
2004-
* on compression for this one defrag
2005-
*/
2006-
__u64 flags;
2007-
2008-
/*
2009-
* any extent bigger than this will be considered
2010-
* already defragged. Use 0 to take the kernel default
2011-
* Use 1 to say every single extent must be rewritten
2012-
*/
2013-
__u32 extent_thresh;
2014-
2015-
/*
2016-
* which compression method to use if turning on compression
2017-
* for this defrag operation. If unspecified, zlib will
2018-
* be used
2019-
*/
2020-
__u32 compress_type;
2021-
2022-
/* spare for later */
2023-
__u32 unused[4];
2024-
};
2025-
20261995

20271996
/*
20281997
* inode items have the data typically returned from stat and store other

include/uapi/linux/btrfs.h

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,45 @@ struct btrfs_ioctl_clone_range_args {
474474
__u64 dest_offset;
475475
};
476476

477-
/* flags for the defrag range ioctl */
477+
/*
478+
* flags definition for the defrag range ioctl
479+
*
480+
* Used by:
481+
* struct btrfs_ioctl_defrag_range_args.flags
482+
*/
478483
#define BTRFS_DEFRAG_RANGE_COMPRESS 1
479484
#define BTRFS_DEFRAG_RANGE_START_IO 2
485+
struct btrfs_ioctl_defrag_range_args {
486+
/* start of the defrag operation */
487+
__u64 start;
488+
489+
/* number of bytes to defrag, use (u64)-1 to say all */
490+
__u64 len;
491+
492+
/*
493+
* flags for the operation, which can include turning
494+
* on compression for this one defrag
495+
*/
496+
__u64 flags;
497+
498+
/*
499+
* any extent bigger than this will be considered
500+
* already defragged. Use 0 to take the kernel default
501+
* Use 1 to say every single extent must be rewritten
502+
*/
503+
__u32 extent_thresh;
504+
505+
/*
506+
* which compression method to use if turning on compression
507+
* for this defrag operation. If unspecified, zlib will
508+
* be used
509+
*/
510+
__u32 compress_type;
511+
512+
/* spare for later */
513+
__u32 unused[4];
514+
};
515+
480516

481517
#define BTRFS_SAME_DATA_DIFFERS 1
482518
/* For extent-same ioctl */

0 commit comments

Comments
 (0)