1/*
2 * Copyright 2020, Shubham Bhagat, shubhambhagat111@yahoo.com
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef _XFS_TYPES_H_
6#define _XFS_TYPES_H_
7
8#include "system_dependencies.h"
9
10/*
11Reference documentation:
12https://mirrors.edge.kernel.org/pub/linux/utils/fs/xfs/docs
13/xfs_filesystem_structure.pdf
14
15Chapter 5: Common XFS types		(Page 8)
16
17These are on-disk data types (how the data is stored on disk)
18*/
19
20
21typedef uint64 xfs_ino_t;		// absolute inode number
22typedef int64 xfs_off_t;		// file offset
23typedef int64 xfs_daddr_t;		// device address
24typedef uint32 xfs_agnumber_t;	// Allocation Group (AG) number
25typedef uint32 xfs_agblock_t;	// AG relative block number
26typedef uint32 xfs_extlen_t;	// extent length in blocks
27typedef int32 xfs_extnum_t;		// number of extends in a file
28typedef int16 xfs_aextnum_t;	// number of extents in an attribute fork
29typedef uint32	xfs_dablk_t;	// block number for directories
30								// and extended attributes
31typedef uint32	xfs_dahash_t;	// hash of a directory file name
32								// or extended attribute name
33typedef uint64 xfs_fsblock_t;	// filesystem block number combining AG number
34typedef uint64 xfs_rfsblock_t;	// raw filesystem block number
35typedef uint64 xfs_rtblock_t;	// extent number in the real-time sub-volume
36typedef uint64 xfs_fileoff_t;	// block offset into a file
37typedef uint64 xfs_filblks_t;	// block count for a file
38typedef int64 xfs_fsize_t;		// byte size of a file
39typedef int64 xfs_lsn_t;		// log sequence number
40typedef xfs_fileoff_t TreeKey;
41typedef xfs_fsblock_t TreePointer;
42
43// typedef unsigned char uuid_t[16];
44
45#endif
46