Merge tag 'pm+acpi-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
[deliverable/linux.git] / fs / xfs / libxfs / xfs_types.h
CommitLineData
1da177e4 1/*
7b718769
NS
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
1da177e4 4 *
7b718769
NS
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
1da177e4
LT
7 * published by the Free Software Foundation.
8 *
7b718769
NS
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
1da177e4 13 *
7b718769
NS
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1da177e4
LT
17 */
18#ifndef __XFS_TYPES_H__
19#define __XFS_TYPES_H__
20
d386b32b
DC
21typedef __uint32_t prid_t; /* project ID */
22
1da177e4 23typedef __uint32_t xfs_agblock_t; /* blockno in alloc. group */
60a34607 24typedef __uint32_t xfs_agino_t; /* inode # within allocation grp */
1da177e4
LT
25typedef __uint32_t xfs_extlen_t; /* extent length in blocks */
26typedef __uint32_t xfs_agnumber_t; /* allocation group number */
27typedef __int32_t xfs_extnum_t; /* # of extents in a file */
28typedef __int16_t xfs_aextnum_t; /* # extents in an attribute fork */
29typedef __int64_t xfs_fsize_t; /* bytes in a file */
30typedef __uint64_t xfs_ufsize_t; /* unsigned bytes in a file */
31
32typedef __int32_t xfs_suminfo_t; /* type of bitmap summary info */
33typedef __int32_t xfs_rtword_t; /* word type for bitmap manipulations */
34
35typedef __int64_t xfs_lsn_t; /* log sequence number */
36typedef __int32_t xfs_tid_t; /* transaction identifier */
37
38typedef __uint32_t xfs_dablk_t; /* dir/attr block number (in file) */
39typedef __uint32_t xfs_dahash_t; /* dir/attr hash value */
40
1da177e4
LT
41typedef __uint64_t xfs_fsblock_t; /* blockno in filesystem (agno|agbno) */
42typedef __uint64_t xfs_rfsblock_t; /* blockno in filesystem (raw) */
43typedef __uint64_t xfs_rtblock_t; /* extent (block) in realtime area */
1da177e4 44typedef __uint64_t xfs_fileoff_t; /* block number in a file */
1da177e4
LT
45typedef __uint64_t xfs_filblks_t; /* number of blocks in a file */
46
d5cf09ba
CH
47typedef __int64_t xfs_srtblock_t; /* signed version of xfs_rtblock_t */
48typedef __int64_t xfs_sfiloff_t; /* signed block number in a file */
60a34607 49
1da177e4
LT
50/*
51 * Null values for the types.
52 */
1da177e4
LT
53#define NULLFSBLOCK ((xfs_fsblock_t)-1)
54#define NULLRFSBLOCK ((xfs_rfsblock_t)-1)
55#define NULLRTBLOCK ((xfs_rtblock_t)-1)
56#define NULLFILEOFF ((xfs_fileoff_t)-1)
57
58#define NULLAGBLOCK ((xfs_agblock_t)-1)
59#define NULLAGNUMBER ((xfs_agnumber_t)-1)
60#define NULLEXTNUM ((xfs_extnum_t)-1)
61
62#define NULLCOMMITLSN ((xfs_lsn_t)-1)
63
60a34607
DC
64#define NULLFSINO ((xfs_ino_t)-1)
65#define NULLAGINO ((xfs_agino_t)-1)
66
1da177e4
LT
67/*
68 * Max values for extlen, extnum, aextnum.
69 */
70#define MAXEXTLEN ((xfs_extlen_t)0x001fffff) /* 21 bits */
71#define MAXEXTNUM ((xfs_extnum_t)0x7fffffff) /* signed int */
72#define MAXAEXTNUM ((xfs_aextnum_t)0x7fff) /* signed short */
73
77c1a08f
DC
74/*
75 * Minimum and maximum blocksize and sectorsize.
76 * The blocksize upper limit is pretty much arbitrary.
77 * The sectorsize upper limit is due to sizeof(sb_sectsize).
78 */
79#define XFS_MIN_BLOCKSIZE_LOG 9 /* i.e. 512 bytes */
80#define XFS_MAX_BLOCKSIZE_LOG 16 /* i.e. 65536 bytes */
81#define XFS_MIN_BLOCKSIZE (1 << XFS_MIN_BLOCKSIZE_LOG)
82#define XFS_MAX_BLOCKSIZE (1 << XFS_MAX_BLOCKSIZE_LOG)
83#define XFS_MIN_SECTORSIZE_LOG 9 /* i.e. 512 bytes */
84#define XFS_MAX_SECTORSIZE_LOG 15 /* i.e. 32768 bytes */
85#define XFS_MIN_SECTORSIZE (1 << XFS_MIN_SECTORSIZE_LOG)
86#define XFS_MAX_SECTORSIZE (1 << XFS_MAX_SECTORSIZE_LOG)
87
69432832
DC
88/*
89 * Inode fork identifiers.
90 */
91#define XFS_DATA_FORK 0
92#define XFS_ATTR_FORK 1
93
d8cc890d
NS
94/*
95 * Min numbers of data/attr fork btree root pointers.
96 */
97#define MINDBTPTRS 3
98#define MINABTPTRS 2
99
1da177e4
LT
100/*
101 * MAXNAMELEN is the length (including the terminating null) of
102 * the longest permissible file (component) name.
103 */
104#define MAXNAMELEN 256
105
1da177e4
LT
106typedef enum {
107 XFS_LOOKUP_EQi, XFS_LOOKUP_LEi, XFS_LOOKUP_GEi
108} xfs_lookup_t;
109
110typedef enum {
111 XFS_BTNUM_BNOi, XFS_BTNUM_CNTi, XFS_BTNUM_BMAPi, XFS_BTNUM_INOi,
aafc3c24 112 XFS_BTNUM_FINOi, XFS_BTNUM_MAX
1da177e4
LT
113} xfs_btnum_t;
114
556b8b16 115struct xfs_name {
e2bcd936
DC
116 const unsigned char *name;
117 int len;
0cb97766 118 int type;
556b8b16
BN
119};
120
6ca1c906
DC
121/*
122 * uid_t and gid_t are hard-coded to 32 bits in the inode.
123 * Hence, an 'id' in a dquot is 32 bits..
124 */
125typedef __uint32_t xfs_dqid_t;
126
c7298202
DC
127/*
128 * Constants for bit manipulations.
129 */
130#define XFS_NBBYLOG 3 /* log2(NBBY) */
131#define XFS_WORDLOG 2 /* log2(sizeof(xfs_rtword_t)) */
132#define XFS_NBWORDLOG (XFS_NBBYLOG + XFS_WORDLOG)
133#define XFS_NBWORD (1 << XFS_NBWORDLOG)
134#define XFS_WORDMASK ((1 << XFS_WORDLOG) - 1)
135
136
1da177e4 137#endif /* __XFS_TYPES_H__ */
This page took 0.988827 seconds and 5 git commands to generate.