linux/include/uapi/linux/cramfs_fs.h

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI__CRAMFS_H
#define _UAPI__CRAMFS_H

#include <linux/types.h>
#include <linux/magic.h>

#define CRAMFS_SIGNATURE

/*
 * Width of various bitfields in struct cramfs_inode.
 * Primarily used to generate warnings in mkcramfs.
 */
#define CRAMFS_MODE_WIDTH
#define CRAMFS_UID_WIDTH
#define CRAMFS_SIZE_WIDTH
#define CRAMFS_GID_WIDTH
#define CRAMFS_NAMELEN_WIDTH
#define CRAMFS_OFFSET_WIDTH

/*
 * Since inode.namelen is a unsigned 6-bit number, the maximum cramfs
 * path length is 63 << 2 = 252.
 */
#define CRAMFS_MAXPATHLEN

/*
 * Reasonably terse representation of the inode data.
 */
struct cramfs_inode {};

struct cramfs_info {};

/*
 * Superblock information at the beginning of the FS.
 */
struct cramfs_super {};

/*
 * Feature flags
 *
 * 0x00000000 - 0x000000ff: features that work for all past kernels
 * 0x00000100 - 0xffffffff: features that don't work for past kernels
 */
#define CRAMFS_FLAG_FSID_VERSION_2
#define CRAMFS_FLAG_SORTED_DIRS
#define CRAMFS_FLAG_HOLES
#define CRAMFS_FLAG_WRONG_SIGNATURE
#define CRAMFS_FLAG_SHIFTED_ROOT_OFFSET
#define CRAMFS_FLAG_EXT_BLOCK_POINTERS

/*
 * Valid values in super.flags.  Currently we refuse to mount
 * if (flags & ~CRAMFS_SUPPORTED_FLAGS).  Maybe that should be
 * changed to test super.future instead.
 */
#define CRAMFS_SUPPORTED_FLAGS

/*
 * Block pointer flags
 *
 * The maximum block offset that needs to be represented is roughly:
 *
 *   (1 << CRAMFS_OFFSET_WIDTH) * 4 +
 *   (1 << CRAMFS_SIZE_WIDTH) / PAGE_SIZE * (4 + PAGE_SIZE)
 *   = 0x11004000
 *
 * That leaves room for 3 flag bits in the block pointer table.
 */
#define CRAMFS_BLK_FLAG_UNCOMPRESSED
#define CRAMFS_BLK_FLAG_DIRECT_PTR

#define CRAMFS_BLK_FLAGS

/*
 * Direct blocks are at least 4-byte aligned.
 * Pointers to direct blocks are shifted down by 2 bits.
 */
#define CRAMFS_BLK_DIRECT_PTR_SHIFT

#endif /* _UAPI__CRAMFS_H */