linux/include/uapi/linux/ext4.h

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */

#ifndef _UAPI_LINUX_EXT4_H
#define _UAPI_LINUX_EXT4_H
#include <linux/fiemap.h>
#include <linux/fs.h>
#include <linux/ioctl.h>
#include <linux/types.h>

/*
 * ext4-specific ioctl commands
 */
#define EXT4_IOC_GETVERSION
#define EXT4_IOC_SETVERSION
#define EXT4_IOC_GETVERSION_OLD
#define EXT4_IOC_SETVERSION_OLD
#define EXT4_IOC_GETRSVSZ
#define EXT4_IOC_SETRSVSZ
#define EXT4_IOC_GROUP_EXTEND
#define EXT4_IOC_GROUP_ADD
#define EXT4_IOC_MIGRATE
 /* note ioctl 10 reserved for an early version of the FIEMAP ioctl */
 /* note ioctl 11 reserved for filesystem-independent FIEMAP ioctl */
#define EXT4_IOC_ALLOC_DA_BLKS
#define EXT4_IOC_MOVE_EXT
#define EXT4_IOC_RESIZE_FS
#define EXT4_IOC_SWAP_BOOT
#define EXT4_IOC_PRECACHE_EXTENTS
/* ioctl codes 19--39 are reserved for fscrypt */
#define EXT4_IOC_CLEAR_ES_CACHE
#define EXT4_IOC_GETSTATE
#define EXT4_IOC_GET_ES_CACHE
#define EXT4_IOC_CHECKPOINT
#define EXT4_IOC_GETFSUUID
#define EXT4_IOC_SETFSUUID

#define EXT4_IOC_SHUTDOWN

/*
 * ioctl commands in 32 bit emulation
 */
#define EXT4_IOC32_GETVERSION
#define EXT4_IOC32_SETVERSION
#define EXT4_IOC32_GETRSVSZ
#define EXT4_IOC32_SETRSVSZ
#define EXT4_IOC32_GROUP_EXTEND
#define EXT4_IOC32_GROUP_ADD
#define EXT4_IOC32_GETVERSION_OLD
#define EXT4_IOC32_SETVERSION_OLD

/*
 * Flags returned by EXT4_IOC_GETSTATE
 *
 * We only expose to userspace a subset of the state flags in
 * i_state_flags
 */
#define EXT4_STATE_FLAG_EXT_PRECACHED
#define EXT4_STATE_FLAG_NEW
#define EXT4_STATE_FLAG_NEWENTRY
#define EXT4_STATE_FLAG_DA_ALLOC_CLOSE

/*
 * Flags for ioctl EXT4_IOC_CHECKPOINT
 */
#define EXT4_IOC_CHECKPOINT_FLAG_DISCARD
#define EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT
#define EXT4_IOC_CHECKPOINT_FLAG_DRY_RUN
#define EXT4_IOC_CHECKPOINT_FLAG_VALID

/*
 * Structure for EXT4_IOC_GETFSUUID/EXT4_IOC_SETFSUUID
 */
struct fsuuid {};

/*
 * Structure for EXT4_IOC_MOVE_EXT
 */
struct move_extent {};

/*
 * Flags used by EXT4_IOC_SHUTDOWN
 */
#define EXT4_GOING_FLAGS_DEFAULT
#define EXT4_GOING_FLAGS_LOGFLUSH
#define EXT4_GOING_FLAGS_NOLOGFLUSH

/* Used to pass group descriptor data when online resize is done */
struct ext4_new_group_input {};

/*
 * Returned by EXT4_IOC_GET_ES_CACHE as an additional possible flag.
 * It indicates that the entry in extent status cache is for a hole.
 */
#define EXT4_FIEMAP_EXTENT_HOLE

#endif /* _UAPI_LINUX_EXT4_H */