core.sys.linux.fs

D header file for the linux/fs.h interface.

This file has definitions for some important file table structures and constants and structures used by various generic file system ioctl's.

Types 8

structfile_clone_range
Fields
long src_fd
ulong src_offset
ulong src_length
ulong dest_offset
structfstrim_range
Fields
ulong start
ulong len
ulong minlen
structfile_dedupe_range_info

from struct btrfs_ioctl_file_extent_same_info

Fields
long dest_fd
ulong dest_offset
ulong bytes_deduped
int statusstatus of this dedupe operation: < 0 for error == FILEDEDUPERANGESAME if dedupe succeeds == FILEDEDUPERANGEDIFFERS if data differs
uint reserved
structfile_dedupe_range

from struct btrfs_ioctl_file_extent_same_args

Fields
ulong src_offset
ulong src_length
ushort dest_count
ushort reserved1
uint reserved2
file_dedupe_range_info[0] info
structfiles_stat_struct

And dynamically-tunable limits and defaults:

Fields
c_ulong nr_files
c_ulong nr_free_files
c_ulong max_files
structinodes_stat_t
Fields
c_long nr_inodes
c_long nr_unused
c_long[5] dummy
structfsxattr

Structure for FS_IOC_FSGETXATTR[A] and FS_IOC_FSSETXATTR.

Fields
uint fsx_xflags
uint fsx_extsize
uint fsx_nextents
uint fsx_projid
uint fsx_cowextsize
ubyte[8] fsx_pad
alias__kernel_rwf_t = int

Variables 13

enumvarINR_OPEN_CUR = 1024

Initial setting for nfile rlimits

enumvarINR_OPEN_MAX = 4096

Hard limit for nfile rlimits

enumvarBLOCK_SIZE_BITS = 10
enumvarBLOCK_SIZE = 1 << BLOCK_SIZE_BITS
enumvarNR_FILE = 8192
enumvarFSLABEL_MAX = 256

Max chars for the interface; each fs may differ

enumvarFS_FL_USER_VISIBLE = 0x0003DFFF

Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)

Note

for historical reasons, these flags were originally used and

defined for use by ext2/ext3, and then other file systems started using these flags so they wouldn't need to write their own version of chattr/lsattr (which was shipped as part of e2fsprogs). You should think twice before trying to use these flags in new contexts, or trying to assign these flags, since they are used both as the UAPI and the on-disk encoding for ext2/3/4. Also, we are almost out of 32-bit flags. :-)

We have recently hoisted FS_IOC_FSGETXATTR / FS_IOC_FSSETXATTR from XFS to the generic FS level interface. This uses a structure that has padding and hence has more room to grow, so it may be more appropriate for many new use cases. User visible flags

enumvarFS_FL_USER_MODIFIABLE = 0x000380FF

User modifiable flags

enumvarSYNC_FILE_RANGE_WAIT_BEFORE = 1
enumvarSYNC_FILE_RANGE_WRITE = 2
enumvarSYNC_FILE_RANGE_WAIT_AFTER = 4
enumvarSYNC_FILE_RANGE_WRITE_AND_WAIT = SYNC_FILE_RANGE_WRITE | SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WAIT_AFTER
enumvarRWF_SUPPORTED = RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT | RWF_APPEND

mask of flags supported by the kernel