1 /* 2 * param.h - Parameter values for ntfs-3g 3 * 4 * Copyright (c) 2009-2010 Jean-Pierre Andre 5 * 6 * This program/include file is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as published 8 * by the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program/include file is distributed in the hope that it will be 12 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program (in the main directory of the NTFS-3G 18 * distribution in the file COPYING); if not, write to the Free Software 19 * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 */ 21 22 #ifndef _NTFS_PARAM_H 23 #define _NTFS_PARAM_H 24 25 #define CACHE_INODE_SIZE 32 /* inode cache, zero or >= 3 and not too big */ 26 #define CACHE_NIDATA_SIZE 64 /* idata cache, zero or >= 3 and not too big */ 27 #define CACHE_LOOKUP_SIZE 64 /* lookup cache, zero or >= 3 and not too big */ 28 #define CACHE_SECURID_SIZE 16 /* securid cache, zero or >= 3 and not too big */ 29 #define CACHE_LEGACY_SIZE 8 /* legacy cache size, zero or >= 3 and not too big */ 30 31 #define FORCE_FORMAT_v1x 0 /* Insert security data as in NTFS v1.x */ 32 #define OWNERFROMACL 1 /* Get the owner from ACL (not Windows owner) */ 33 34 /* default security sub-authorities */ 35 enum { 36 DEFSECAUTH1 = -1153374643, /* 3141592653 */ 37 DEFSECAUTH2 = 589793238, 38 DEFSECAUTH3 = 462843383, 39 DEFSECBASE = 10000 40 }; 41 42 /* 43 * Parameters for formatting 44 */ 45 46 /* Up to Windows 10, the cluster size was limited to 64K */ 47 #define NTFS_MAX_CLUSTER_SIZE 2097152 /* Windows 10 Creators allows 2MB */ 48 49 /* 50 * Parameters for compression 51 */ 52 53 /* default option for compression */ 54 #define DEFAULT_COMPRESSION 1 55 /* (log2 of) number of clusters in a compression block for new files */ 56 #define STANDARD_COMPRESSION_UNIT 4 57 /* maximum cluster size for allowing compression for new files */ 58 #define MAX_COMPRESSION_CLUSTER_SIZE 4096 59 60 /* 61 * Parameters for default options 62 */ 63 64 #define DEFAULT_DMTIME 60 /* default 1mn for delay_mtime */ 65 66 /* 67 * Use of big write buffers 68 * 69 * With small volumes, the cluster allocator may fail to allocate 70 * enough clusters when the volume is nearly full. At most a run 71 * can be allocated per bitmap chunk. So, there is a danger when the 72 * number of chunks (capacity/(32768*clsiz)) is less than the number 73 * of clusters in the biggest write buffer (131072/clsiz). Hence 74 * a safe minimal capacity is 4GB 75 */ 76 77 #define SAFE_CAPACITY_FOR_BIG_WRITES 0x100000000LL 78 79 /* 80 * Parameters for runlists 81 */ 82 83 /* only update the final extent of a runlist when appending data */ 84 #define PARTIAL_RUNLIST_UPDATING 1 85 86 /* 87 * Parameters for upper-case table 88 */ 89 90 /* Create upper-case tables as defined by Windows 6.1 (Win7) */ 91 #define UPCASE_MAJOR 6 92 #define UPCASE_MINOR 1 93 94 /* 95 * Parameters for user and xattr mappings 96 */ 97 98 #define XATTRMAPPINGFILE ".NTFS-3G/XattrMapping" /* default mapping file */ 99 100 /* 101 * Parameters for path canonicalization 102 */ 103 104 #define MAPPERNAMELTH 256 105 106 /* 107 * Permission checking modes for high level and low level 108 * 109 * The choices for high and low lowel are independent, they have 110 * no effect on the library 111 * 112 * Stick to the recommended values unless you understand the consequences 113 * on protection and performances. Use of cacheing is good for 114 * performances, but bad on security with internal fuse or external 115 * fuse older than 2.8 116 * 117 * On Linux, cacheing is discouraged for the high level interface 118 * in order to get proper support of hard links. As a consequence, 119 * having access control in the file system leads to fewer requests 120 * to the file system and fewer context switches. 121 * 122 * Irrespective of the selected mode, cacheing is always used 123 * in read-only mounts 124 * 125 * Possible values for high level : 126 * 1 : no cache, kernel control (recommended) 127 * 4 : no cache, file system control 128 * 6 : kernel/fuse cache, file system control (OpenIndiana only) 129 * 7 : no cache, kernel control for ACLs 130 * 131 * Possible values for low level : 132 * 2 : no cache, kernel control 133 * 3 : use kernel/fuse cache, kernel control (recommended) 134 * 5 : no cache, file system control 135 * 6 : kernel/fuse cache, file system control (OpenIndiana only) 136 * 8 : no cache, kernel control for ACLs 137 * 9 : kernel/fuse cache, kernel control for ACLs (target) 138 * 139 * Use of options 7, 8 and 9 requires a fuse module upgrade 140 * When Posix ACLs are selected in the configure options, a value 141 * of 6 is added in the mount report. 142 */ 143 144 #define TIMEOUT_RO 600 /* Attribute time out for read-only mounts */ 145 #if defined(__sun) && defined(__SVR4) 146 /* 147 * Access control by kernel is not implemented on OpenIndiana, 148 * however care is taken of cacheing hard-linked files. 149 */ 150 #define HPERMSCONFIG 6 151 #define LPERMSCONFIG 6 152 #else /* defined(__sun) && defined(__SVR4) */ 153 /* 154 * Cacheing by kernel is buggy on Linux when access control is done 155 * by the file system, and also when using hard-linked files on 156 * the fuse high level interface. 157 * Also ACL checks by recent kernels do not prove satisfactory. 158 */ 159 #define HPERMSCONFIG 1 160 #define LPERMSCONFIG 3 161 #endif /* defined(__sun) && defined(__SVR4) */ 162 163 #endif /* defined _NTFS_PARAM_H */ 164