xref: /haiku/src/add-ons/kernel/file_systems/ntfs/libntfs/param.h (revision 0490778ed1bf2e39eb9d9ea8d62a2b0ab378fecd)
10d2c294fSGerasim Troeglazov /*
20d2c294fSGerasim Troeglazov  * param.h - Parameter values for ntfs-3g
30d2c294fSGerasim Troeglazov  *
4a814d850Sthreedeyes  * Copyright (c) 2009-2010 Jean-Pierre Andre
50d2c294fSGerasim Troeglazov  *
60d2c294fSGerasim Troeglazov  * This program/include file is free software; you can redistribute it and/or
70d2c294fSGerasim Troeglazov  * modify it under the terms of the GNU General Public License as published
80d2c294fSGerasim Troeglazov  * by the Free Software Foundation; either version 2 of the License, or
90d2c294fSGerasim Troeglazov  * (at your option) any later version.
100d2c294fSGerasim Troeglazov  *
110d2c294fSGerasim Troeglazov  * This program/include file is distributed in the hope that it will be
120d2c294fSGerasim Troeglazov  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
130d2c294fSGerasim Troeglazov  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
140d2c294fSGerasim Troeglazov  * GNU General Public License for more details.
150d2c294fSGerasim Troeglazov  *
160d2c294fSGerasim Troeglazov  * You should have received a copy of the GNU General Public License
170d2c294fSGerasim Troeglazov  * along with this program (in the main directory of the NTFS-3G
180d2c294fSGerasim Troeglazov  * distribution in the file COPYING); if not, write to the Free Software
190d2c294fSGerasim Troeglazov  * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
200d2c294fSGerasim Troeglazov  */
210d2c294fSGerasim Troeglazov 
220d2c294fSGerasim Troeglazov #ifndef _NTFS_PARAM_H
230d2c294fSGerasim Troeglazov #define _NTFS_PARAM_H
240d2c294fSGerasim Troeglazov 
250d2c294fSGerasim Troeglazov #define CACHE_INODE_SIZE 32	/* inode cache, zero or >= 3 and not too big */
260d2c294fSGerasim Troeglazov #define CACHE_NIDATA_SIZE 64	/* idata cache, zero or >= 3 and not too big */
270d2c294fSGerasim Troeglazov #define CACHE_LOOKUP_SIZE 64	/* lookup cache, zero or >= 3 and not too big */
280d2c294fSGerasim Troeglazov #define CACHE_SECURID_SIZE 16    /* securid cache, zero or >= 3 and not too big */
290d2c294fSGerasim Troeglazov #define CACHE_LEGACY_SIZE 8    /* legacy cache size, zero or >= 3 and not too big */
300d2c294fSGerasim Troeglazov 
310d2c294fSGerasim Troeglazov #define FORCE_FORMAT_v1x 0	/* Insert security data as in NTFS v1.x */
320d2c294fSGerasim Troeglazov #define OWNERFROMACL 1		/* Get the owner from ACL (not Windows owner) */
330d2c294fSGerasim Troeglazov 
340d2c294fSGerasim Troeglazov 		/* default security sub-authorities */
350d2c294fSGerasim Troeglazov enum {
360d2c294fSGerasim Troeglazov 	DEFSECAUTH1 = -1153374643, /* 3141592653 */
370d2c294fSGerasim Troeglazov 	DEFSECAUTH2 = 589793238,
380d2c294fSGerasim Troeglazov 	DEFSECAUTH3 = 462843383,
390d2c294fSGerasim Troeglazov 	DEFSECBASE = 10000
400d2c294fSGerasim Troeglazov };
410d2c294fSGerasim Troeglazov 
420d2c294fSGerasim Troeglazov /*
430d2c294fSGerasim Troeglazov  *		Parameters for compression
440d2c294fSGerasim Troeglazov  */
450d2c294fSGerasim Troeglazov 
460d2c294fSGerasim Troeglazov 	/* default option for compression */
47a814d850Sthreedeyes #define DEFAULT_COMPRESSION 1
480d2c294fSGerasim Troeglazov 	/* (log2 of) number of clusters in a compression block for new files */
490d2c294fSGerasim Troeglazov #define STANDARD_COMPRESSION_UNIT 4
500d2c294fSGerasim Troeglazov 	/* maximum cluster size for allowing compression for new files */
510d2c294fSGerasim Troeglazov #define MAX_COMPRESSION_CLUSTER_SIZE 4096
520d2c294fSGerasim Troeglazov 
530d2c294fSGerasim Troeglazov /*
54da0906f2SGerasim Troeglazov  *		Parameters for default options
55da0906f2SGerasim Troeglazov  */
56da0906f2SGerasim Troeglazov 
57da0906f2SGerasim Troeglazov #define DEFAULT_DMTIME 60 /* default 1mn for delay_mtime */
58da0906f2SGerasim Troeglazov 
59da0906f2SGerasim Troeglazov /*
60a814d850Sthreedeyes  *		Use of big write buffers
61a814d850Sthreedeyes  *
62a814d850Sthreedeyes  *	With small volumes, the cluster allocator may fail to allocate
63a814d850Sthreedeyes  *	enough clusters when the volume is nearly full. At most a run
64a814d850Sthreedeyes  *	can be allocated per bitmap chunk. So, there is a danger when the
65a814d850Sthreedeyes  *	number of chunks (capacity/(32768*clsiz)) is less than the number
66a814d850Sthreedeyes  *	of clusters in the biggest write buffer (131072/clsiz). Hence
67a814d850Sthreedeyes  *	a safe minimal capacity is 4GB
68a814d850Sthreedeyes  */
69a814d850Sthreedeyes 
70a814d850Sthreedeyes #define SAFE_CAPACITY_FOR_BIG_WRITES 0x100000000LL
71a814d850Sthreedeyes 
72a814d850Sthreedeyes /*
73a814d850Sthreedeyes  *		Parameters for runlists
74a814d850Sthreedeyes  */
75a814d850Sthreedeyes 
76a814d850Sthreedeyes 	/* only update the final extent of a runlist when appending data */
77a814d850Sthreedeyes #define PARTIAL_RUNLIST_UPDATING 1
78a814d850Sthreedeyes 
79a814d850Sthreedeyes /*
80*0490778eSAugustin Cavalier  *		Parameters for upper-case table
81*0490778eSAugustin Cavalier  */
82*0490778eSAugustin Cavalier 
83*0490778eSAugustin Cavalier 	/* Create upper-case tables as defined by Windows 6.1 (Win7) */
84*0490778eSAugustin Cavalier #define UPCASE_MAJOR 6
85*0490778eSAugustin Cavalier #define UPCASE_MINOR 1
86*0490778eSAugustin Cavalier 
87*0490778eSAugustin Cavalier /*
88a814d850Sthreedeyes  *		Parameters for user and xattr mappings
89a814d850Sthreedeyes  */
90a814d850Sthreedeyes 
91a814d850Sthreedeyes #define XATTRMAPPINGFILE ".NTFS-3G/XattrMapping" /* default mapping file */
92a814d850Sthreedeyes 
93a814d850Sthreedeyes /*
94a814d850Sthreedeyes  *		Parameters for path canonicalization
95a814d850Sthreedeyes  */
96a814d850Sthreedeyes 
97a814d850Sthreedeyes #define MAPPERNAMELTH 256
98a814d850Sthreedeyes 
99a814d850Sthreedeyes /*
1000d2c294fSGerasim Troeglazov  *		Permission checking modes for high level and low level
1010d2c294fSGerasim Troeglazov  *
1020d2c294fSGerasim Troeglazov  *	The choices for high and low lowel are independent, they have
1030d2c294fSGerasim Troeglazov  *	no effect on the library
1040d2c294fSGerasim Troeglazov  *
1050d2c294fSGerasim Troeglazov  *	Stick to the recommended values unless you understand the consequences
1060d2c294fSGerasim Troeglazov  *	on protection and performances. Use of cacheing is good for
107a814d850Sthreedeyes  *	performances, but bad on security with internal fuse or external
108a814d850Sthreedeyes  *	fuse older than 2.8
1090d2c294fSGerasim Troeglazov  *
110*0490778eSAugustin Cavalier  *	On Linux, cacheing is discouraged for the high level interface
111*0490778eSAugustin Cavalier  *	in order to get proper support of hard links. As a consequence,
112*0490778eSAugustin Cavalier  *	having access control in the file system leads to fewer requests
113*0490778eSAugustin Cavalier  *	to the file system and fewer context switches.
114*0490778eSAugustin Cavalier  *
1150d2c294fSGerasim Troeglazov  *	Possible values for high level :
1160d2c294fSGerasim Troeglazov  *		1 : no cache, kernel control (recommended)
1170d2c294fSGerasim Troeglazov  *		4 : no cache, file system control
118*0490778eSAugustin Cavalier  *		6 : kernel/fuse cache, file system control (OpenIndiana only)
1190d2c294fSGerasim Troeglazov  *		7 : no cache, kernel control for ACLs
1200d2c294fSGerasim Troeglazov  *
1210d2c294fSGerasim Troeglazov  *	Possible values for low level :
1220d2c294fSGerasim Troeglazov  *		2 : no cache, kernel control
123*0490778eSAugustin Cavalier  *		3 : use kernel/fuse cache, kernel control  (recommended)
124*0490778eSAugustin Cavalier  *		5 : no cache, file system control
125*0490778eSAugustin Cavalier  *		6 : kernel/fuse cache, file system control (OpenIndiana only)
1260d2c294fSGerasim Troeglazov  *		8 : no cache, kernel control for ACLs
127*0490778eSAugustin Cavalier  *		9 : kernel/fuse cache, kernel control for ACLs (target)
1280d2c294fSGerasim Troeglazov  *
129*0490778eSAugustin Cavalier  *	Use of options 7, 8 and 9 requires a fuse module upgrade
1300d2c294fSGerasim Troeglazov  *	When Posix ACLs are selected in the configure options, a value
1310d2c294fSGerasim Troeglazov  *	of 6 is added in the mount report.
1320d2c294fSGerasim Troeglazov  */
1330d2c294fSGerasim Troeglazov 
134da0906f2SGerasim Troeglazov #if defined(__sun) && defined(__SVR4)
135*0490778eSAugustin Cavalier /*
136*0490778eSAugustin Cavalier  *	Access control by kernel is not implemented on OpenIndiana,
137*0490778eSAugustin Cavalier  *	however care is taken of cacheing hard-linked files.
138*0490778eSAugustin Cavalier  */
139*0490778eSAugustin Cavalier #define HPERMSCONFIG 6
140*0490778eSAugustin Cavalier #define LPERMSCONFIG 6
141*0490778eSAugustin Cavalier #else /* defined(__sun) && defined(__SVR4) */
142*0490778eSAugustin Cavalier /*
143*0490778eSAugustin Cavalier  *	Cacheing by kernel is buggy on Linux when access control is done
144*0490778eSAugustin Cavalier  *	by the file system, and also when using hard-linked files on
145*0490778eSAugustin Cavalier  *	the fuse high level interface.
146*0490778eSAugustin Cavalier  */
1470d2c294fSGerasim Troeglazov #define HPERMSCONFIG 1
148*0490778eSAugustin Cavalier #define LPERMSCONFIG 3 /* Use 9 when ACLs are supported by fuse kernel */
149*0490778eSAugustin Cavalier #endif /* defined(__sun) && defined(__SVR4) */
1500d2c294fSGerasim Troeglazov 
1510d2c294fSGerasim Troeglazov #endif /* defined _NTFS_PARAM_H */
152