2 * Taken from Linux kernel tree (linux/fs/xfs)
4 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
7 * Copyright (c) 2012 Paulo Alcantara <pcacjr@zytor.com>
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it would be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write the Free Software Foundation,
20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 #include <sys/types.h>
29 typedef enum { B_FALSE
,B_TRUE
} boolean_t
;
30 typedef uint32_t prid_t
; /* project ID */
31 typedef uint32_t inst_t
; /* an instruction */
33 typedef int64_t xfs_off_t
; /* <file offset> type */
34 typedef unsigned long long xfs_ino_t
; /* <inode> type */
35 typedef int64_t xfs_daddr_t
; /* <disk address> type */
36 typedef char * xfs_caddr_t
; /* <core address> type */
37 typedef uint32_t xfs_dev_t
;
38 typedef uint32_t xfs_nlink_t
;
40 /* __psint_t is the same size as a pointer */
41 typedef int32_t __psint_t
;
42 typedef uint32_t __psunsigned_t
;
44 typedef uint32_t xfs_agblock_t
; /* blockno in alloc. group */
45 typedef uint32_t xfs_extlen_t
; /* extent length in blocks */
46 typedef uint32_t xfs_agnumber_t
; /* allocation group number */
47 typedef int32_t xfs_extnum_t
; /* # of extents in a file */
48 typedef int16_t xfs_aextnum_t
; /* # extents in an attribute fork */
49 typedef int64_t xfs_fsize_t
; /* bytes in a file */
50 typedef uint64_t xfs_ufsize_t
; /* unsigned bytes in a file */
52 typedef int32_t xfs_suminfo_t
; /* type of bitmap summary info */
53 typedef int32_t xfs_rtword_t
; /* word type for bitmap manipulations */
55 typedef int64_t xfs_lsn_t
; /* log sequence number */
56 typedef int32_t xfs_tid_t
; /* transaction identifier */
58 typedef uint32_t xfs_dablk_t
; /* dir/attr block number (in file) */
59 typedef uint32_t xfs_dahash_t
; /* dir/attr hash value */
62 * These types are 64 bits on disk but are either 32 or 64 bits in memory.
65 typedef uint64_t xfs_dfsbno_t
; /* blockno in filesystem (agno|agbno) */
66 typedef uint64_t xfs_drfsbno_t
; /* blockno in filesystem (raw) */
67 typedef uint64_t xfs_drtbno_t
; /* extent (block) in realtime area */
68 typedef uint64_t xfs_dfiloff_t
; /* block number in a file */
69 typedef uint64_t xfs_dfilblks_t
; /* number of blocks in a file */
72 * Memory based types are conditional.
74 typedef uint64_t xfs_fsblock_t
; /* blockno in filesystem (agno|agbno) */
75 typedef uint64_t xfs_rfsblock_t
; /* blockno in filesystem (raw) */
76 typedef uint64_t xfs_rtblock_t
; /* extent (block) in realtime area */
77 typedef int64_t xfs_srtblock_t
; /* signed version of xfs_rtblock_t */
79 typedef uint64_t xfs_fileoff_t
; /* block number in a file */
80 typedef int64_t xfs_sfiloff_t
; /* signed block number in a file */
81 typedef uint64_t xfs_filblks_t
; /* number of blocks in a file */
84 * Null values for the types.
86 #define NULLDFSBNO ((xfs_dfsbno_t)-1)
87 #define NULLDRFSBNO ((xfs_drfsbno_t)-1)
88 #define NULLDRTBNO ((xfs_drtbno_t)-1)
89 #define NULLDFILOFF ((xfs_dfiloff_t)-1)
91 #define NULLFSBLOCK ((xfs_fsblock_t)-1)
92 #define NULLRFSBLOCK ((xfs_rfsblock_t)-1)
93 #define NULLRTBLOCK ((xfs_rtblock_t)-1)
94 #define NULLFILEOFF ((xfs_fileoff_t)-1)
96 #define NULLAGBLOCK ((xfs_agblock_t)-1)
97 #define NULLAGNUMBER ((xfs_agnumber_t)-1)
98 #define NULLEXTNUM ((xfs_extnum_t)-1)
100 #define NULLCOMMITLSN ((xfs_lsn_t)-1)
103 * Max values for extlen, extnum, aextnum.
105 #define MAXEXTLEN ((xfs_extlen_t)0x001fffff) /* 21 bits */
106 #define MAXEXTNUM ((xfs_extnum_t)0x7fffffff) /* signed int */
107 #define MAXAEXTNUM ((xfs_aextnum_t)0x7fff) /* signed short */
110 * Min numbers of data/attr fork btree root pointers.
116 * MAXNAMELEN is the length (including the terminating null) of
117 * the longest permissible file (component) name.
119 #define MAXNAMELEN 256
122 XFS_LOOKUP_EQi
, XFS_LOOKUP_LEi
, XFS_LOOKUP_GEi
126 XFS_BTNUM_BNOi
, XFS_BTNUM_CNTi
, XFS_BTNUM_BMAPi
, XFS_BTNUM_INOi
,
131 const unsigned char *name
;
135 #endif /* XFS_TYPES_H_ */