]>
Commit | Line | Data |
---|---|---|
2bd0ea18 | 1 | /* |
da23017d NS |
2 | * Copyright (c) 2000-2001,2004-2005 Silicon Graphics, Inc. |
3 | * All Rights Reserved. | |
4 | * | |
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 | |
2bd0ea18 | 7 | * published by the Free Software Foundation. |
da23017d NS |
8 | * |
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. | |
13 | * | |
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 | |
2bd0ea18 NS |
17 | */ |
18 | #ifndef __XFS_MKFS_H__ | |
19 | #define __XFS_MKFS_H__ | |
20 | ||
8d537733 NS |
21 | #define XFS_DFL_SB_VERSION_BITS \ |
22 | (XFS_SB_VERSION_NLINKBIT | \ | |
23 | XFS_SB_VERSION_EXTFLGBIT) | |
24 | ||
25 | #define XFS_SB_VERSION_MKFS(ia,dia,dir2,log2,attr1,sflag,more) (\ | |
26 | ((ia)||(dia)||(dir2)||(log2)||(attr1)||(sflag)||(more)) ? \ | |
6e3140c7 NS |
27 | ( XFS_SB_VERSION_4 | \ |
28 | ((ia) ? XFS_SB_VERSION_ALIGNBIT : 0) | \ | |
29 | ((dia) ? XFS_SB_VERSION_DALIGNBIT : 0) | \ | |
6e3140c7 NS |
30 | ((dir2) ? XFS_SB_VERSION_DIRV2BIT : 0) | \ |
31 | ((log2) ? XFS_SB_VERSION_LOGV2BIT : 0) | \ | |
32 | ((attr1) ? XFS_SB_VERSION_ATTRBIT : 0) | \ | |
33 | ((sflag) ? XFS_SB_VERSION_SECTORBIT : 0) | \ | |
34 | ((more) ? XFS_SB_VERSION_MOREBITSBIT : 0) | \ | |
8d537733 | 35 | XFS_DFL_SB_VERSION_BITS | \ |
6e3140c7 NS |
36 | 0 ) : XFS_SB_VERSION_1 ) |
37 | ||
38 | #define XFS_SB_VERSION2_MKFS(lazycount, attr2, parent) (\ | |
39 | ((lazycount) ? XFS_SB_VERSION2_LAZYSBCOUNTBIT : 0) | \ | |
40 | ((attr2) ? XFS_SB_VERSION2_ATTR2BIT : 0) | \ | |
41 | ((parent) ? XFS_SB_VERSION2_PARENTBIT : 0) | \ | |
42 | 0 ) | |
43 | ||
2bd0ea18 NS |
44 | #define XFS_DFL_BLOCKSIZE_LOG 12 /* 4096 byte blocks */ |
45 | #define XFS_DINODE_DFL_LOG 8 /* 256 byte inodes */ | |
46 | #define XFS_MIN_DATA_BLOCKS 100 | |
47 | #define XFS_MIN_INODE_PERBLOCK 2 /* min inodes per block */ | |
48 | #define XFS_DFL_IMAXIMUM_PCT 25 /* max % of space for inodes */ | |
49 | #define XFS_IFLAG_ALIGN 1 /* -i align defaults on */ | |
50 | #define XFS_MIN_REC_DIRSIZE 12 /* 4096 byte dirblocks (V2) */ | |
51 | #define XFS_DFL_DIR_VERSION 2 /* default directory version */ | |
52 | #define XFS_DFL_LOG_SIZE 1000 /* default log size, blocks */ | |
53 | #define XFS_MIN_LOG_FACTOR 3 /* min log size factor */ | |
54 | #define XFS_DFL_LOG_FACTOR 16 /* default log size, factor */ | |
55 | /* with max trans reservation */ | |
6e3140c7 | 56 | #define XFS_MAX_INODE_SIG_BITS 32 /* most significant bits in an |
8e4b2fda ES |
57 | * inode number that we'll |
58 | * accept w/o warnings | |
59 | */ | |
9440d84d | 60 | |
33a4da69 NS |
61 | #define XFS_AG_BYTES(bblog) ((long long)BBSIZE << (bblog)) |
62 | #define XFS_AG_MIN_BYTES ((XFS_AG_BYTES(15))) /* 16 MB */ | |
63 | #define XFS_AG_MIN_BLOCKS(blog) ((XFS_AG_BYTES(15)) >> (blog)) | |
64 | #define XFS_AG_MAX_BLOCKS(blog) ((XFS_AG_BYTES(31) - 1) >> (blog)) | |
65 | ||
66 | #define XFS_MAX_AGNUMBER ((xfs_agnumber_t)(NULLAGNUMBER - 1)) | |
67 | ||
68 | ||
9440d84d NS |
69 | /* xfs_mkfs.c */ |
70 | extern void usage (void); | |
9e017777 | 71 | extern int isdigits (char *str); |
cb7ba2b0 CH |
72 | extern long long cvtnum (unsigned int blocksize, |
73 | unsigned int sectorsize, char *s); | |
9440d84d NS |
74 | |
75 | /* proto.c */ | |
76 | extern char *setup_proto (char *fname); | |
9f064b7e | 77 | extern void parse_proto (xfs_mount_t *mp, struct fsxattr *fsx, char **pp); |
9440d84d NS |
78 | extern void res_failed (int err); |
79 | ||
6e3140c7 | 80 | /* maxtrres.c */ |
cfd4ac07 NS |
81 | extern int max_trans_res (int dirversion, |
82 | int sectorlog, int blocklog, int inodelog, int dirblocklog); | |
2bd0ea18 NS |
83 | |
84 | #endif /* __XFS_MKFS_H__ */ |