aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ntfs/logfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ntfs/logfile.c')
-rw-r--r--fs/ntfs/logfile.c108
1 files changed, 54 insertions, 54 deletions
diff --git a/fs/ntfs/logfile.c b/fs/ntfs/logfile.c
index 4af2ad1193ec..acfed325f4ec 100644
--- a/fs/ntfs/logfile.c
+++ b/fs/ntfs/logfile.c
@@ -41,18 +41,18 @@
41 * @rp: restart page header to check 41 * @rp: restart page header to check
42 * @pos: position in @vi at which the restart page header resides 42 * @pos: position in @vi at which the restart page header resides
43 * 43 *
44 * Check the restart page header @rp for consistency and return TRUE if it is 44 * Check the restart page header @rp for consistency and return 'true' if it is
45 * consistent and FALSE otherwise. 45 * consistent and 'false' otherwise.
46 * 46 *
47 * This function only needs NTFS_BLOCK_SIZE bytes in @rp, i.e. it does not 47 * This function only needs NTFS_BLOCK_SIZE bytes in @rp, i.e. it does not
48 * require the full restart page. 48 * require the full restart page.
49 */ 49 */
50static BOOL ntfs_check_restart_page_header(struct inode *vi, 50static bool ntfs_check_restart_page_header(struct inode *vi,
51 RESTART_PAGE_HEADER *rp, s64 pos) 51 RESTART_PAGE_HEADER *rp, s64 pos)
52{ 52{
53 u32 logfile_system_page_size, logfile_log_page_size; 53 u32 logfile_system_page_size, logfile_log_page_size;
54 u16 ra_ofs, usa_count, usa_ofs, usa_end = 0; 54 u16 ra_ofs, usa_count, usa_ofs, usa_end = 0;
55 BOOL have_usa = TRUE; 55 bool have_usa = true;
56 56
57 ntfs_debug("Entering."); 57 ntfs_debug("Entering.");
58 /* 58 /*
@@ -67,7 +67,7 @@ static BOOL ntfs_check_restart_page_header(struct inode *vi,
67 (logfile_system_page_size - 1) || 67 (logfile_system_page_size - 1) ||
68 logfile_log_page_size & (logfile_log_page_size - 1)) { 68 logfile_log_page_size & (logfile_log_page_size - 1)) {
69 ntfs_error(vi->i_sb, "$LogFile uses unsupported page size."); 69 ntfs_error(vi->i_sb, "$LogFile uses unsupported page size.");
70 return FALSE; 70 return false;
71 } 71 }
72 /* 72 /*
73 * We must be either at !pos (1st restart page) or at pos = system page 73 * We must be either at !pos (1st restart page) or at pos = system page
@@ -76,7 +76,7 @@ static BOOL ntfs_check_restart_page_header(struct inode *vi,
76 if (pos && pos != logfile_system_page_size) { 76 if (pos && pos != logfile_system_page_size) {
77 ntfs_error(vi->i_sb, "Found restart area in incorrect " 77 ntfs_error(vi->i_sb, "Found restart area in incorrect "
78 "position in $LogFile."); 78 "position in $LogFile.");
79 return FALSE; 79 return false;
80 } 80 }
81 /* We only know how to handle version 1.1. */ 81 /* We only know how to handle version 1.1. */
82 if (sle16_to_cpu(rp->major_ver) != 1 || 82 if (sle16_to_cpu(rp->major_ver) != 1 ||
@@ -85,14 +85,14 @@ static BOOL ntfs_check_restart_page_header(struct inode *vi,
85 "supported. (This driver supports version " 85 "supported. (This driver supports version "
86 "1.1 only.)", (int)sle16_to_cpu(rp->major_ver), 86 "1.1 only.)", (int)sle16_to_cpu(rp->major_ver),
87 (int)sle16_to_cpu(rp->minor_ver)); 87 (int)sle16_to_cpu(rp->minor_ver));
88 return FALSE; 88 return false;
89 } 89 }
90 /* 90 /*
91 * If chkdsk has been run the restart page may not be protected by an 91 * If chkdsk has been run the restart page may not be protected by an
92 * update sequence array. 92 * update sequence array.
93 */ 93 */
94 if (ntfs_is_chkd_record(rp->magic) && !le16_to_cpu(rp->usa_count)) { 94 if (ntfs_is_chkd_record(rp->magic) && !le16_to_cpu(rp->usa_count)) {
95 have_usa = FALSE; 95 have_usa = false;
96 goto skip_usa_checks; 96 goto skip_usa_checks;
97 } 97 }
98 /* Verify the size of the update sequence array. */ 98 /* Verify the size of the update sequence array. */
@@ -100,7 +100,7 @@ static BOOL ntfs_check_restart_page_header(struct inode *vi,
100 if (usa_count != le16_to_cpu(rp->usa_count)) { 100 if (usa_count != le16_to_cpu(rp->usa_count)) {
101 ntfs_error(vi->i_sb, "$LogFile restart page specifies " 101 ntfs_error(vi->i_sb, "$LogFile restart page specifies "
102 "inconsistent update sequence array count."); 102 "inconsistent update sequence array count.");
103 return FALSE; 103 return false;
104 } 104 }
105 /* Verify the position of the update sequence array. */ 105 /* Verify the position of the update sequence array. */
106 usa_ofs = le16_to_cpu(rp->usa_ofs); 106 usa_ofs = le16_to_cpu(rp->usa_ofs);
@@ -109,7 +109,7 @@ static BOOL ntfs_check_restart_page_header(struct inode *vi,
109 usa_end > NTFS_BLOCK_SIZE - sizeof(u16)) { 109 usa_end > NTFS_BLOCK_SIZE - sizeof(u16)) {
110 ntfs_error(vi->i_sb, "$LogFile restart page specifies " 110 ntfs_error(vi->i_sb, "$LogFile restart page specifies "
111 "inconsistent update sequence array offset."); 111 "inconsistent update sequence array offset.");
112 return FALSE; 112 return false;
113 } 113 }
114skip_usa_checks: 114skip_usa_checks:
115 /* 115 /*
@@ -124,7 +124,7 @@ skip_usa_checks:
124 ra_ofs > logfile_system_page_size) { 124 ra_ofs > logfile_system_page_size) {
125 ntfs_error(vi->i_sb, "$LogFile restart page specifies " 125 ntfs_error(vi->i_sb, "$LogFile restart page specifies "
126 "inconsistent restart area offset."); 126 "inconsistent restart area offset.");
127 return FALSE; 127 return false;
128 } 128 }
129 /* 129 /*
130 * Only restart pages modified by chkdsk are allowed to have chkdsk_lsn 130 * Only restart pages modified by chkdsk are allowed to have chkdsk_lsn
@@ -133,10 +133,10 @@ skip_usa_checks:
133 if (!ntfs_is_chkd_record(rp->magic) && sle64_to_cpu(rp->chkdsk_lsn)) { 133 if (!ntfs_is_chkd_record(rp->magic) && sle64_to_cpu(rp->chkdsk_lsn)) {
134 ntfs_error(vi->i_sb, "$LogFile restart page is not modified " 134 ntfs_error(vi->i_sb, "$LogFile restart page is not modified "
135 "by chkdsk but a chkdsk LSN is specified."); 135 "by chkdsk but a chkdsk LSN is specified.");
136 return FALSE; 136 return false;
137 } 137 }
138 ntfs_debug("Done."); 138 ntfs_debug("Done.");
139 return TRUE; 139 return true;
140} 140}
141 141
142/** 142/**
@@ -145,7 +145,7 @@ skip_usa_checks:
145 * @rp: restart page whose restart area to check 145 * @rp: restart page whose restart area to check
146 * 146 *
147 * Check the restart area of the restart page @rp for consistency and return 147 * Check the restart area of the restart page @rp for consistency and return
148 * TRUE if it is consistent and FALSE otherwise. 148 * 'true' if it is consistent and 'false' otherwise.
149 * 149 *
150 * This function assumes that the restart page header has already been 150 * This function assumes that the restart page header has already been
151 * consistency checked. 151 * consistency checked.
@@ -153,7 +153,7 @@ skip_usa_checks:
153 * This function only needs NTFS_BLOCK_SIZE bytes in @rp, i.e. it does not 153 * This function only needs NTFS_BLOCK_SIZE bytes in @rp, i.e. it does not
154 * require the full restart page. 154 * require the full restart page.
155 */ 155 */
156static BOOL ntfs_check_restart_area(struct inode *vi, RESTART_PAGE_HEADER *rp) 156static bool ntfs_check_restart_area(struct inode *vi, RESTART_PAGE_HEADER *rp)
157{ 157{
158 u64 file_size; 158 u64 file_size;
159 RESTART_AREA *ra; 159 RESTART_AREA *ra;
@@ -172,7 +172,7 @@ static BOOL ntfs_check_restart_area(struct inode *vi, RESTART_PAGE_HEADER *rp)
172 NTFS_BLOCK_SIZE - sizeof(u16)) { 172 NTFS_BLOCK_SIZE - sizeof(u16)) {
173 ntfs_error(vi->i_sb, "$LogFile restart area specifies " 173 ntfs_error(vi->i_sb, "$LogFile restart area specifies "
174 "inconsistent file offset."); 174 "inconsistent file offset.");
175 return FALSE; 175 return false;
176 } 176 }
177 /* 177 /*
178 * Now that we can access ra->client_array_offset, make sure everything 178 * Now that we can access ra->client_array_offset, make sure everything
@@ -186,7 +186,7 @@ static BOOL ntfs_check_restart_area(struct inode *vi, RESTART_PAGE_HEADER *rp)
186 ra_ofs + ca_ofs > NTFS_BLOCK_SIZE - sizeof(u16)) { 186 ra_ofs + ca_ofs > NTFS_BLOCK_SIZE - sizeof(u16)) {
187 ntfs_error(vi->i_sb, "$LogFile restart area specifies " 187 ntfs_error(vi->i_sb, "$LogFile restart area specifies "
188 "inconsistent client array offset."); 188 "inconsistent client array offset.");
189 return FALSE; 189 return false;
190 } 190 }
191 /* 191 /*
192 * The restart area must end within the system page size both when 192 * The restart area must end within the system page size both when
@@ -203,7 +203,7 @@ static BOOL ntfs_check_restart_area(struct inode *vi, RESTART_PAGE_HEADER *rp)
203 "of the system page size specified by the " 203 "of the system page size specified by the "
204 "restart page header and/or the specified " 204 "restart page header and/or the specified "
205 "restart area length is inconsistent."); 205 "restart area length is inconsistent.");
206 return FALSE; 206 return false;
207 } 207 }
208 /* 208 /*
209 * The ra->client_free_list and ra->client_in_use_list must be either 209 * The ra->client_free_list and ra->client_in_use_list must be either
@@ -218,7 +218,7 @@ static BOOL ntfs_check_restart_area(struct inode *vi, RESTART_PAGE_HEADER *rp)
218 le16_to_cpu(ra->log_clients))) { 218 le16_to_cpu(ra->log_clients))) {
219 ntfs_error(vi->i_sb, "$LogFile restart area specifies " 219 ntfs_error(vi->i_sb, "$LogFile restart area specifies "
220 "overflowing client free and/or in use lists."); 220 "overflowing client free and/or in use lists.");
221 return FALSE; 221 return false;
222 } 222 }
223 /* 223 /*
224 * Check ra->seq_number_bits against ra->file_size for consistency. 224 * Check ra->seq_number_bits against ra->file_size for consistency.
@@ -233,24 +233,24 @@ static BOOL ntfs_check_restart_area(struct inode *vi, RESTART_PAGE_HEADER *rp)
233 if (le32_to_cpu(ra->seq_number_bits) != 67 - fs_bits) { 233 if (le32_to_cpu(ra->seq_number_bits) != 67 - fs_bits) {
234 ntfs_error(vi->i_sb, "$LogFile restart area specifies " 234 ntfs_error(vi->i_sb, "$LogFile restart area specifies "
235 "inconsistent sequence number bits."); 235 "inconsistent sequence number bits.");
236 return FALSE; 236 return false;
237 } 237 }
238 /* The log record header length must be a multiple of 8. */ 238 /* The log record header length must be a multiple of 8. */
239 if (((le16_to_cpu(ra->log_record_header_length) + 7) & ~7) != 239 if (((le16_to_cpu(ra->log_record_header_length) + 7) & ~7) !=
240 le16_to_cpu(ra->log_record_header_length)) { 240 le16_to_cpu(ra->log_record_header_length)) {
241 ntfs_error(vi->i_sb, "$LogFile restart area specifies " 241 ntfs_error(vi->i_sb, "$LogFile restart area specifies "
242 "inconsistent log record header length."); 242 "inconsistent log record header length.");
243 return FALSE; 243 return false;
244 } 244 }
245 /* Dito for the log page data offset. */ 245 /* Dito for the log page data offset. */
246 if (((le16_to_cpu(ra->log_page_data_offset) + 7) & ~7) != 246 if (((le16_to_cpu(ra->log_page_data_offset) + 7) & ~7) !=
247 le16_to_cpu(ra->log_page_data_offset)) { 247 le16_to_cpu(ra->log_page_data_offset)) {
248 ntfs_error(vi->i_sb, "$LogFile restart area specifies " 248 ntfs_error(vi->i_sb, "$LogFile restart area specifies "
249 "inconsistent log page data offset."); 249 "inconsistent log page data offset.");
250 return FALSE; 250 return false;
251 } 251 }
252 ntfs_debug("Done."); 252 ntfs_debug("Done.");
253 return TRUE; 253 return true;
254} 254}
255 255
256/** 256/**
@@ -259,7 +259,7 @@ static BOOL ntfs_check_restart_area(struct inode *vi, RESTART_PAGE_HEADER *rp)
259 * @rp: restart page whose log client array to check 259 * @rp: restart page whose log client array to check
260 * 260 *
261 * Check the log client array of the restart page @rp for consistency and 261 * Check the log client array of the restart page @rp for consistency and
262 * return TRUE if it is consistent and FALSE otherwise. 262 * return 'true' if it is consistent and 'false' otherwise.
263 * 263 *
264 * This function assumes that the restart page header and the restart area have 264 * This function assumes that the restart page header and the restart area have
265 * already been consistency checked. 265 * already been consistency checked.
@@ -268,13 +268,13 @@ static BOOL ntfs_check_restart_area(struct inode *vi, RESTART_PAGE_HEADER *rp)
268 * function needs @rp->system_page_size bytes in @rp, i.e. it requires the full 268 * function needs @rp->system_page_size bytes in @rp, i.e. it requires the full
269 * restart page and the page must be multi sector transfer deprotected. 269 * restart page and the page must be multi sector transfer deprotected.
270 */ 270 */
271static BOOL ntfs_check_log_client_array(struct inode *vi, 271static bool ntfs_check_log_client_array(struct inode *vi,
272 RESTART_PAGE_HEADER *rp) 272 RESTART_PAGE_HEADER *rp)
273{ 273{
274 RESTART_AREA *ra; 274 RESTART_AREA *ra;
275 LOG_CLIENT_RECORD *ca, *cr; 275 LOG_CLIENT_RECORD *ca, *cr;
276 u16 nr_clients, idx; 276 u16 nr_clients, idx;
277 BOOL in_free_list, idx_is_first; 277 bool in_free_list, idx_is_first;
278 278
279 ntfs_debug("Entering."); 279 ntfs_debug("Entering.");
280 ra = (RESTART_AREA*)((u8*)rp + le16_to_cpu(rp->restart_area_offset)); 280 ra = (RESTART_AREA*)((u8*)rp + le16_to_cpu(rp->restart_area_offset));
@@ -290,9 +290,9 @@ static BOOL ntfs_check_log_client_array(struct inode *vi,
290 */ 290 */
291 nr_clients = le16_to_cpu(ra->log_clients); 291 nr_clients = le16_to_cpu(ra->log_clients);
292 idx = le16_to_cpu(ra->client_free_list); 292 idx = le16_to_cpu(ra->client_free_list);
293 in_free_list = TRUE; 293 in_free_list = true;
294check_list: 294check_list:
295 for (idx_is_first = TRUE; idx != LOGFILE_NO_CLIENT_CPU; nr_clients--, 295 for (idx_is_first = true; idx != LOGFILE_NO_CLIENT_CPU; nr_clients--,
296 idx = le16_to_cpu(cr->next_client)) { 296 idx = le16_to_cpu(cr->next_client)) {
297 if (!nr_clients || idx >= le16_to_cpu(ra->log_clients)) 297 if (!nr_clients || idx >= le16_to_cpu(ra->log_clients))
298 goto err_out; 298 goto err_out;
@@ -302,20 +302,20 @@ check_list:
302 if (idx_is_first) { 302 if (idx_is_first) {
303 if (cr->prev_client != LOGFILE_NO_CLIENT) 303 if (cr->prev_client != LOGFILE_NO_CLIENT)
304 goto err_out; 304 goto err_out;
305 idx_is_first = FALSE; 305 idx_is_first = false;
306 } 306 }
307 } 307 }
308 /* Switch to and check the in use list if we just did the free list. */ 308 /* Switch to and check the in use list if we just did the free list. */
309 if (in_free_list) { 309 if (in_free_list) {
310 in_free_list = FALSE; 310 in_free_list = false;
311 idx = le16_to_cpu(ra->client_in_use_list); 311 idx = le16_to_cpu(ra->client_in_use_list);
312 goto check_list; 312 goto check_list;
313 } 313 }
314 ntfs_debug("Done."); 314 ntfs_debug("Done.");
315 return TRUE; 315 return true;
316err_out: 316err_out:
317 ntfs_error(vi->i_sb, "$LogFile log client array is corrupt."); 317 ntfs_error(vi->i_sb, "$LogFile log client array is corrupt.");
318 return FALSE; 318 return false;
319} 319}
320 320
321/** 321/**
@@ -468,8 +468,8 @@ err_out:
468 * @log_vi: struct inode of loaded journal $LogFile to check 468 * @log_vi: struct inode of loaded journal $LogFile to check
469 * @rp: [OUT] on success this is a copy of the current restart page 469 * @rp: [OUT] on success this is a copy of the current restart page
470 * 470 *
471 * Check the $LogFile journal for consistency and return TRUE if it is 471 * Check the $LogFile journal for consistency and return 'true' if it is
472 * consistent and FALSE if not. On success, the current restart page is 472 * consistent and 'false' if not. On success, the current restart page is
473 * returned in *@rp. Caller must call ntfs_free(*@rp) when finished with it. 473 * returned in *@rp. Caller must call ntfs_free(*@rp) when finished with it.
474 * 474 *
475 * At present we only check the two restart pages and ignore the log record 475 * At present we only check the two restart pages and ignore the log record
@@ -480,7 +480,7 @@ err_out:
480 * if the $LogFile was created on a system with a different page size to ours 480 * if the $LogFile was created on a system with a different page size to ours
481 * yet and mst deprotection would fail if our page size is smaller. 481 * yet and mst deprotection would fail if our page size is smaller.
482 */ 482 */
483BOOL ntfs_check_logfile(struct inode *log_vi, RESTART_PAGE_HEADER **rp) 483bool ntfs_check_logfile(struct inode *log_vi, RESTART_PAGE_HEADER **rp)
484{ 484{
485 s64 size, pos; 485 s64 size, pos;
486 LSN rstr1_lsn, rstr2_lsn; 486 LSN rstr1_lsn, rstr2_lsn;
@@ -491,7 +491,7 @@ BOOL ntfs_check_logfile(struct inode *log_vi, RESTART_PAGE_HEADER **rp)
491 RESTART_PAGE_HEADER *rstr1_ph = NULL; 491 RESTART_PAGE_HEADER *rstr1_ph = NULL;
492 RESTART_PAGE_HEADER *rstr2_ph = NULL; 492 RESTART_PAGE_HEADER *rstr2_ph = NULL;
493 int log_page_size, log_page_mask, err; 493 int log_page_size, log_page_mask, err;
494 BOOL logfile_is_empty = TRUE; 494 bool logfile_is_empty = true;
495 u8 log_page_bits; 495 u8 log_page_bits;
496 496
497 ntfs_debug("Entering."); 497 ntfs_debug("Entering.");
@@ -527,7 +527,7 @@ BOOL ntfs_check_logfile(struct inode *log_vi, RESTART_PAGE_HEADER **rp)
527 if (size < log_page_size * 2 || (size - log_page_size * 2) >> 527 if (size < log_page_size * 2 || (size - log_page_size * 2) >>
528 log_page_bits < MinLogRecordPages) { 528 log_page_bits < MinLogRecordPages) {
529 ntfs_error(vol->sb, "$LogFile is too small."); 529 ntfs_error(vol->sb, "$LogFile is too small.");
530 return FALSE; 530 return false;
531 } 531 }
532 /* 532 /*
533 * Read through the file looking for a restart page. Since the restart 533 * Read through the file looking for a restart page. Since the restart
@@ -556,7 +556,7 @@ BOOL ntfs_check_logfile(struct inode *log_vi, RESTART_PAGE_HEADER **rp)
556 * means we are done. 556 * means we are done.
557 */ 557 */
558 if (!ntfs_is_empty_recordp((le32*)kaddr)) 558 if (!ntfs_is_empty_recordp((le32*)kaddr))
559 logfile_is_empty = FALSE; 559 logfile_is_empty = false;
560 else if (!logfile_is_empty) 560 else if (!logfile_is_empty)
561 break; 561 break;
562 /* 562 /*
@@ -615,13 +615,13 @@ BOOL ntfs_check_logfile(struct inode *log_vi, RESTART_PAGE_HEADER **rp)
615 NVolSetLogFileEmpty(vol); 615 NVolSetLogFileEmpty(vol);
616is_empty: 616is_empty:
617 ntfs_debug("Done. ($LogFile is empty.)"); 617 ntfs_debug("Done. ($LogFile is empty.)");
618 return TRUE; 618 return true;
619 } 619 }
620 if (!rstr1_ph) { 620 if (!rstr1_ph) {
621 BUG_ON(rstr2_ph); 621 BUG_ON(rstr2_ph);
622 ntfs_error(vol->sb, "Did not find any restart pages in " 622 ntfs_error(vol->sb, "Did not find any restart pages in "
623 "$LogFile and it was not empty."); 623 "$LogFile and it was not empty.");
624 return FALSE; 624 return false;
625 } 625 }
626 /* If both restart pages were found, use the more recent one. */ 626 /* If both restart pages were found, use the more recent one. */
627 if (rstr2_ph) { 627 if (rstr2_ph) {
@@ -648,11 +648,11 @@ is_empty:
648 else 648 else
649 ntfs_free(rstr1_ph); 649 ntfs_free(rstr1_ph);
650 ntfs_debug("Done."); 650 ntfs_debug("Done.");
651 return TRUE; 651 return true;
652err_out: 652err_out:
653 if (rstr1_ph) 653 if (rstr1_ph)
654 ntfs_free(rstr1_ph); 654 ntfs_free(rstr1_ph);
655 return FALSE; 655 return false;
656} 656}
657 657
658/** 658/**
@@ -660,8 +660,8 @@ err_out:
660 * @log_vi: struct inode of loaded journal $LogFile to check 660 * @log_vi: struct inode of loaded journal $LogFile to check
661 * @rp: copy of the current restart page 661 * @rp: copy of the current restart page
662 * 662 *
663 * Analyze the $LogFile journal and return TRUE if it indicates the volume was 663 * Analyze the $LogFile journal and return 'true' if it indicates the volume was
664 * shutdown cleanly and FALSE if not. 664 * shutdown cleanly and 'false' if not.
665 * 665 *
666 * At present we only look at the two restart pages and ignore the log record 666 * At present we only look at the two restart pages and ignore the log record
667 * pages. This is a little bit crude in that there will be a very small number 667 * pages. This is a little bit crude in that there will be a very small number
@@ -675,7 +675,7 @@ err_out:
675 * is empty this function requires that NVolLogFileEmpty() is true otherwise an 675 * is empty this function requires that NVolLogFileEmpty() is true otherwise an
676 * empty volume will be reported as dirty. 676 * empty volume will be reported as dirty.
677 */ 677 */
678BOOL ntfs_is_logfile_clean(struct inode *log_vi, const RESTART_PAGE_HEADER *rp) 678bool ntfs_is_logfile_clean(struct inode *log_vi, const RESTART_PAGE_HEADER *rp)
679{ 679{
680 ntfs_volume *vol = NTFS_SB(log_vi->i_sb); 680 ntfs_volume *vol = NTFS_SB(log_vi->i_sb);
681 RESTART_AREA *ra; 681 RESTART_AREA *ra;
@@ -684,7 +684,7 @@ BOOL ntfs_is_logfile_clean(struct inode *log_vi, const RESTART_PAGE_HEADER *rp)
684 /* An empty $LogFile must have been clean before it got emptied. */ 684 /* An empty $LogFile must have been clean before it got emptied. */
685 if (NVolLogFileEmpty(vol)) { 685 if (NVolLogFileEmpty(vol)) {
686 ntfs_debug("Done. ($LogFile is empty.)"); 686 ntfs_debug("Done. ($LogFile is empty.)");
687 return TRUE; 687 return true;
688 } 688 }
689 BUG_ON(!rp); 689 BUG_ON(!rp);
690 if (!ntfs_is_rstr_record(rp->magic) && 690 if (!ntfs_is_rstr_record(rp->magic) &&
@@ -693,7 +693,7 @@ BOOL ntfs_is_logfile_clean(struct inode *log_vi, const RESTART_PAGE_HEADER *rp)
693 "probably a bug in that the $LogFile should " 693 "probably a bug in that the $LogFile should "
694 "have been consistency checked before calling " 694 "have been consistency checked before calling "
695 "this function."); 695 "this function.");
696 return FALSE; 696 return false;
697 } 697 }
698 ra = (RESTART_AREA*)((u8*)rp + le16_to_cpu(rp->restart_area_offset)); 698 ra = (RESTART_AREA*)((u8*)rp + le16_to_cpu(rp->restart_area_offset));
699 /* 699 /*
@@ -704,25 +704,25 @@ BOOL ntfs_is_logfile_clean(struct inode *log_vi, const RESTART_PAGE_HEADER *rp)
704 if (ra->client_in_use_list != LOGFILE_NO_CLIENT && 704 if (ra->client_in_use_list != LOGFILE_NO_CLIENT &&
705 !(ra->flags & RESTART_VOLUME_IS_CLEAN)) { 705 !(ra->flags & RESTART_VOLUME_IS_CLEAN)) {
706 ntfs_debug("Done. $LogFile indicates a dirty shutdown."); 706 ntfs_debug("Done. $LogFile indicates a dirty shutdown.");
707 return FALSE; 707 return false;
708 } 708 }
709 /* $LogFile indicates a clean shutdown. */ 709 /* $LogFile indicates a clean shutdown. */
710 ntfs_debug("Done. $LogFile indicates a clean shutdown."); 710 ntfs_debug("Done. $LogFile indicates a clean shutdown.");
711 return TRUE; 711 return true;
712} 712}
713 713
714/** 714/**
715 * ntfs_empty_logfile - empty the contents of the $LogFile journal 715 * ntfs_empty_logfile - empty the contents of the $LogFile journal
716 * @log_vi: struct inode of loaded journal $LogFile to empty 716 * @log_vi: struct inode of loaded journal $LogFile to empty
717 * 717 *
718 * Empty the contents of the $LogFile journal @log_vi and return TRUE on 718 * Empty the contents of the $LogFile journal @log_vi and return 'true' on
719 * success and FALSE on error. 719 * success and 'false' on error.
720 * 720 *
721 * This function assumes that the $LogFile journal has already been consistency 721 * This function assumes that the $LogFile journal has already been consistency
722 * checked by a call to ntfs_check_logfile() and that ntfs_is_logfile_clean() 722 * checked by a call to ntfs_check_logfile() and that ntfs_is_logfile_clean()
723 * has been used to ensure that the $LogFile is clean. 723 * has been used to ensure that the $LogFile is clean.
724 */ 724 */
725BOOL ntfs_empty_logfile(struct inode *log_vi) 725bool ntfs_empty_logfile(struct inode *log_vi)
726{ 726{
727 ntfs_volume *vol = NTFS_SB(log_vi->i_sb); 727 ntfs_volume *vol = NTFS_SB(log_vi->i_sb);
728 728
@@ -735,13 +735,13 @@ BOOL ntfs_empty_logfile(struct inode *log_vi)
735 if (unlikely(err)) { 735 if (unlikely(err)) {
736 ntfs_error(vol->sb, "Failed to fill $LogFile with " 736 ntfs_error(vol->sb, "Failed to fill $LogFile with "
737 "0xff bytes (error code %i).", err); 737 "0xff bytes (error code %i).", err);
738 return FALSE; 738 return false;
739 } 739 }
740 /* Set the flag so we do not have to do it again on remount. */ 740 /* Set the flag so we do not have to do it again on remount. */
741 NVolSetLogFileEmpty(vol); 741 NVolSetLogFileEmpty(vol);
742 } 742 }
743 ntfs_debug("Done."); 743 ntfs_debug("Done.");
744 return TRUE; 744 return true;
745} 745}
746 746
747#endif /* NTFS_RW */ 747#endif /* NTFS_RW */