aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ntfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ntfs/super.c')
-rw-r--r--fs/ntfs/super.c178
1 files changed, 89 insertions, 89 deletions
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index 6b2712f10dd2..03a391ac7145 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -74,18 +74,18 @@ const option_t on_errors_arr[] = {
74 * 74 *
75 * Copied from old ntfs driver (which copied from vfat driver). 75 * Copied from old ntfs driver (which copied from vfat driver).
76 */ 76 */
77static int simple_getbool(char *s, BOOL *setval) 77static int simple_getbool(char *s, bool *setval)
78{ 78{
79 if (s) { 79 if (s) {
80 if (!strcmp(s, "1") || !strcmp(s, "yes") || !strcmp(s, "true")) 80 if (!strcmp(s, "1") || !strcmp(s, "yes") || !strcmp(s, "true"))
81 *setval = TRUE; 81 *setval = true;
82 else if (!strcmp(s, "0") || !strcmp(s, "no") || 82 else if (!strcmp(s, "0") || !strcmp(s, "no") ||
83 !strcmp(s, "false")) 83 !strcmp(s, "false"))
84 *setval = FALSE; 84 *setval = false;
85 else 85 else
86 return 0; 86 return 0;
87 } else 87 } else
88 *setval = TRUE; 88 *setval = true;
89 return 1; 89 return 1;
90} 90}
91 91
@@ -96,7 +96,7 @@ static int simple_getbool(char *s, BOOL *setval)
96 * 96 *
97 * Parse the recognized options in @opt for the ntfs volume described by @vol. 97 * Parse the recognized options in @opt for the ntfs volume described by @vol.
98 */ 98 */
99static BOOL parse_options(ntfs_volume *vol, char *opt) 99static bool parse_options(ntfs_volume *vol, char *opt)
100{ 100{
101 char *p, *v, *ov; 101 char *p, *v, *ov;
102 static char *utf8 = "utf8"; 102 static char *utf8 = "utf8";
@@ -137,7 +137,7 @@ static BOOL parse_options(ntfs_volume *vol, char *opt)
137 } 137 }
138#define NTFS_GETOPT_BOOL(option, variable) \ 138#define NTFS_GETOPT_BOOL(option, variable) \
139 if (!strcmp(p, option)) { \ 139 if (!strcmp(p, option)) { \
140 BOOL val; \ 140 bool val; \
141 if (!simple_getbool(v, &val)) \ 141 if (!simple_getbool(v, &val)) \
142 goto needs_bool; \ 142 goto needs_bool; \
143 variable = val; \ 143 variable = val; \
@@ -170,7 +170,7 @@ static BOOL parse_options(ntfs_volume *vol, char *opt)
170 else NTFS_GETOPT_OCTAL("fmask", fmask) 170 else NTFS_GETOPT_OCTAL("fmask", fmask)
171 else NTFS_GETOPT_OCTAL("dmask", dmask) 171 else NTFS_GETOPT_OCTAL("dmask", dmask)
172 else NTFS_GETOPT("mft_zone_multiplier", mft_zone_multiplier) 172 else NTFS_GETOPT("mft_zone_multiplier", mft_zone_multiplier)
173 else NTFS_GETOPT_WITH_DEFAULT("sloppy", sloppy, TRUE) 173 else NTFS_GETOPT_WITH_DEFAULT("sloppy", sloppy, true)
174 else NTFS_GETOPT_BOOL("show_sys_files", show_sys_files) 174 else NTFS_GETOPT_BOOL("show_sys_files", show_sys_files)
175 else NTFS_GETOPT_BOOL("case_sensitive", case_sensitive) 175 else NTFS_GETOPT_BOOL("case_sensitive", case_sensitive)
176 else NTFS_GETOPT_BOOL("disable_sparse", disable_sparse) 176 else NTFS_GETOPT_BOOL("disable_sparse", disable_sparse)
@@ -194,7 +194,7 @@ use_utf8:
194 if (!old_nls) { 194 if (!old_nls) {
195 ntfs_error(vol->sb, "NLS character set " 195 ntfs_error(vol->sb, "NLS character set "
196 "%s not found.", v); 196 "%s not found.", v);
197 return FALSE; 197 return false;
198 } 198 }
199 ntfs_error(vol->sb, "NLS character set %s not " 199 ntfs_error(vol->sb, "NLS character set %s not "
200 "found. Using previous one %s.", 200 "found. Using previous one %s.",
@@ -205,14 +205,14 @@ use_utf8:
205 unload_nls(old_nls); 205 unload_nls(old_nls);
206 } 206 }
207 } else if (!strcmp(p, "utf8")) { 207 } else if (!strcmp(p, "utf8")) {
208 BOOL val = FALSE; 208 bool val = false;
209 ntfs_warning(vol->sb, "Option utf8 is no longer " 209 ntfs_warning(vol->sb, "Option utf8 is no longer "
210 "supported, using option nls=utf8. Please " 210 "supported, using option nls=utf8. Please "
211 "use option nls=utf8 in the future and " 211 "use option nls=utf8 in the future and "
212 "make sure utf8 is compiled either as a " 212 "make sure utf8 is compiled either as a "
213 "module or into the kernel."); 213 "module or into the kernel.");
214 if (!v || !*v) 214 if (!v || !*v)
215 val = TRUE; 215 val = true;
216 else if (!simple_getbool(v, &val)) 216 else if (!simple_getbool(v, &val))
217 goto needs_bool; 217 goto needs_bool;
218 if (val) { 218 if (val) {
@@ -231,7 +231,7 @@ use_utf8:
231 } 231 }
232no_mount_options: 232no_mount_options:
233 if (errors && !sloppy) 233 if (errors && !sloppy)
234 return FALSE; 234 return false;
235 if (sloppy) 235 if (sloppy)
236 ntfs_warning(vol->sb, "Sloppy option given. Ignoring " 236 ntfs_warning(vol->sb, "Sloppy option given. Ignoring "
237 "unrecognized mount option(s) and continuing."); 237 "unrecognized mount option(s) and continuing.");
@@ -240,14 +240,14 @@ no_mount_options:
240 if (!on_errors) { 240 if (!on_errors) {
241 ntfs_error(vol->sb, "Invalid errors option argument " 241 ntfs_error(vol->sb, "Invalid errors option argument "
242 "or bug in options parser."); 242 "or bug in options parser.");
243 return FALSE; 243 return false;
244 } 244 }
245 } 245 }
246 if (nls_map) { 246 if (nls_map) {
247 if (vol->nls_map && vol->nls_map != nls_map) { 247 if (vol->nls_map && vol->nls_map != nls_map) {
248 ntfs_error(vol->sb, "Cannot change NLS character set " 248 ntfs_error(vol->sb, "Cannot change NLS character set "
249 "on remount."); 249 "on remount.");
250 return FALSE; 250 return false;
251 } /* else (!vol->nls_map) */ 251 } /* else (!vol->nls_map) */
252 ntfs_debug("Using NLS character set %s.", nls_map->charset); 252 ntfs_debug("Using NLS character set %s.", nls_map->charset);
253 vol->nls_map = nls_map; 253 vol->nls_map = nls_map;
@@ -257,7 +257,7 @@ no_mount_options:
257 if (!vol->nls_map) { 257 if (!vol->nls_map) {
258 ntfs_error(vol->sb, "Failed to load default " 258 ntfs_error(vol->sb, "Failed to load default "
259 "NLS character set."); 259 "NLS character set.");
260 return FALSE; 260 return false;
261 } 261 }
262 ntfs_debug("Using default NLS character set (%s).", 262 ntfs_debug("Using default NLS character set (%s).",
263 vol->nls_map->charset); 263 vol->nls_map->charset);
@@ -268,7 +268,7 @@ no_mount_options:
268 mft_zone_multiplier) { 268 mft_zone_multiplier) {
269 ntfs_error(vol->sb, "Cannot change mft_zone_multiplier " 269 ntfs_error(vol->sb, "Cannot change mft_zone_multiplier "
270 "on remount."); 270 "on remount.");
271 return FALSE; 271 return false;
272 } 272 }
273 if (mft_zone_multiplier < 1 || mft_zone_multiplier > 4) { 273 if (mft_zone_multiplier < 1 || mft_zone_multiplier > 4) {
274 ntfs_error(vol->sb, "Invalid mft_zone_multiplier. " 274 ntfs_error(vol->sb, "Invalid mft_zone_multiplier. "
@@ -318,16 +318,16 @@ no_mount_options:
318 NVolSetSparseEnabled(vol); 318 NVolSetSparseEnabled(vol);
319 } 319 }
320 } 320 }
321 return TRUE; 321 return true;
322needs_arg: 322needs_arg:
323 ntfs_error(vol->sb, "The %s option requires an argument.", p); 323 ntfs_error(vol->sb, "The %s option requires an argument.", p);
324 return FALSE; 324 return false;
325needs_bool: 325needs_bool:
326 ntfs_error(vol->sb, "The %s option requires a boolean argument.", p); 326 ntfs_error(vol->sb, "The %s option requires a boolean argument.", p);
327 return FALSE; 327 return false;
328needs_val: 328needs_val:
329 ntfs_error(vol->sb, "Invalid %s option argument: %s", p, ov); 329 ntfs_error(vol->sb, "Invalid %s option argument: %s", p, ov);
330 return FALSE; 330 return false;
331} 331}
332 332
333#ifdef NTFS_RW 333#ifdef NTFS_RW
@@ -543,16 +543,16 @@ static int ntfs_remount(struct super_block *sb, int *flags, char *opt)
543 * is_boot_sector_ntfs - check whether a boot sector is a valid NTFS boot sector 543 * is_boot_sector_ntfs - check whether a boot sector is a valid NTFS boot sector
544 * @sb: Super block of the device to which @b belongs. 544 * @sb: Super block of the device to which @b belongs.
545 * @b: Boot sector of device @sb to check. 545 * @b: Boot sector of device @sb to check.
546 * @silent: If TRUE, all output will be silenced. 546 * @silent: If 'true', all output will be silenced.
547 * 547 *
548 * is_boot_sector_ntfs() checks whether the boot sector @b is a valid NTFS boot 548 * is_boot_sector_ntfs() checks whether the boot sector @b is a valid NTFS boot
549 * sector. Returns TRUE if it is valid and FALSE if not. 549 * sector. Returns 'true' if it is valid and 'false' if not.
550 * 550 *
551 * @sb is only needed for warning/error output, i.e. it can be NULL when silent 551 * @sb is only needed for warning/error output, i.e. it can be NULL when silent
552 * is TRUE. 552 * is 'true'.
553 */ 553 */
554static BOOL is_boot_sector_ntfs(const struct super_block *sb, 554static bool is_boot_sector_ntfs(const struct super_block *sb,
555 const NTFS_BOOT_SECTOR *b, const BOOL silent) 555 const NTFS_BOOT_SECTOR *b, const bool silent)
556{ 556{
557 /* 557 /*
558 * Check that checksum == sum of u32 values from b to the checksum 558 * Check that checksum == sum of u32 values from b to the checksum
@@ -620,9 +620,9 @@ static BOOL is_boot_sector_ntfs(const struct super_block *sb,
620 */ 620 */
621 if (!silent && b->end_of_sector_marker != const_cpu_to_le16(0xaa55)) 621 if (!silent && b->end_of_sector_marker != const_cpu_to_le16(0xaa55))
622 ntfs_warning(sb, "Invalid end of sector marker."); 622 ntfs_warning(sb, "Invalid end of sector marker.");
623 return TRUE; 623 return true;
624not_ntfs: 624not_ntfs:
625 return FALSE; 625 return false;
626} 626}
627 627
628/** 628/**
@@ -732,9 +732,9 @@ hotfix_primary_boot_sector:
732 * @b: boot sector to parse 732 * @b: boot sector to parse
733 * 733 *
734 * Parse the ntfs boot sector @b and store all imporant information therein in 734 * Parse the ntfs boot sector @b and store all imporant information therein in
735 * the ntfs super block @vol. Return TRUE on success and FALSE on error. 735 * the ntfs super block @vol. Return 'true' on success and 'false' on error.
736 */ 736 */
737static BOOL parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *b) 737static bool parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *b)
738{ 738{
739 unsigned int sectors_per_cluster_bits, nr_hidden_sects; 739 unsigned int sectors_per_cluster_bits, nr_hidden_sects;
740 int clusters_per_mft_record, clusters_per_index_record; 740 int clusters_per_mft_record, clusters_per_index_record;
@@ -751,7 +751,7 @@ static BOOL parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *b)
751 "device block size (%lu). This is not " 751 "device block size (%lu). This is not "
752 "supported. Sorry.", vol->sector_size, 752 "supported. Sorry.", vol->sector_size,
753 vol->sb->s_blocksize); 753 vol->sb->s_blocksize);
754 return FALSE; 754 return false;
755 } 755 }
756 ntfs_debug("sectors_per_cluster = 0x%x", b->bpb.sectors_per_cluster); 756 ntfs_debug("sectors_per_cluster = 0x%x", b->bpb.sectors_per_cluster);
757 sectors_per_cluster_bits = ffs(b->bpb.sectors_per_cluster) - 1; 757 sectors_per_cluster_bits = ffs(b->bpb.sectors_per_cluster) - 1;
@@ -770,7 +770,7 @@ static BOOL parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *b)
770 ntfs_error(vol->sb, "Cluster size (%i) is smaller than the " 770 ntfs_error(vol->sb, "Cluster size (%i) is smaller than the "
771 "sector size (%i). This is not supported. " 771 "sector size (%i). This is not supported. "
772 "Sorry.", vol->cluster_size, vol->sector_size); 772 "Sorry.", vol->cluster_size, vol->sector_size);
773 return FALSE; 773 return false;
774 } 774 }
775 clusters_per_mft_record = b->clusters_per_mft_record; 775 clusters_per_mft_record = b->clusters_per_mft_record;
776 ntfs_debug("clusters_per_mft_record = %i (0x%x)", 776 ntfs_debug("clusters_per_mft_record = %i (0x%x)",
@@ -802,7 +802,7 @@ static BOOL parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *b)
802 "PAGE_CACHE_SIZE on your system (%lu). " 802 "PAGE_CACHE_SIZE on your system (%lu). "
803 "This is not supported. Sorry.", 803 "This is not supported. Sorry.",
804 vol->mft_record_size, PAGE_CACHE_SIZE); 804 vol->mft_record_size, PAGE_CACHE_SIZE);
805 return FALSE; 805 return false;
806 } 806 }
807 /* We cannot support mft record sizes below the sector size. */ 807 /* We cannot support mft record sizes below the sector size. */
808 if (vol->mft_record_size < vol->sector_size) { 808 if (vol->mft_record_size < vol->sector_size) {
@@ -810,7 +810,7 @@ static BOOL parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *b)
810 "sector size (%i). This is not supported. " 810 "sector size (%i). This is not supported. "
811 "Sorry.", vol->mft_record_size, 811 "Sorry.", vol->mft_record_size,
812 vol->sector_size); 812 vol->sector_size);
813 return FALSE; 813 return false;
814 } 814 }
815 clusters_per_index_record = b->clusters_per_index_record; 815 clusters_per_index_record = b->clusters_per_index_record;
816 ntfs_debug("clusters_per_index_record = %i (0x%x)", 816 ntfs_debug("clusters_per_index_record = %i (0x%x)",
@@ -841,7 +841,7 @@ static BOOL parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *b)
841 "the sector size (%i). This is not " 841 "the sector size (%i). This is not "
842 "supported. Sorry.", vol->index_record_size, 842 "supported. Sorry.", vol->index_record_size,
843 vol->sector_size); 843 vol->sector_size);
844 return FALSE; 844 return false;
845 } 845 }
846 /* 846 /*
847 * Get the size of the volume in clusters and check for 64-bit-ness. 847 * Get the size of the volume in clusters and check for 64-bit-ness.
@@ -851,7 +851,7 @@ static BOOL parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *b)
851 ll = sle64_to_cpu(b->number_of_sectors) >> sectors_per_cluster_bits; 851 ll = sle64_to_cpu(b->number_of_sectors) >> sectors_per_cluster_bits;
852 if ((u64)ll >= 1ULL << 32) { 852 if ((u64)ll >= 1ULL << 32) {
853 ntfs_error(vol->sb, "Cannot handle 64-bit clusters. Sorry."); 853 ntfs_error(vol->sb, "Cannot handle 64-bit clusters. Sorry.");
854 return FALSE; 854 return false;
855 } 855 }
856 vol->nr_clusters = ll; 856 vol->nr_clusters = ll;
857 ntfs_debug("vol->nr_clusters = 0x%llx", (long long)vol->nr_clusters); 857 ntfs_debug("vol->nr_clusters = 0x%llx", (long long)vol->nr_clusters);
@@ -867,7 +867,7 @@ static BOOL parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *b)
867 "Maximum supported is 2TiB. Sorry.", 867 "Maximum supported is 2TiB. Sorry.",
868 (unsigned long long)ll >> (40 - 868 (unsigned long long)ll >> (40 -
869 vol->cluster_size_bits)); 869 vol->cluster_size_bits));
870 return FALSE; 870 return false;
871 } 871 }
872 } 872 }
873 ll = sle64_to_cpu(b->mft_lcn); 873 ll = sle64_to_cpu(b->mft_lcn);
@@ -875,7 +875,7 @@ static BOOL parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *b)
875 ntfs_error(vol->sb, "MFT LCN (%lli, 0x%llx) is beyond end of " 875 ntfs_error(vol->sb, "MFT LCN (%lli, 0x%llx) is beyond end of "
876 "volume. Weird.", (unsigned long long)ll, 876 "volume. Weird.", (unsigned long long)ll,
877 (unsigned long long)ll); 877 (unsigned long long)ll);
878 return FALSE; 878 return false;
879 } 879 }
880 vol->mft_lcn = ll; 880 vol->mft_lcn = ll;
881 ntfs_debug("vol->mft_lcn = 0x%llx", (long long)vol->mft_lcn); 881 ntfs_debug("vol->mft_lcn = 0x%llx", (long long)vol->mft_lcn);
@@ -884,7 +884,7 @@ static BOOL parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *b)
884 ntfs_error(vol->sb, "MFTMirr LCN (%lli, 0x%llx) is beyond end " 884 ntfs_error(vol->sb, "MFTMirr LCN (%lli, 0x%llx) is beyond end "
885 "of volume. Weird.", (unsigned long long)ll, 885 "of volume. Weird.", (unsigned long long)ll,
886 (unsigned long long)ll); 886 (unsigned long long)ll);
887 return FALSE; 887 return false;
888 } 888 }
889 vol->mftmirr_lcn = ll; 889 vol->mftmirr_lcn = ll;
890 ntfs_debug("vol->mftmirr_lcn = 0x%llx", (long long)vol->mftmirr_lcn); 890 ntfs_debug("vol->mftmirr_lcn = 0x%llx", (long long)vol->mftmirr_lcn);
@@ -907,7 +907,7 @@ static BOOL parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *b)
907 vol->serial_no = le64_to_cpu(b->volume_serial_number); 907 vol->serial_no = le64_to_cpu(b->volume_serial_number);
908 ntfs_debug("vol->serial_no = 0x%llx", 908 ntfs_debug("vol->serial_no = 0x%llx",
909 (unsigned long long)vol->serial_no); 909 (unsigned long long)vol->serial_no);
910 return TRUE; 910 return true;
911} 911}
912 912
913/** 913/**
@@ -1000,9 +1000,9 @@ static void ntfs_setup_allocators(ntfs_volume *vol)
1000 * load_and_init_mft_mirror - load and setup the mft mirror inode for a volume 1000 * load_and_init_mft_mirror - load and setup the mft mirror inode for a volume
1001 * @vol: ntfs super block describing device whose mft mirror to load 1001 * @vol: ntfs super block describing device whose mft mirror to load
1002 * 1002 *
1003 * Return TRUE on success or FALSE on error. 1003 * Return 'true' on success or 'false' on error.
1004 */ 1004 */
1005static BOOL load_and_init_mft_mirror(ntfs_volume *vol) 1005static bool load_and_init_mft_mirror(ntfs_volume *vol)
1006{ 1006{
1007 struct inode *tmp_ino; 1007 struct inode *tmp_ino;
1008 ntfs_inode *tmp_ni; 1008 ntfs_inode *tmp_ni;
@@ -1014,7 +1014,7 @@ static BOOL load_and_init_mft_mirror(ntfs_volume *vol)
1014 if (!IS_ERR(tmp_ino)) 1014 if (!IS_ERR(tmp_ino))
1015 iput(tmp_ino); 1015 iput(tmp_ino);
1016 /* Caller will display error message. */ 1016 /* Caller will display error message. */
1017 return FALSE; 1017 return false;
1018 } 1018 }
1019 /* 1019 /*
1020 * Re-initialize some specifics about $MFTMirr's inode as 1020 * Re-initialize some specifics about $MFTMirr's inode as
@@ -1041,20 +1041,20 @@ static BOOL load_and_init_mft_mirror(ntfs_volume *vol)
1041 tmp_ni->itype.index.block_size_bits = vol->mft_record_size_bits; 1041 tmp_ni->itype.index.block_size_bits = vol->mft_record_size_bits;
1042 vol->mftmirr_ino = tmp_ino; 1042 vol->mftmirr_ino = tmp_ino;
1043 ntfs_debug("Done."); 1043 ntfs_debug("Done.");
1044 return TRUE; 1044 return true;
1045} 1045}
1046 1046
1047/** 1047/**
1048 * check_mft_mirror - compare contents of the mft mirror with the mft 1048 * check_mft_mirror - compare contents of the mft mirror with the mft
1049 * @vol: ntfs super block describing device whose mft mirror to check 1049 * @vol: ntfs super block describing device whose mft mirror to check
1050 * 1050 *
1051 * Return TRUE on success or FALSE on error. 1051 * Return 'true' on success or 'false' on error.
1052 * 1052 *
1053 * Note, this function also results in the mft mirror runlist being completely 1053 * Note, this function also results in the mft mirror runlist being completely
1054 * mapped into memory. The mft mirror write code requires this and will BUG() 1054 * mapped into memory. The mft mirror write code requires this and will BUG()
1055 * should it find an unmapped runlist element. 1055 * should it find an unmapped runlist element.
1056 */ 1056 */
1057static BOOL check_mft_mirror(ntfs_volume *vol) 1057static bool check_mft_mirror(ntfs_volume *vol)
1058{ 1058{
1059 struct super_block *sb = vol->sb; 1059 struct super_block *sb = vol->sb;
1060 ntfs_inode *mirr_ni; 1060 ntfs_inode *mirr_ni;
@@ -1086,7 +1086,7 @@ static BOOL check_mft_mirror(ntfs_volume *vol)
1086 index); 1086 index);
1087 if (IS_ERR(mft_page)) { 1087 if (IS_ERR(mft_page)) {
1088 ntfs_error(sb, "Failed to read $MFT."); 1088 ntfs_error(sb, "Failed to read $MFT.");
1089 return FALSE; 1089 return false;
1090 } 1090 }
1091 kmft = page_address(mft_page); 1091 kmft = page_address(mft_page);
1092 /* Get the $MFTMirr page. */ 1092 /* Get the $MFTMirr page. */
@@ -1110,7 +1110,7 @@ mm_unmap_out:
1110 ntfs_unmap_page(mirr_page); 1110 ntfs_unmap_page(mirr_page);
1111mft_unmap_out: 1111mft_unmap_out:
1112 ntfs_unmap_page(mft_page); 1112 ntfs_unmap_page(mft_page);
1113 return FALSE; 1113 return false;
1114 } 1114 }
1115 } 1115 }
1116 /* Do not check the mirror record if it is not in use. */ 1116 /* Do not check the mirror record if it is not in use. */
@@ -1169,21 +1169,21 @@ mft_unmap_out:
1169 ntfs_error(sb, "$MFTMirr location mismatch. " 1169 ntfs_error(sb, "$MFTMirr location mismatch. "
1170 "Run chkdsk."); 1170 "Run chkdsk.");
1171 up_read(&mirr_ni->runlist.lock); 1171 up_read(&mirr_ni->runlist.lock);
1172 return FALSE; 1172 return false;
1173 } 1173 }
1174 } while (rl2[i++].length); 1174 } while (rl2[i++].length);
1175 up_read(&mirr_ni->runlist.lock); 1175 up_read(&mirr_ni->runlist.lock);
1176 ntfs_debug("Done."); 1176 ntfs_debug("Done.");
1177 return TRUE; 1177 return true;
1178} 1178}
1179 1179
1180/** 1180/**
1181 * load_and_check_logfile - load and check the logfile inode for a volume 1181 * load_and_check_logfile - load and check the logfile inode for a volume
1182 * @vol: ntfs super block describing device whose logfile to load 1182 * @vol: ntfs super block describing device whose logfile to load
1183 * 1183 *
1184 * Return TRUE on success or FALSE on error. 1184 * Return 'true' on success or 'false' on error.
1185 */ 1185 */
1186static BOOL load_and_check_logfile(ntfs_volume *vol, 1186static bool load_and_check_logfile(ntfs_volume *vol,
1187 RESTART_PAGE_HEADER **rp) 1187 RESTART_PAGE_HEADER **rp)
1188{ 1188{
1189 struct inode *tmp_ino; 1189 struct inode *tmp_ino;
@@ -1194,17 +1194,17 @@ static BOOL load_and_check_logfile(ntfs_volume *vol,
1194 if (!IS_ERR(tmp_ino)) 1194 if (!IS_ERR(tmp_ino))
1195 iput(tmp_ino); 1195 iput(tmp_ino);
1196 /* Caller will display error message. */ 1196 /* Caller will display error message. */
1197 return FALSE; 1197 return false;
1198 } 1198 }
1199 if (!ntfs_check_logfile(tmp_ino, rp)) { 1199 if (!ntfs_check_logfile(tmp_ino, rp)) {
1200 iput(tmp_ino); 1200 iput(tmp_ino);
1201 /* ntfs_check_logfile() will have displayed error output. */ 1201 /* ntfs_check_logfile() will have displayed error output. */
1202 return FALSE; 1202 return false;
1203 } 1203 }
1204 NInoSetSparseDisabled(NTFS_I(tmp_ino)); 1204 NInoSetSparseDisabled(NTFS_I(tmp_ino));
1205 vol->logfile_ino = tmp_ino; 1205 vol->logfile_ino = tmp_ino;
1206 ntfs_debug("Done."); 1206 ntfs_debug("Done.");
1207 return TRUE; 1207 return true;
1208} 1208}
1209 1209
1210#define NTFS_HIBERFIL_HEADER_SIZE 4096 1210#define NTFS_HIBERFIL_HEADER_SIZE 4096
@@ -1329,10 +1329,10 @@ iput_out:
1329 * load_and_init_quota - load and setup the quota file for a volume if present 1329 * load_and_init_quota - load and setup the quota file for a volume if present
1330 * @vol: ntfs super block describing device whose quota file to load 1330 * @vol: ntfs super block describing device whose quota file to load
1331 * 1331 *
1332 * Return TRUE on success or FALSE on error. If $Quota is not present, we 1332 * Return 'true' on success or 'false' on error. If $Quota is not present, we
1333 * leave vol->quota_ino as NULL and return success. 1333 * leave vol->quota_ino as NULL and return success.
1334 */ 1334 */
1335static BOOL load_and_init_quota(ntfs_volume *vol) 1335static bool load_and_init_quota(ntfs_volume *vol)
1336{ 1336{
1337 MFT_REF mref; 1337 MFT_REF mref;
1338 struct inode *tmp_ino; 1338 struct inode *tmp_ino;
@@ -1366,11 +1366,11 @@ static BOOL load_and_init_quota(ntfs_volume *vol)
1366 * not enabled. 1366 * not enabled.
1367 */ 1367 */
1368 NVolSetQuotaOutOfDate(vol); 1368 NVolSetQuotaOutOfDate(vol);
1369 return TRUE; 1369 return true;
1370 } 1370 }
1371 /* A real error occured. */ 1371 /* A real error occured. */
1372 ntfs_error(vol->sb, "Failed to find inode number for $Quota."); 1372 ntfs_error(vol->sb, "Failed to find inode number for $Quota.");
1373 return FALSE; 1373 return false;
1374 } 1374 }
1375 /* We do not care for the type of match that was found. */ 1375 /* We do not care for the type of match that was found. */
1376 kfree(name); 1376 kfree(name);
@@ -1380,25 +1380,25 @@ static BOOL load_and_init_quota(ntfs_volume *vol)
1380 if (!IS_ERR(tmp_ino)) 1380 if (!IS_ERR(tmp_ino))
1381 iput(tmp_ino); 1381 iput(tmp_ino);
1382 ntfs_error(vol->sb, "Failed to load $Quota."); 1382 ntfs_error(vol->sb, "Failed to load $Quota.");
1383 return FALSE; 1383 return false;
1384 } 1384 }
1385 vol->quota_ino = tmp_ino; 1385 vol->quota_ino = tmp_ino;
1386 /* Get the $Q index allocation attribute. */ 1386 /* Get the $Q index allocation attribute. */
1387 tmp_ino = ntfs_index_iget(vol->quota_ino, Q, 2); 1387 tmp_ino = ntfs_index_iget(vol->quota_ino, Q, 2);
1388 if (IS_ERR(tmp_ino)) { 1388 if (IS_ERR(tmp_ino)) {
1389 ntfs_error(vol->sb, "Failed to load $Quota/$Q index."); 1389 ntfs_error(vol->sb, "Failed to load $Quota/$Q index.");
1390 return FALSE; 1390 return false;
1391 } 1391 }
1392 vol->quota_q_ino = tmp_ino; 1392 vol->quota_q_ino = tmp_ino;
1393 ntfs_debug("Done."); 1393 ntfs_debug("Done.");
1394 return TRUE; 1394 return true;
1395} 1395}
1396 1396
1397/** 1397/**
1398 * load_and_init_usnjrnl - load and setup the transaction log if present 1398 * load_and_init_usnjrnl - load and setup the transaction log if present
1399 * @vol: ntfs super block describing device whose usnjrnl file to load 1399 * @vol: ntfs super block describing device whose usnjrnl file to load
1400 * 1400 *
1401 * Return TRUE on success or FALSE on error. 1401 * Return 'true' on success or 'false' on error.
1402 * 1402 *
1403 * If $UsnJrnl is not present or in the process of being disabled, we set 1403 * If $UsnJrnl is not present or in the process of being disabled, we set
1404 * NVolUsnJrnlStamped() and return success. 1404 * NVolUsnJrnlStamped() and return success.
@@ -1408,7 +1408,7 @@ static BOOL load_and_init_quota(ntfs_volume *vol)
1408 * stamped and nothing has been logged since, we also set NVolUsnJrnlStamped() 1408 * stamped and nothing has been logged since, we also set NVolUsnJrnlStamped()
1409 * and return success. 1409 * and return success.
1410 */ 1410 */
1411static BOOL load_and_init_usnjrnl(ntfs_volume *vol) 1411static bool load_and_init_usnjrnl(ntfs_volume *vol)
1412{ 1412{
1413 MFT_REF mref; 1413 MFT_REF mref;
1414 struct inode *tmp_ino; 1414 struct inode *tmp_ino;
@@ -1450,12 +1450,12 @@ not_enabled:
1450 * transaction logging is not enabled. 1450 * transaction logging is not enabled.
1451 */ 1451 */
1452 NVolSetUsnJrnlStamped(vol); 1452 NVolSetUsnJrnlStamped(vol);
1453 return TRUE; 1453 return true;
1454 } 1454 }
1455 /* A real error occured. */ 1455 /* A real error occured. */
1456 ntfs_error(vol->sb, "Failed to find inode number for " 1456 ntfs_error(vol->sb, "Failed to find inode number for "
1457 "$UsnJrnl."); 1457 "$UsnJrnl.");
1458 return FALSE; 1458 return false;
1459 } 1459 }
1460 /* We do not care for the type of match that was found. */ 1460 /* We do not care for the type of match that was found. */
1461 kfree(name); 1461 kfree(name);
@@ -1465,7 +1465,7 @@ not_enabled:
1465 if (!IS_ERR(tmp_ino)) 1465 if (!IS_ERR(tmp_ino))
1466 iput(tmp_ino); 1466 iput(tmp_ino);
1467 ntfs_error(vol->sb, "Failed to load $UsnJrnl."); 1467 ntfs_error(vol->sb, "Failed to load $UsnJrnl.");
1468 return FALSE; 1468 return false;
1469 } 1469 }
1470 vol->usnjrnl_ino = tmp_ino; 1470 vol->usnjrnl_ino = tmp_ino;
1471 /* 1471 /*
@@ -1483,7 +1483,7 @@ not_enabled:
1483 if (IS_ERR(tmp_ino)) { 1483 if (IS_ERR(tmp_ino)) {
1484 ntfs_error(vol->sb, "Failed to load $UsnJrnl/$DATA/$Max " 1484 ntfs_error(vol->sb, "Failed to load $UsnJrnl/$DATA/$Max "
1485 "attribute."); 1485 "attribute.");
1486 return FALSE; 1486 return false;
1487 } 1487 }
1488 vol->usnjrnl_max_ino = tmp_ino; 1488 vol->usnjrnl_max_ino = tmp_ino;
1489 if (unlikely(i_size_read(tmp_ino) < sizeof(USN_HEADER))) { 1489 if (unlikely(i_size_read(tmp_ino) < sizeof(USN_HEADER))) {
@@ -1491,14 +1491,14 @@ not_enabled:
1491 "attribute (size is 0x%llx but should be at " 1491 "attribute (size is 0x%llx but should be at "
1492 "least 0x%zx bytes).", i_size_read(tmp_ino), 1492 "least 0x%zx bytes).", i_size_read(tmp_ino),
1493 sizeof(USN_HEADER)); 1493 sizeof(USN_HEADER));
1494 return FALSE; 1494 return false;
1495 } 1495 }
1496 /* Get the $DATA/$J attribute. */ 1496 /* Get the $DATA/$J attribute. */
1497 tmp_ino = ntfs_attr_iget(vol->usnjrnl_ino, AT_DATA, J, 2); 1497 tmp_ino = ntfs_attr_iget(vol->usnjrnl_ino, AT_DATA, J, 2);
1498 if (IS_ERR(tmp_ino)) { 1498 if (IS_ERR(tmp_ino)) {
1499 ntfs_error(vol->sb, "Failed to load $UsnJrnl/$DATA/$J " 1499 ntfs_error(vol->sb, "Failed to load $UsnJrnl/$DATA/$J "
1500 "attribute."); 1500 "attribute.");
1501 return FALSE; 1501 return false;
1502 } 1502 }
1503 vol->usnjrnl_j_ino = tmp_ino; 1503 vol->usnjrnl_j_ino = tmp_ino;
1504 /* Verify $J is non-resident and sparse. */ 1504 /* Verify $J is non-resident and sparse. */
@@ -1506,14 +1506,14 @@ not_enabled:
1506 if (unlikely(!NInoNonResident(tmp_ni) || !NInoSparse(tmp_ni))) { 1506 if (unlikely(!NInoNonResident(tmp_ni) || !NInoSparse(tmp_ni))) {
1507 ntfs_error(vol->sb, "$UsnJrnl/$DATA/$J attribute is resident " 1507 ntfs_error(vol->sb, "$UsnJrnl/$DATA/$J attribute is resident "
1508 "and/or not sparse."); 1508 "and/or not sparse.");
1509 return FALSE; 1509 return false;
1510 } 1510 }
1511 /* Read the USN_HEADER from $DATA/$Max. */ 1511 /* Read the USN_HEADER from $DATA/$Max. */
1512 page = ntfs_map_page(vol->usnjrnl_max_ino->i_mapping, 0); 1512 page = ntfs_map_page(vol->usnjrnl_max_ino->i_mapping, 0);
1513 if (IS_ERR(page)) { 1513 if (IS_ERR(page)) {
1514 ntfs_error(vol->sb, "Failed to read from $UsnJrnl/$DATA/$Max " 1514 ntfs_error(vol->sb, "Failed to read from $UsnJrnl/$DATA/$Max "
1515 "attribute."); 1515 "attribute.");
1516 return FALSE; 1516 return false;
1517 } 1517 }
1518 uh = (USN_HEADER*)page_address(page); 1518 uh = (USN_HEADER*)page_address(page);
1519 /* Sanity check the $Max. */ 1519 /* Sanity check the $Max. */
@@ -1524,7 +1524,7 @@ not_enabled:
1524 (long long)sle64_to_cpu(uh->allocation_delta), 1524 (long long)sle64_to_cpu(uh->allocation_delta),
1525 (long long)sle64_to_cpu(uh->maximum_size)); 1525 (long long)sle64_to_cpu(uh->maximum_size));
1526 ntfs_unmap_page(page); 1526 ntfs_unmap_page(page);
1527 return FALSE; 1527 return false;
1528 } 1528 }
1529 /* 1529 /*
1530 * If the transaction log has been stamped and nothing has been written 1530 * If the transaction log has been stamped and nothing has been written
@@ -1548,20 +1548,20 @@ not_enabled:
1548 (long long)sle64_to_cpu(uh->lowest_valid_usn), 1548 (long long)sle64_to_cpu(uh->lowest_valid_usn),
1549 i_size_read(vol->usnjrnl_j_ino)); 1549 i_size_read(vol->usnjrnl_j_ino));
1550 ntfs_unmap_page(page); 1550 ntfs_unmap_page(page);
1551 return FALSE; 1551 return false;
1552 } 1552 }
1553 ntfs_unmap_page(page); 1553 ntfs_unmap_page(page);
1554 ntfs_debug("Done."); 1554 ntfs_debug("Done.");
1555 return TRUE; 1555 return true;
1556} 1556}
1557 1557
1558/** 1558/**
1559 * load_and_init_attrdef - load the attribute definitions table for a volume 1559 * load_and_init_attrdef - load the attribute definitions table for a volume
1560 * @vol: ntfs super block describing device whose attrdef to load 1560 * @vol: ntfs super block describing device whose attrdef to load
1561 * 1561 *
1562 * Return TRUE on success or FALSE on error. 1562 * Return 'true' on success or 'false' on error.
1563 */ 1563 */
1564static BOOL load_and_init_attrdef(ntfs_volume *vol) 1564static bool load_and_init_attrdef(ntfs_volume *vol)
1565{ 1565{
1566 loff_t i_size; 1566 loff_t i_size;
1567 struct super_block *sb = vol->sb; 1567 struct super_block *sb = vol->sb;
@@ -1607,7 +1607,7 @@ read_partial_attrdef_page:
1607 vol->attrdef_size = i_size; 1607 vol->attrdef_size = i_size;
1608 ntfs_debug("Read %llu bytes from $AttrDef.", i_size); 1608 ntfs_debug("Read %llu bytes from $AttrDef.", i_size);
1609 iput(ino); 1609 iput(ino);
1610 return TRUE; 1610 return true;
1611free_iput_failed: 1611free_iput_failed:
1612 ntfs_free(vol->attrdef); 1612 ntfs_free(vol->attrdef);
1613 vol->attrdef = NULL; 1613 vol->attrdef = NULL;
@@ -1615,7 +1615,7 @@ iput_failed:
1615 iput(ino); 1615 iput(ino);
1616failed: 1616failed:
1617 ntfs_error(sb, "Failed to initialize attribute definition table."); 1617 ntfs_error(sb, "Failed to initialize attribute definition table.");
1618 return FALSE; 1618 return false;
1619} 1619}
1620 1620
1621#endif /* NTFS_RW */ 1621#endif /* NTFS_RW */
@@ -1624,9 +1624,9 @@ failed:
1624 * load_and_init_upcase - load the upcase table for an ntfs volume 1624 * load_and_init_upcase - load the upcase table for an ntfs volume
1625 * @vol: ntfs super block describing device whose upcase to load 1625 * @vol: ntfs super block describing device whose upcase to load
1626 * 1626 *
1627 * Return TRUE on success or FALSE on error. 1627 * Return 'true' on success or 'false' on error.
1628 */ 1628 */
1629static BOOL load_and_init_upcase(ntfs_volume *vol) 1629static bool load_and_init_upcase(ntfs_volume *vol)
1630{ 1630{
1631 loff_t i_size; 1631 loff_t i_size;
1632 struct super_block *sb = vol->sb; 1632 struct super_block *sb = vol->sb;
@@ -1682,7 +1682,7 @@ read_partial_upcase_page:
1682 ntfs_debug("Using volume specified $UpCase since default is " 1682 ntfs_debug("Using volume specified $UpCase since default is "
1683 "not present."); 1683 "not present.");
1684 mutex_unlock(&ntfs_lock); 1684 mutex_unlock(&ntfs_lock);
1685 return TRUE; 1685 return true;
1686 } 1686 }
1687 max = default_upcase_len; 1687 max = default_upcase_len;
1688 if (max > vol->upcase_len) 1688 if (max > vol->upcase_len)
@@ -1698,12 +1698,12 @@ read_partial_upcase_page:
1698 mutex_unlock(&ntfs_lock); 1698 mutex_unlock(&ntfs_lock);
1699 ntfs_debug("Volume specified $UpCase matches default. Using " 1699 ntfs_debug("Volume specified $UpCase matches default. Using "
1700 "default."); 1700 "default.");
1701 return TRUE; 1701 return true;
1702 } 1702 }
1703 mutex_unlock(&ntfs_lock); 1703 mutex_unlock(&ntfs_lock);
1704 ntfs_debug("Using volume specified $UpCase since it does not match " 1704 ntfs_debug("Using volume specified $UpCase since it does not match "
1705 "the default."); 1705 "the default.");
1706 return TRUE; 1706 return true;
1707iput_upcase_failed: 1707iput_upcase_failed:
1708 iput(ino); 1708 iput(ino);
1709 ntfs_free(vol->upcase); 1709 ntfs_free(vol->upcase);
@@ -1717,11 +1717,11 @@ upcase_failed:
1717 mutex_unlock(&ntfs_lock); 1717 mutex_unlock(&ntfs_lock);
1718 ntfs_error(sb, "Failed to load $UpCase from the volume. Using " 1718 ntfs_error(sb, "Failed to load $UpCase from the volume. Using "
1719 "default."); 1719 "default.");
1720 return TRUE; 1720 return true;
1721 } 1721 }
1722 mutex_unlock(&ntfs_lock); 1722 mutex_unlock(&ntfs_lock);
1723 ntfs_error(sb, "Failed to initialize upcase table."); 1723 ntfs_error(sb, "Failed to initialize upcase table.");
1724 return FALSE; 1724 return false;
1725} 1725}
1726 1726
1727/* 1727/*
@@ -1739,9 +1739,9 @@ static struct lock_class_key
1739 * Open the system files with normal access functions and complete setting up 1739 * Open the system files with normal access functions and complete setting up
1740 * the ntfs super block @vol. 1740 * the ntfs super block @vol.
1741 * 1741 *
1742 * Return TRUE on success or FALSE on error. 1742 * Return 'true' on success or 'false' on error.
1743 */ 1743 */
1744static BOOL load_system_files(ntfs_volume *vol) 1744static bool load_system_files(ntfs_volume *vol)
1745{ 1745{
1746 struct super_block *sb = vol->sb; 1746 struct super_block *sb = vol->sb;
1747 MFT_RECORD *m; 1747 MFT_RECORD *m;
@@ -2067,7 +2067,7 @@ get_ctx_vol_failed:
2067#endif /* NTFS_RW */ 2067#endif /* NTFS_RW */
2068 /* If on NTFS versions before 3.0, we are done. */ 2068 /* If on NTFS versions before 3.0, we are done. */
2069 if (unlikely(vol->major_ver < 3)) 2069 if (unlikely(vol->major_ver < 3))
2070 return TRUE; 2070 return true;
2071 /* NTFS 3.0+ specific initialization. */ 2071 /* NTFS 3.0+ specific initialization. */
2072 /* Get the security descriptors inode. */ 2072 /* Get the security descriptors inode. */
2073 vol->secure_ino = ntfs_iget(sb, FILE_Secure); 2073 vol->secure_ino = ntfs_iget(sb, FILE_Secure);
@@ -2173,7 +2173,7 @@ get_ctx_vol_failed:
2173 NVolSetErrors(vol); 2173 NVolSetErrors(vol);
2174 } 2174 }
2175#endif /* NTFS_RW */ 2175#endif /* NTFS_RW */
2176 return TRUE; 2176 return true;
2177#ifdef NTFS_RW 2177#ifdef NTFS_RW
2178iput_usnjrnl_err_out: 2178iput_usnjrnl_err_out:
2179 if (vol->usnjrnl_j_ino) 2179 if (vol->usnjrnl_j_ino)
@@ -2229,7 +2229,7 @@ iput_mirr_err_out:
2229 if (vol->mftmirr_ino) 2229 if (vol->mftmirr_ino)
2230 iput(vol->mftmirr_ino); 2230 iput(vol->mftmirr_ino);
2231#endif /* NTFS_RW */ 2231#endif /* NTFS_RW */
2232 return FALSE; 2232 return false;
2233} 2233}
2234 2234
2235/** 2235/**