linux/fs/xfs/xfs_ioctl32.h

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2004-2005 Silicon Graphics, Inc.
 * All Rights Reserved.
 */
#ifndef __XFS_IOCTL32_H__
#define __XFS_IOCTL32_H__

#include <linux/compat.h>

/*
 * on 32-bit arches, ioctl argument structures may have different sizes
 * and/or alignment.  We define compat structures which match the
 * 32-bit sizes/alignments here, and their associated ioctl numbers.
 *
 * xfs_ioctl32.c contains routines to copy these structures in and out.
 */

/* stock kernel-level ioctls we support */
#define XFS_IOC_GETVERSION_32

/*
 * On intel, even if sizes match, alignment and/or padding may differ.
 */
#if defined(CONFIG_X86_64)
#define BROKEN_X86_ALIGNMENT
#define __compat_packed
#else
#define __compat_packed
#endif

compat_xfs_bstime_t;

struct compat_xfs_bstat {} __compat_packed;

struct compat_xfs_fsop_bulkreq {};

#define XFS_IOC_FSBULKSTAT_32
#define XFS_IOC_FSBULKSTAT_SINGLE_32
#define XFS_IOC_FSINUMBERS_32

compat_xfs_fsop_handlereq_t;

#define XFS_IOC_PATH_TO_FSHANDLE_32
#define XFS_IOC_PATH_TO_HANDLE_32
#define XFS_IOC_FD_TO_HANDLE_32
#define XFS_IOC_OPEN_BY_HANDLE_32
#define XFS_IOC_READLINK_BY_HANDLE_32

/* The bstat field in the swapext struct needs translation */
struct compat_xfs_swapext {} __compat_packed;

#define XFS_IOC_SWAPEXT_32

compat_xfs_fsop_attrlist_handlereq_t;

/* Note: actually this is read/write */
#define XFS_IOC_ATTRLIST_BY_HANDLE_32

/* am_opcodes defined in xfs_fs.h */
compat_xfs_attr_multiop_t;

compat_xfs_fsop_attrmulti_handlereq_t;

#define XFS_IOC_ATTRMULTI_BY_HANDLE_32

#ifdef BROKEN_X86_ALIGNMENT
compat_xfs_fsop_geom_v1_t;

#define XFS_IOC_FSGEOMETRY_V1_32

struct compat_xfs_inogrp {} __attribute__((packed));

/* These growfs input structures have padding on the end, so must translate */
compat_xfs_growfs_data_t;

compat_xfs_growfs_rt_t;

#define XFS_IOC_FSGROWFSDATA_32
#define XFS_IOC_FSGROWFSRT_32

#endif /* BROKEN_X86_ALIGNMENT */

#endif /* __XFS_IOCTL32_H__ */