40
40
#ifdef __KERNEL__
41
41
#include <linux/compat.h>
42
42
#endif
43
+ #include <uapi/linux/ext4.h>
43
44
44
45
#include <linux/fscrypt.h>
45
46
#include <linux/fsverity.h>
@@ -591,17 +592,6 @@ static inline void ext4_check_flag_values(void)
591
592
CHECK_FLAG_VALUE (RESERVED );
592
593
}
593
594
594
- /* Used to pass group descriptor data when online resize is done */
595
- struct ext4_new_group_input {
596
- __u32 group ; /* Group number for this data */
597
- __u64 block_bitmap ; /* Absolute block number of block bitmap */
598
- __u64 inode_bitmap ; /* Absolute block number of inode bitmap */
599
- __u64 inode_table ; /* Absolute block number of inode table start */
600
- __u32 blocks_count ; /* Total number of blocks in this group */
601
- __u16 reserved_blocks ; /* Number of reserved blocks in this group */
602
- __u16 unused ;
603
- };
604
-
605
595
#if defined(__KERNEL__ ) && defined(CONFIG_COMPAT )
606
596
struct compat_ext4_new_group_input {
607
597
u32 group ;
@@ -698,70 +688,6 @@ enum {
698
688
#define EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER 0x0020
699
689
#define EXT4_FREE_BLOCKS_RERESERVE_CLUSTER 0x0040
700
690
701
- /*
702
- * ioctl commands
703
- */
704
- #define EXT4_IOC_GETVERSION _IOR('f', 3, long)
705
- #define EXT4_IOC_SETVERSION _IOW('f', 4, long)
706
- #define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION
707
- #define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION
708
- #define EXT4_IOC_GETRSVSZ _IOR('f', 5, long)
709
- #define EXT4_IOC_SETRSVSZ _IOW('f', 6, long)
710
- #define EXT4_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long)
711
- #define EXT4_IOC_GROUP_ADD _IOW('f', 8, struct ext4_new_group_input)
712
- #define EXT4_IOC_MIGRATE _IO('f', 9)
713
- /* note ioctl 10 reserved for an early version of the FIEMAP ioctl */
714
- /* note ioctl 11 reserved for filesystem-independent FIEMAP ioctl */
715
- #define EXT4_IOC_ALLOC_DA_BLKS _IO('f', 12)
716
- #define EXT4_IOC_MOVE_EXT _IOWR('f', 15, struct move_extent)
717
- #define EXT4_IOC_RESIZE_FS _IOW('f', 16, __u64)
718
- #define EXT4_IOC_SWAP_BOOT _IO('f', 17)
719
- #define EXT4_IOC_PRECACHE_EXTENTS _IO('f', 18)
720
- /* ioctl codes 19--39 are reserved for fscrypt */
721
- #define EXT4_IOC_CLEAR_ES_CACHE _IO('f', 40)
722
- #define EXT4_IOC_GETSTATE _IOW('f', 41, __u32)
723
- #define EXT4_IOC_GET_ES_CACHE _IOWR('f', 42, struct fiemap)
724
- #define EXT4_IOC_CHECKPOINT _IOW('f', 43, __u32)
725
- #define EXT4_IOC_GETFSUUID _IOR('f', 44, struct fsuuid)
726
- #define EXT4_IOC_SETFSUUID _IOW('f', 44, struct fsuuid)
727
-
728
- #define EXT4_IOC_SHUTDOWN _IOR ('X', 125, __u32)
729
-
730
- /*
731
- * Flags for going down operation
732
- */
733
- #define EXT4_GOING_FLAGS_DEFAULT 0x0 /* going down */
734
- #define EXT4_GOING_FLAGS_LOGFLUSH 0x1 /* flush log but not data */
735
- #define EXT4_GOING_FLAGS_NOLOGFLUSH 0x2 /* don't flush log nor data */
736
-
737
- /*
738
- * Flags returned by EXT4_IOC_GETSTATE
739
- *
740
- * We only expose to userspace a subset of the state flags in
741
- * i_state_flags
742
- */
743
- #define EXT4_STATE_FLAG_EXT_PRECACHED 0x00000001
744
- #define EXT4_STATE_FLAG_NEW 0x00000002
745
- #define EXT4_STATE_FLAG_NEWENTRY 0x00000004
746
- #define EXT4_STATE_FLAG_DA_ALLOC_CLOSE 0x00000008
747
-
748
- /* flags for ioctl EXT4_IOC_CHECKPOINT */
749
- #define EXT4_IOC_CHECKPOINT_FLAG_DISCARD 0x1
750
- #define EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT 0x2
751
- #define EXT4_IOC_CHECKPOINT_FLAG_DRY_RUN 0x4
752
- #define EXT4_IOC_CHECKPOINT_FLAG_VALID (EXT4_IOC_CHECKPOINT_FLAG_DISCARD | \
753
- EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT | \
754
- EXT4_IOC_CHECKPOINT_FLAG_DRY_RUN)
755
-
756
- /*
757
- * Structure for EXT4_IOC_GETFSUUID/EXT4_IOC_SETFSUUID
758
- */
759
- struct fsuuid {
760
- __u32 fsu_len ;
761
- __u32 fsu_flags ;
762
- __u8 fsu_uuid [];
763
- };
764
-
765
691
#if defined(__KERNEL__ ) && defined(CONFIG_COMPAT )
766
692
/*
767
693
* ioctl commands in 32 bit emulation
@@ -776,12 +702,6 @@ struct fsuuid {
776
702
#define EXT4_IOC32_SETVERSION_OLD FS_IOC32_SETVERSION
777
703
#endif
778
704
779
- /*
780
- * Returned by EXT4_IOC_GET_ES_CACHE as an additional possible flag.
781
- * It indicates that the entry in extent status cache is for a hole.
782
- */
783
- #define EXT4_FIEMAP_EXTENT_HOLE 0x08000000
784
-
785
705
/* Max physical block we can address w/o extents */
786
706
#define EXT4_MAX_BLOCK_FILE_PHYS 0xFFFFFFFF
787
707
@@ -852,15 +772,6 @@ struct ext4_inode {
852
772
__le32 i_projid ; /* Project ID */
853
773
};
854
774
855
- struct move_extent {
856
- __u32 reserved ; /* should be zero */
857
- __u32 donor_fd ; /* donor file descriptor */
858
- __u64 orig_start ; /* logical start offset in block for orig */
859
- __u64 donor_start ; /* logical start offset in block for donor */
860
- __u64 len ; /* block length to be moved */
861
- __u64 moved_len ; /* moved block length */
862
- };
863
-
864
775
#define EXT4_EPOCH_BITS 2
865
776
#define EXT4_EPOCH_MASK ((1 << EXT4_EPOCH_BITS) - 1)
866
777
#define EXT4_NSEC_MASK (~0UL << EXT4_EPOCH_BITS)
0 commit comments