github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/fs_ioctl.txt (about)

     1  # Copyright 2018 syzkaller project authors. All rights reserved.
     2  # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  include <uapi/linux/fiemap.h>
     5  include <uapi/linux/fs.h>
     6  include <uapi/linux/fsmap.h>
     7  include <linux/falloc.h>
     8  
     9  ioctl$FIBMAP(fd fd, cmd const[FIBMAP], arg ptr[in, int32])
    10  ioctl$FIGETBSZ(fd fd, cmd const[FIGETBSZ], arg ptr[out, intptr])
    11  ioctl$FITRIM(fd fd, cmd const[FITRIM], arg ptr[in, fstrim_range])
    12  ioctl$FICLONE(fd fd, cmd const[FICLONE], arg fd)
    13  ioctl$FICLONERANGE(fd fd, cmd const[FICLONERANGE], arg ptr[in, file_clone_range])
    14  ioctl$FIDEDUPERANGE(fd fd, cmd const[FIDEDUPERANGE], arg ptr[in, file_dedupe_range])
    15  
    16  ioctl$FS_IOC_GETFLAGS(fd fd, cmd const[FS_IOC_GETFLAGS], arg ptr[out, flags[fs_flags, int32]])
    17  ioctl$FS_IOC_SETFLAGS(fd fd, cmd const[FS_IOC_SETFLAGS], arg ptr[in, flags[fs_flags, int32]])
    18  
    19  ioctl$FS_IOC_GETVERSION(fd fd, cmd const[FS_IOC_GETVERSION], arg ptr[out, intptr])
    20  ioctl$FS_IOC_SETVERSION(fd fd, cmd const[FS_IOC_SETVERSION], arg ptr[in, intptr])
    21  ioctl$FS_IOC_FIEMAP(fd fd, cmd const[FS_IOC_FIEMAP], v ptr[in, fiemap])
    22  ioctl$FS_IOC_RESVSP(fd fd, cmd const[FS_IOC_RESVSP], arg ptr[in, space_resv])
    23  ioctl$FS_IOC_FSGETXATTR(fd fd, cmd const[FS_IOC_FSGETXATTR], arg ptr[in, fsxattr])
    24  ioctl$FS_IOC_FSSETXATTR(fd fd, cmd const[FS_IOC_FSSETXATTR], arg ptr[in, fsxattr])
    25  ioctl$FS_IOC_GETFSLABEL(fd fd, cmd const[FS_IOC_GETFSLABEL], arg ptr[out, array[const[0, int8], FSLABEL_MAX]])
    26  ioctl$FS_IOC_SETFSLABEL(fd fd, cmd const[FS_IOC_SETFSLABEL], arg ptr[in, array[int8, FSLABEL_MAX]])
    27  ioctl$FS_IOC_GETFSMAP(fd fd, cmd const[FS_IOC_GETFSMAP], arg ptr[in, fsmap_head])
    28  
    29  space_resv {
    30  	l_type		const[0, int16]
    31  	l_whence	flags[seek_whence, int16]
    32  	l_start		int64
    33  	l_len		int64
    34  	l_sysid		const[0, int32]
    35  	l_pid		const[0, int32]
    36  	l_pad		array[const[0, int32], 4]
    37  }
    38  
    39  fstrim_range {
    40  	start	int64
    41  	len	int64
    42  	minlen	int64
    43  }
    44  
    45  file_clone_range {
    46  	src_fd		align64[fd]
    47  	src_offset	int64
    48  	src_length	int64
    49  	dest_offset	int64
    50  }
    51  
    52  file_dedupe_range {
    53  	src_offset	int64
    54  	src_length	int64
    55  	dest_count	len[info, int16]
    56  	reserved1	const[0, int16]
    57  	reserved2	const[0, int32]
    58  	info		array[file_dedupe_range_info]
    59  }
    60  
    61  file_dedupe_range_info {
    62  	dest_fd		align64[fd]
    63  	dest_offset	int64
    64  	bytes_deduped	const[0, int64]
    65  	status		const[0, int32]
    66  	reserved	const[0, int32]
    67  }
    68  
    69  fsxattr {
    70  	fsx_xflags	int32
    71  	fsx_extsize	int32
    72  	fsx_nextents	int32
    73  	fsx_projid	int32
    74  	fsx_cowextsize	int32
    75  	fsx_pad		array[const[0, int8], 8]
    76  }
    77  
    78  fiemap {
    79  	start	int64
    80  	len	int64
    81  	flags	flags[fiemap_flags, int32]
    82  	mapped	int32
    83  	count	len[extent, int32]
    84  	extent	array[fiemap_extent]
    85  }
    86  
    87  fiemap_extent {
    88  	fe_logical	int64
    89  	fe_physical	int64
    90  	fe_length	int64
    91  	fe_reserved64	array[const[0, int64], 2]
    92  	fe_flags	flags[fiemap_extent_flags, int32]
    93  	fe_reserved	array[const[0, int32], 3]
    94  }
    95  
    96  fsmap_head {
    97  	fmh_iflags	const[0, int32]
    98  	fmh_oflags	const[0, int32]
    99  	fmh_count	len[fmh_recs, int32]
   100  	fmh_entries	const[0, int32]
   101  	fmh_reserved	array[const[0, int64], 6]
   102  	fmh_keys	array[fsmap, 2]
   103  	fmh_recs	array[array[const[0, int8], FSMAP_SIZE]]
   104  }
   105  
   106  fsmap {
   107  	fmr_device	int32
   108  	fmr_flags	int32
   109  	fmr_physical	int64
   110  	fmr_owner	int64
   111  	fmr_offset	int64
   112  	fmr_length	int64
   113  	fmr_reserved	array[const[0, int64], 3]
   114  }
   115  
   116  fs_flags = FS_SECRM_FL, FS_UNRM_FL, FS_COMPR_FL, FS_SYNC_FL, FS_IMMUTABLE_FL, FS_APPEND_FL, FS_NODUMP_FL, FS_NOATIME_FL, FS_DIRTY_FL, FS_COMPRBLK_FL, FS_NOCOMP_FL, FS_ENCRYPT_FL, FS_BTREE_FL, FS_INDEX_FL, FS_IMAGIC_FL, FS_JOURNAL_DATA_FL, FS_NOTAIL_FL, FS_DIRSYNC_FL, FS_TOPDIR_FL, FS_HUGE_FILE_FL, FS_EXTENT_FL, FS_VERITY_FL, FS_EA_INODE_FL, FS_EOFBLOCKS_FL, FS_NOCOW_FL, FS_DAX_FL, FS_INLINE_DATA_FL, FS_PROJINHERIT_FL, FS_CASEFOLD_FL, FS_RESERVED_FL
   117  
   118  define FSMAP_SIZE	sizeof(struct fsmap)