Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] fs/ntfs: Conversion to generic boolean

Conversion of booleans to: generic-boolean.patch (2006-08-23)

Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Richard Knutsson and committed by
Linus Torvalds
c49c3111 6e218287

+326 -331
+15 -15
fs/ntfs/aops.c
··· 254 254 bh->b_bdev = vol->sb->s_bdev; 255 255 /* Is the block within the allowed limits? */ 256 256 if (iblock < lblock) { 257 - BOOL is_retry = FALSE; 257 + bool is_retry = false; 258 258 259 259 /* Convert iblock into corresponding vcn and offset. */ 260 260 vcn = (VCN)iblock << blocksize_bits >> ··· 292 292 goto handle_hole; 293 293 /* If first try and runlist unmapped, map and retry. */ 294 294 if (!is_retry && lcn == LCN_RL_NOT_MAPPED) { 295 - is_retry = TRUE; 295 + is_retry = true; 296 296 /* 297 297 * Attempt to map runlist, dropping lock for 298 298 * the duration. ··· 558 558 unsigned long flags; 559 559 unsigned int blocksize, vcn_ofs; 560 560 int err; 561 - BOOL need_end_writeback; 561 + bool need_end_writeback; 562 562 unsigned char blocksize_bits; 563 563 564 564 vi = page->mapping->host; ··· 626 626 rl = NULL; 627 627 err = 0; 628 628 do { 629 - BOOL is_retry = FALSE; 629 + bool is_retry = false; 630 630 631 631 if (unlikely(block >= dblock)) { 632 632 /* ··· 768 768 } 769 769 /* If first try and runlist unmapped, map and retry. */ 770 770 if (!is_retry && lcn == LCN_RL_NOT_MAPPED) { 771 - is_retry = TRUE; 771 + is_retry = true; 772 772 /* 773 773 * Attempt to map runlist, dropping lock for 774 774 * the duration. ··· 874 874 set_page_writeback(page); /* Keeps try_to_free_buffers() away. */ 875 875 876 876 /* Submit the prepared buffers for i/o. */ 877 - need_end_writeback = TRUE; 877 + need_end_writeback = true; 878 878 do { 879 879 struct buffer_head *next = bh->b_this_page; 880 880 if (buffer_async_write(bh)) { 881 881 submit_bh(WRITE, bh); 882 - need_end_writeback = FALSE; 882 + need_end_writeback = false; 883 883 } 884 884 bh = next; 885 885 } while (bh != head); ··· 932 932 runlist_element *rl; 933 933 int i, nr_locked_nis, nr_recs, nr_bhs, max_bhs, bhs_per_rec, err, err2; 934 934 unsigned bh_size, rec_size_bits; 935 - BOOL sync, is_mft, page_is_dirty, rec_is_dirty; 935 + bool sync, is_mft, page_is_dirty, rec_is_dirty; 936 936 unsigned char bh_size_bits; 937 937 938 938 ntfs_debug("Entering for inode 0x%lx, attribute type 0x%x, page index " ··· 975 975 976 976 rl = NULL; 977 977 err = err2 = nr_bhs = nr_recs = nr_locked_nis = 0; 978 - page_is_dirty = rec_is_dirty = FALSE; 978 + page_is_dirty = rec_is_dirty = false; 979 979 rec_start_bh = NULL; 980 980 do { 981 - BOOL is_retry = FALSE; 981 + bool is_retry = false; 982 982 983 983 if (likely(block < rec_block)) { 984 984 if (unlikely(block >= dblock)) { ··· 1009 1009 } 1010 1010 if (!buffer_dirty(bh)) { 1011 1011 /* Clean records are not written out. */ 1012 - rec_is_dirty = FALSE; 1012 + rec_is_dirty = false; 1013 1013 continue; 1014 1014 } 1015 - rec_is_dirty = TRUE; 1015 + rec_is_dirty = true; 1016 1016 rec_start_bh = bh; 1017 1017 } 1018 1018 /* Need to map the buffer if it is not mapped already. */ ··· 1053 1053 */ 1054 1054 if (!is_mft && !is_retry && 1055 1055 lcn == LCN_RL_NOT_MAPPED) { 1056 - is_retry = TRUE; 1056 + is_retry = true; 1057 1057 /* 1058 1058 * Attempt to map runlist, dropping 1059 1059 * lock for the duration. ··· 1063 1063 if (likely(!err2)) 1064 1064 goto lock_retry_remap; 1065 1065 if (err2 == -ENOMEM) 1066 - page_is_dirty = TRUE; 1066 + page_is_dirty = true; 1067 1067 lcn = err2; 1068 1068 } else { 1069 1069 err2 = -EIO; ··· 1145 1145 * means we need to redirty the page before 1146 1146 * returning. 1147 1147 */ 1148 - page_is_dirty = TRUE; 1148 + page_is_dirty = true; 1149 1149 /* 1150 1150 * Remove the buffers in this mft record from 1151 1151 * the list of buffers to write.
+1 -1
fs/ntfs/aops.h
··· 80 80 * 81 81 * The unlocked and uptodate page is returned on success or an encoded error 82 82 * on failure. Caller has to test for error using the IS_ERR() macro on the 83 - * return value. If that evaluates to TRUE, the negative error code can be 83 + * return value. If that evaluates to 'true', the negative error code can be 84 84 * obtained using PTR_ERR() on the return value of ntfs_map_page(). 85 85 */ 86 86 static inline struct page *ntfs_map_page(struct address_space *mapping,
+27 -27
fs/ntfs/attrib.c
··· 67 67 * the attribute has zero allocated size, i.e. there simply is no runlist. 68 68 * 69 69 * WARNING: If @ctx is supplied, regardless of whether success or failure is 70 - * returned, you need to check IS_ERR(@ctx->mrec) and if TRUE the @ctx 70 + * returned, you need to check IS_ERR(@ctx->mrec) and if 'true' the @ctx 71 71 * is no longer valid, i.e. you need to either call 72 72 * ntfs_attr_reinit_search_ctx() or ntfs_attr_put_search_ctx() on it. 73 73 * In that case PTR_ERR(@ctx->mrec) will give you the error code for ··· 90 90 runlist_element *rl; 91 91 struct page *put_this_page = NULL; 92 92 int err = 0; 93 - BOOL ctx_is_temporary, ctx_needs_reset; 93 + bool ctx_is_temporary, ctx_needs_reset; 94 94 ntfs_attr_search_ctx old_ctx = { NULL, }; 95 95 96 96 ntfs_debug("Mapping runlist part containing vcn 0x%llx.", ··· 100 100 else 101 101 base_ni = ni->ext.base_ntfs_ino; 102 102 if (!ctx) { 103 - ctx_is_temporary = ctx_needs_reset = TRUE; 103 + ctx_is_temporary = ctx_needs_reset = true; 104 104 m = map_mft_record(base_ni); 105 105 if (IS_ERR(m)) 106 106 return PTR_ERR(m); ··· 115 115 BUG_ON(IS_ERR(ctx->mrec)); 116 116 a = ctx->attr; 117 117 BUG_ON(!a->non_resident); 118 - ctx_is_temporary = FALSE; 118 + ctx_is_temporary = false; 119 119 end_vcn = sle64_to_cpu(a->data.non_resident.highest_vcn); 120 120 read_lock_irqsave(&ni->size_lock, flags); 121 121 allocated_size_vcn = ni->allocated_size >> ··· 136 136 ni->name, ni->name_len) && 137 137 sle64_to_cpu(a->data.non_resident.lowest_vcn) 138 138 <= vcn && end_vcn >= vcn)) 139 - ctx_needs_reset = FALSE; 139 + ctx_needs_reset = false; 140 140 else { 141 141 /* Save the old search context. */ 142 142 old_ctx = *ctx; ··· 158 158 * needed attribute extent. 159 159 */ 160 160 ntfs_attr_reinit_search_ctx(ctx); 161 - ctx_needs_reset = TRUE; 161 + ctx_needs_reset = true; 162 162 } 163 163 } 164 164 if (ctx_needs_reset) { ··· 336 336 * LCN_EIO Critical error (runlist/file is corrupt, i/o error, etc). 337 337 * 338 338 * Locking: - The runlist must be locked on entry and is left locked on return. 339 - * - If @write_locked is FALSE, i.e. the runlist is locked for reading, 339 + * - If @write_locked is 'false', i.e. the runlist is locked for reading, 340 340 * the lock may be dropped inside the function so you cannot rely on 341 341 * the runlist still being the same when this function returns. 342 342 */ 343 343 LCN ntfs_attr_vcn_to_lcn_nolock(ntfs_inode *ni, const VCN vcn, 344 - const BOOL write_locked) 344 + const bool write_locked) 345 345 { 346 346 LCN lcn; 347 347 unsigned long flags; 348 - BOOL is_retry = FALSE; 348 + bool is_retry = false; 349 349 350 350 ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, %s_locked.", 351 351 ni->mft_no, (unsigned long long)vcn, ··· 390 390 down_read(&ni->runlist.lock); 391 391 } 392 392 if (likely(!err)) { 393 - is_retry = TRUE; 393 + is_retry = true; 394 394 goto retry_remap; 395 395 } 396 396 if (err == -ENOENT) ··· 449 449 * -EIO - Critical error (runlist/file is corrupt, i/o error, etc). 450 450 * 451 451 * WARNING: If @ctx is supplied, regardless of whether success or failure is 452 - * returned, you need to check IS_ERR(@ctx->mrec) and if TRUE the @ctx 452 + * returned, you need to check IS_ERR(@ctx->mrec) and if 'true' the @ctx 453 453 * is no longer valid, i.e. you need to either call 454 454 * ntfs_attr_reinit_search_ctx() or ntfs_attr_put_search_ctx() on it. 455 455 * In that case PTR_ERR(@ctx->mrec) will give you the error code for ··· 469 469 unsigned long flags; 470 470 runlist_element *rl; 471 471 int err = 0; 472 - BOOL is_retry = FALSE; 472 + bool is_retry = false; 473 473 474 474 ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, with%s ctx.", 475 475 ni->mft_no, (unsigned long long)vcn, ctx ? "" : "out"); ··· 518 518 */ 519 519 err = ntfs_map_runlist_nolock(ni, vcn, ctx); 520 520 if (likely(!err)) { 521 - is_retry = TRUE; 521 + is_retry = true; 522 522 goto retry_remap; 523 523 } 524 524 } ··· 558 558 * On actual error, ntfs_attr_find() returns -EIO. In this case @ctx->attr is 559 559 * undefined and in particular do not rely on it not changing. 560 560 * 561 - * If @ctx->is_first is TRUE, the search begins with @ctx->attr itself. If it 562 - * is FALSE, the search begins after @ctx->attr. 561 + * If @ctx->is_first is 'true', the search begins with @ctx->attr itself. If it 562 + * is 'false', the search begins after @ctx->attr. 563 563 * 564 564 * If @ic is IGNORE_CASE, the @name comparisson is not case sensitive and 565 565 * @ctx->ntfs_ino must be set to the ntfs inode to which the mft record ··· 599 599 600 600 /* 601 601 * Iterate over attributes in mft record starting at @ctx->attr, or the 602 - * attribute following that, if @ctx->is_first is TRUE. 602 + * attribute following that, if @ctx->is_first is 'true'. 603 603 */ 604 604 if (ctx->is_first) { 605 605 a = ctx->attr; 606 - ctx->is_first = FALSE; 606 + ctx->is_first = false; 607 607 } else 608 608 a = (ATTR_RECORD*)((u8*)ctx->attr + 609 609 le32_to_cpu(ctx->attr->length)); ··· 890 890 ctx->al_entry = (ATTR_LIST_ENTRY*)al_start; 891 891 /* 892 892 * Iterate over entries in attribute list starting at @ctx->al_entry, 893 - * or the entry following that, if @ctx->is_first is TRUE. 893 + * or the entry following that, if @ctx->is_first is 'true'. 894 894 */ 895 895 if (ctx->is_first) { 896 896 al_entry = ctx->al_entry; 897 - ctx->is_first = FALSE; 897 + ctx->is_first = false; 898 898 } else 899 899 al_entry = (ATTR_LIST_ENTRY*)((u8*)ctx->al_entry + 900 900 le16_to_cpu(ctx->al_entry->length)); ··· 1127 1127 ctx->mrec = ctx->base_mrec; 1128 1128 ctx->attr = (ATTR_RECORD*)((u8*)ctx->mrec + 1129 1129 le16_to_cpu(ctx->mrec->attrs_offset)); 1130 - ctx->is_first = TRUE; 1130 + ctx->is_first = true; 1131 1131 ctx->ntfs_ino = base_ni; 1132 1132 ctx->base_ntfs_ino = NULL; 1133 1133 ctx->base_mrec = NULL; ··· 1224 1224 /* Sanity checks are performed elsewhere. */ 1225 1225 .attr = (ATTR_RECORD*)((u8*)mrec + 1226 1226 le16_to_cpu(mrec->attrs_offset)), 1227 - .is_first = TRUE, 1227 + .is_first = true, 1228 1228 .ntfs_ino = ni, 1229 1229 }; 1230 1230 } ··· 1243 1243 { 1244 1244 if (likely(!ctx->base_ntfs_ino)) { 1245 1245 /* No attribute list. */ 1246 - ctx->is_first = TRUE; 1246 + ctx->is_first = true; 1247 1247 /* Sanity checks are performed elsewhere. */ 1248 1248 ctx->attr = (ATTR_RECORD*)((u8*)ctx->mrec + 1249 1249 le16_to_cpu(ctx->mrec->attrs_offset)); ··· 1585 1585 return -ENOMEM; 1586 1586 /* Start by allocating clusters to hold the attribute value. */ 1587 1587 rl = ntfs_cluster_alloc(vol, 0, new_size >> 1588 - vol->cluster_size_bits, -1, DATA_ZONE, TRUE); 1588 + vol->cluster_size_bits, -1, DATA_ZONE, true); 1589 1589 if (IS_ERR(rl)) { 1590 1590 err = PTR_ERR(rl); 1591 1591 ntfs_debug("Failed to allocate cluster%s, error code " ··· 1919 1919 unsigned long flags; 1920 1920 int err, mp_size; 1921 1921 u32 attr_len = 0; /* Silence stupid gcc warning. */ 1922 - BOOL mp_rebuilt; 1922 + bool mp_rebuilt; 1923 1923 1924 1924 #ifdef NTFS_DEBUG 1925 1925 read_lock_irqsave(&ni->size_lock, flags); ··· 2222 2222 rl2 = ntfs_cluster_alloc(vol, allocated_size >> vol->cluster_size_bits, 2223 2223 (new_alloc_size - allocated_size) >> 2224 2224 vol->cluster_size_bits, (rl && (rl->lcn >= 0)) ? 2225 - rl->lcn + rl->length : -1, DATA_ZONE, TRUE); 2225 + rl->lcn + rl->length : -1, DATA_ZONE, true); 2226 2226 if (IS_ERR(rl2)) { 2227 2227 err = PTR_ERR(rl2); 2228 2228 if (start < 0 || start >= allocated_size) ··· 2265 2265 BUG_ON(!rl2); 2266 2266 BUG_ON(!rl2->length); 2267 2267 BUG_ON(rl2->lcn < LCN_HOLE); 2268 - mp_rebuilt = FALSE; 2268 + mp_rebuilt = false; 2269 2269 /* Get the size for the new mapping pairs array for this extent. */ 2270 2270 mp_size = ntfs_get_size_for_mapping_pairs(vol, rl2, ll, -1); 2271 2271 if (unlikely(mp_size <= 0)) { ··· 2300 2300 err = -EOPNOTSUPP; 2301 2301 goto undo_alloc; 2302 2302 } 2303 - mp_rebuilt = TRUE; 2303 + mp_rebuilt = true; 2304 2304 /* Generate the mapping pairs array directly into the attr record. */ 2305 2305 err = ntfs_mapping_pairs_build(vol, (u8*)a + 2306 2306 le16_to_cpu(a->data.non_resident.mapping_pairs_offset),
+4 -4
fs/ntfs/attrib.h
··· 40 40 * Structure must be initialized to zero before the first call to one of the 41 41 * attribute search functions. Initialize @mrec to point to the mft record to 42 42 * search, and @attr to point to the first attribute within @mrec (not necessary 43 - * if calling the _first() functions), and set @is_first to TRUE (not necessary 43 + * if calling the _first() functions), and set @is_first to 'true' (not necessary 44 44 * if calling the _first() functions). 45 45 * 46 - * If @is_first is TRUE, the search begins with @attr. If @is_first is FALSE, 46 + * If @is_first is 'true', the search begins with @attr. If @is_first is 'false', 47 47 * the search begins after @attr. This is so that, after the first call to one 48 48 * of the search attribute functions, we can call the function again, without 49 49 * any modification of the search context, to automagically get the next ··· 52 52 typedef struct { 53 53 MFT_RECORD *mrec; 54 54 ATTR_RECORD *attr; 55 - BOOL is_first; 55 + bool is_first; 56 56 ntfs_inode *ntfs_ino; 57 57 ATTR_LIST_ENTRY *al_entry; 58 58 ntfs_inode *base_ntfs_ino; ··· 65 65 extern int ntfs_map_runlist(ntfs_inode *ni, VCN vcn); 66 66 67 67 extern LCN ntfs_attr_vcn_to_lcn_nolock(ntfs_inode *ni, const VCN vcn, 68 - const BOOL write_locked); 68 + const bool write_locked); 69 69 70 70 extern runlist_element *ntfs_attr_find_vcn_nolock(ntfs_inode *ni, 71 71 const VCN vcn, ntfs_attr_search_ctx *ctx);
+4 -4
fs/ntfs/bitmap.c
··· 34 34 * @start_bit: first bit to set 35 35 * @count: number of bits to set 36 36 * @value: value to set the bits to (i.e. 0 or 1) 37 - * @is_rollback: if TRUE this is a rollback operation 37 + * @is_rollback: if 'true' this is a rollback operation 38 38 * 39 39 * Set @count bits starting at bit @start_bit in the bitmap described by the 40 40 * vfs inode @vi to @value, where @value is either 0 or 1. 41 41 * 42 - * @is_rollback should always be FALSE, it is for internal use to rollback 42 + * @is_rollback should always be 'false', it is for internal use to rollback 43 43 * errors. You probably want to use ntfs_bitmap_set_bits_in_run() instead. 44 44 * 45 45 * Return 0 on success and -errno on error. 46 46 */ 47 47 int __ntfs_bitmap_set_bits_in_run(struct inode *vi, const s64 start_bit, 48 - const s64 count, const u8 value, const BOOL is_rollback) 48 + const s64 count, const u8 value, const bool is_rollback) 49 49 { 50 50 s64 cnt = count; 51 51 pgoff_t index, end_index; ··· 172 172 return PTR_ERR(page); 173 173 if (count != cnt) 174 174 pos = __ntfs_bitmap_set_bits_in_run(vi, start_bit, count - cnt, 175 - value ? 0 : 1, TRUE); 175 + value ? 0 : 1, true); 176 176 else 177 177 pos = 0; 178 178 if (!pos) {
+2 -2
fs/ntfs/bitmap.h
··· 30 30 #include "types.h" 31 31 32 32 extern int __ntfs_bitmap_set_bits_in_run(struct inode *vi, const s64 start_bit, 33 - const s64 count, const u8 value, const BOOL is_rollback); 33 + const s64 count, const u8 value, const bool is_rollback); 34 34 35 35 /** 36 36 * ntfs_bitmap_set_bits_in_run - set a run of bits in a bitmap to a value ··· 48 48 const s64 start_bit, const s64 count, const u8 value) 49 49 { 50 50 return __ntfs_bitmap_set_bits_in_run(vi, start_bit, count, value, 51 - FALSE); 51 + false); 52 52 } 53 53 54 54 /**
+4 -4
fs/ntfs/collate.h
··· 26 26 #include "types.h" 27 27 #include "volume.h" 28 28 29 - static inline BOOL ntfs_is_collation_rule_supported(COLLATION_RULE cr) { 29 + static inline bool ntfs_is_collation_rule_supported(COLLATION_RULE cr) { 30 30 int i; 31 31 32 32 /* ··· 35 35 * now. 36 36 */ 37 37 if (unlikely(cr != COLLATION_BINARY && cr != COLLATION_NTOFS_ULONG)) 38 - return FALSE; 38 + return false; 39 39 i = le32_to_cpu(cr); 40 40 if (likely(((i >= 0) && (i <= 0x02)) || 41 41 ((i >= 0x10) && (i <= 0x13)))) 42 - return TRUE; 43 - return FALSE; 42 + return true; 43 + return false; 44 44 } 45 45 46 46 extern int ntfs_collate(ntfs_volume *vol, COLLATION_RULE cr,
+2 -2
fs/ntfs/compress.c
··· 600 600 rl = NULL; 601 601 for (vcn = start_vcn, start_vcn += cb_clusters; vcn < start_vcn; 602 602 vcn++) { 603 - BOOL is_retry = FALSE; 603 + bool is_retry = false; 604 604 605 605 if (!rl) { 606 606 lock_retry_remap: ··· 626 626 break; 627 627 if (is_retry || lcn != LCN_RL_NOT_MAPPED) 628 628 goto rl_err; 629 - is_retry = TRUE; 629 + is_retry = true; 630 630 /* 631 631 * Attempt to map runlist, dropping lock for the 632 632 * duration.
+17 -17
fs/ntfs/file.c
··· 509 509 u32 attr_rec_len = 0; 510 510 unsigned blocksize, u; 511 511 int err, mp_size; 512 - BOOL rl_write_locked, was_hole, is_retry; 512 + bool rl_write_locked, was_hole, is_retry; 513 513 unsigned char blocksize_bits; 514 514 struct { 515 515 u8 runlist_merged:1; ··· 543 543 return -ENOMEM; 544 544 } 545 545 } while (++u < nr_pages); 546 - rl_write_locked = FALSE; 546 + rl_write_locked = false; 547 547 rl = NULL; 548 548 err = 0; 549 549 vcn = lcn = -1; 550 550 vcn_len = 0; 551 551 lcn_block = -1; 552 - was_hole = FALSE; 552 + was_hole = false; 553 553 cpos = pos >> vol->cluster_size_bits; 554 554 end = pos + bytes; 555 555 cend = (end + vol->cluster_size - 1) >> vol->cluster_size_bits; ··· 760 760 } 761 761 continue; 762 762 } 763 - is_retry = FALSE; 763 + is_retry = false; 764 764 if (!rl) { 765 765 down_read(&ni->runlist.lock); 766 766 retry_remap: ··· 776 776 * Successful remap, setup the map cache and 777 777 * use that to deal with the buffer. 778 778 */ 779 - was_hole = FALSE; 779 + was_hole = false; 780 780 vcn = bh_cpos; 781 781 vcn_len = rl[1].vcn - vcn; 782 782 lcn_block = lcn << (vol->cluster_size_bits - ··· 792 792 if (likely(vcn + vcn_len >= cend)) { 793 793 if (rl_write_locked) { 794 794 up_write(&ni->runlist.lock); 795 - rl_write_locked = FALSE; 795 + rl_write_locked = false; 796 796 } else 797 797 up_read(&ni->runlist.lock); 798 798 rl = NULL; ··· 818 818 */ 819 819 up_read(&ni->runlist.lock); 820 820 down_write(&ni->runlist.lock); 821 - rl_write_locked = TRUE; 821 + rl_write_locked = true; 822 822 goto retry_remap; 823 823 } 824 824 err = ntfs_map_runlist_nolock(ni, bh_cpos, 825 825 NULL); 826 826 if (likely(!err)) { 827 - is_retry = TRUE; 827 + is_retry = true; 828 828 goto retry_remap; 829 829 } 830 830 /* ··· 903 903 if (!rl_write_locked) { 904 904 up_read(&ni->runlist.lock); 905 905 down_write(&ni->runlist.lock); 906 - rl_write_locked = TRUE; 906 + rl_write_locked = true; 907 907 goto retry_remap; 908 908 } 909 909 /* Find the previous last allocated cluster. */ ··· 917 917 } 918 918 } 919 919 rl2 = ntfs_cluster_alloc(vol, bh_cpos, 1, lcn, DATA_ZONE, 920 - FALSE); 920 + false); 921 921 if (IS_ERR(rl2)) { 922 922 err = PTR_ERR(rl2); 923 923 ntfs_debug("Failed to allocate cluster, error code %i.", ··· 1093 1093 status.mft_attr_mapped = 0; 1094 1094 status.mp_rebuilt = 0; 1095 1095 /* Setup the map cache and use that to deal with the buffer. */ 1096 - was_hole = TRUE; 1096 + was_hole = true; 1097 1097 vcn = bh_cpos; 1098 1098 vcn_len = 1; 1099 1099 lcn_block = lcn << (vol->cluster_size_bits - blocksize_bits); ··· 1105 1105 */ 1106 1106 if (likely(vcn + vcn_len >= cend)) { 1107 1107 up_write(&ni->runlist.lock); 1108 - rl_write_locked = FALSE; 1108 + rl_write_locked = false; 1109 1109 rl = NULL; 1110 1110 } 1111 1111 goto map_buffer_cached; ··· 1117 1117 if (likely(!err)) { 1118 1118 if (unlikely(rl_write_locked)) { 1119 1119 up_write(&ni->runlist.lock); 1120 - rl_write_locked = FALSE; 1120 + rl_write_locked = false; 1121 1121 } else if (unlikely(rl)) 1122 1122 up_read(&ni->runlist.lock); 1123 1123 rl = NULL; ··· 1528 1528 do { 1529 1529 s64 bh_pos; 1530 1530 struct page *page; 1531 - BOOL partial; 1531 + bool partial; 1532 1532 1533 1533 page = pages[u]; 1534 1534 bh_pos = (s64)page->index << PAGE_CACHE_SHIFT; 1535 1535 bh = head = page_buffers(page); 1536 - partial = FALSE; 1536 + partial = false; 1537 1537 do { 1538 1538 s64 bh_end; 1539 1539 1540 1540 bh_end = bh_pos + blocksize; 1541 1541 if (bh_end <= pos || bh_pos >= end) { 1542 1542 if (!buffer_uptodate(bh)) 1543 - partial = TRUE; 1543 + partial = true; 1544 1544 } else { 1545 1545 set_buffer_uptodate(bh); 1546 1546 mark_buffer_dirty(bh); ··· 1997 1997 */ 1998 1998 down_read(&ni->runlist.lock); 1999 1999 lcn = ntfs_attr_vcn_to_lcn_nolock(ni, pos >> 2000 - vol->cluster_size_bits, FALSE); 2000 + vol->cluster_size_bits, false); 2001 2001 up_read(&ni->runlist.lock); 2002 2002 if (unlikely(lcn < LCN_HOLE)) { 2003 2003 status = -EIO;
+2 -2
fs/ntfs/index.c
··· 204 204 if ((key_len == le16_to_cpu(ie->key_length)) && !memcmp(key, 205 205 &ie->key, key_len)) { 206 206 ir_done: 207 - ictx->is_in_root = TRUE; 207 + ictx->is_in_root = true; 208 208 ictx->ir = ir; 209 209 ictx->actx = actx; 210 210 ictx->base_ni = base_ni; ··· 374 374 if ((key_len == le16_to_cpu(ie->key_length)) && !memcmp(key, 375 375 &ie->key, key_len)) { 376 376 ia_done: 377 - ictx->is_in_root = FALSE; 377 + ictx->is_in_root = false; 378 378 ictx->actx = NULL; 379 379 ictx->base_ni = NULL; 380 380 ictx->ia = ia;
+6 -6
fs/ntfs/index.h
··· 37 37 * @entry: index entry (points into @ir or @ia) 38 38 * @data: index entry data (points into @entry) 39 39 * @data_len: length in bytes of @data 40 - * @is_in_root: TRUE if @entry is in @ir and FALSE if it is in @ia 40 + * @is_in_root: 'true' if @entry is in @ir and 'false' if it is in @ia 41 41 * @ir: index root if @is_in_root and NULL otherwise 42 42 * @actx: attribute search context if @is_in_root and NULL otherwise 43 43 * @base_ni: base inode if @is_in_root and NULL otherwise 44 - * @ia: index block if @is_in_root is FALSE and NULL otherwise 45 - * @page: page if @is_in_root is FALSE and NULL otherwise 44 + * @ia: index block if @is_in_root is 'false' and NULL otherwise 45 + * @page: page if @is_in_root is 'false' and NULL otherwise 46 46 * 47 47 * @idx_ni is the index inode this context belongs to. 48 48 * ··· 50 50 * are the index entry data and its length in bytes, respectively. @data 51 51 * simply points into @entry. This is probably what the user is interested in. 52 52 * 53 - * If @is_in_root is TRUE, @entry is in the index root attribute @ir described 53 + * If @is_in_root is 'true', @entry is in the index root attribute @ir described 54 54 * by the attribute search context @actx and the base inode @base_ni. @ia and 55 55 * @page are NULL in this case. 56 56 * 57 - * If @is_in_root is FALSE, @entry is in the index allocation attribute and @ia 57 + * If @is_in_root is 'false', @entry is in the index allocation attribute and @ia 58 58 * and @page point to the index allocation block and the mapped, locked page it 59 59 * is in, respectively. @ir, @actx and @base_ni are NULL in this case. 60 60 * ··· 77 77 INDEX_ENTRY *entry; 78 78 void *data; 79 79 u16 data_len; 80 - BOOL is_in_root; 80 + bool is_in_root; 81 81 INDEX_ROOT *ir; 82 82 ntfs_attr_search_ctx *actx; 83 83 ntfs_inode *base_ni;
+5 -5
fs/ntfs/inode.c
··· 2301 2301 } 2302 2302 #ifdef NTFS_RW 2303 2303 if (NInoDirty(ni)) { 2304 - BOOL was_bad = (is_bad_inode(vi)); 2304 + bool was_bad = (is_bad_inode(vi)); 2305 2305 2306 2306 /* Committing the inode also commits all extent inodes. */ 2307 2307 ntfs_commit_inode(vi); ··· 3015 3015 MFT_RECORD *m; 3016 3016 STANDARD_INFORMATION *si; 3017 3017 int err = 0; 3018 - BOOL modified = FALSE; 3018 + bool modified = false; 3019 3019 3020 3020 ntfs_debug("Entering for %sinode 0x%lx.", NInoAttr(ni) ? "attr " : "", 3021 3021 vi->i_ino); ··· 3057 3057 sle64_to_cpu(si->last_data_change_time), 3058 3058 (long long)sle64_to_cpu(nt)); 3059 3059 si->last_data_change_time = nt; 3060 - modified = TRUE; 3060 + modified = true; 3061 3061 } 3062 3062 nt = utc2ntfs(vi->i_ctime); 3063 3063 if (si->last_mft_change_time != nt) { ··· 3066 3066 sle64_to_cpu(si->last_mft_change_time), 3067 3067 (long long)sle64_to_cpu(nt)); 3068 3068 si->last_mft_change_time = nt; 3069 - modified = TRUE; 3069 + modified = true; 3070 3070 } 3071 3071 nt = utc2ntfs(vi->i_atime); 3072 3072 if (si->last_access_time != nt) { ··· 3075 3075 (long long)sle64_to_cpu(si->last_access_time), 3076 3076 (long long)sle64_to_cpu(nt)); 3077 3077 si->last_access_time = nt; 3078 - modified = TRUE; 3078 + modified = true; 3079 3079 } 3080 3080 /* 3081 3081 * If we just modified the standard information attribute we need to
+3 -3
fs/ntfs/layout.h
··· 142 142 * operator! (-8 143 143 */ 144 144 145 - static inline BOOL __ntfs_is_magic(le32 x, NTFS_RECORD_TYPE r) 145 + static inline bool __ntfs_is_magic(le32 x, NTFS_RECORD_TYPE r) 146 146 { 147 147 return (x == r); 148 148 } 149 149 #define ntfs_is_magic(x, m) __ntfs_is_magic(x, magic_##m) 150 150 151 - static inline BOOL __ntfs_is_magicp(le32 *p, NTFS_RECORD_TYPE r) 151 + static inline bool __ntfs_is_magicp(le32 *p, NTFS_RECORD_TYPE r) 152 152 { 153 153 return (*p == r); 154 154 } ··· 323 323 #define MREF_LE(x) ((unsigned long)(le64_to_cpu(x) & MFT_REF_MASK_CPU)) 324 324 #define MSEQNO_LE(x) ((u16)((le64_to_cpu(x) >> 48) & 0xffff)) 325 325 326 - #define IS_ERR_MREF(x) (((x) & 0x0000800000000000ULL) ? 1 : 0) 326 + #define IS_ERR_MREF(x) (((x) & 0x0000800000000000ULL) ? true : false) 327 327 #define ERR_MREF(x) ((u64)((s64)(x))) 328 328 #define MREF_ERR(x) ((int)((s64)(x))) 329 329
+10 -10
fs/ntfs/lcnalloc.c
··· 76 76 * @count: number of clusters to allocate 77 77 * @start_lcn: starting lcn at which to allocate the clusters (or -1 if none) 78 78 * @zone: zone from which to allocate the clusters 79 - * @is_extension: if TRUE, this is an attribute extension 79 + * @is_extension: if 'true', this is an attribute extension 80 80 * 81 81 * Allocate @count clusters preferably starting at cluster @start_lcn or at the 82 82 * current allocator position if @start_lcn is -1, on the mounted ntfs volume ··· 87 87 * @start_vcn specifies the vcn of the first allocated cluster. This makes 88 88 * merging the resulting runlist with the old runlist easier. 89 89 * 90 - * If @is_extension is TRUE, the caller is allocating clusters to extend an 91 - * attribute and if it is FALSE, the caller is allocating clusters to fill a 90 + * If @is_extension is 'true', the caller is allocating clusters to extend an 91 + * attribute and if it is 'false', the caller is allocating clusters to fill a 92 92 * hole in an attribute. Practically the difference is that if @is_extension 93 - * is TRUE the returned runlist will be terminated with LCN_ENOENT and if 94 - * @is_extension is FALSE the runlist will be terminated with 93 + * is 'true' the returned runlist will be terminated with LCN_ENOENT and if 94 + * @is_extension is 'false' the runlist will be terminated with 95 95 * LCN_RL_NOT_MAPPED. 96 96 * 97 97 * You need to check the return value with IS_ERR(). If this is false, the ··· 146 146 runlist_element *ntfs_cluster_alloc(ntfs_volume *vol, const VCN start_vcn, 147 147 const s64 count, const LCN start_lcn, 148 148 const NTFS_CLUSTER_ALLOCATION_ZONES zone, 149 - const BOOL is_extension) 149 + const bool is_extension) 150 150 { 151 151 LCN zone_start, zone_end, bmp_pos, bmp_initial_pos, last_read_pos, lcn; 152 152 LCN prev_lcn = 0, prev_run_len = 0, mft_zone_size; ··· 818 818 * Assuming you cache ctx->attr in a variable @a of type ATTR_RECORD * and that 819 819 * you cache ctx->mrec in a variable @m of type MFT_RECORD *. 820 820 * 821 - * @is_rollback should always be FALSE, it is for internal use to rollback 821 + * @is_rollback should always be 'false', it is for internal use to rollback 822 822 * errors. You probably want to use ntfs_cluster_free() instead. 823 823 * 824 824 * Note, __ntfs_cluster_free() does not modify the runlist, so you have to ··· 828 828 * success and -errno on error. 829 829 * 830 830 * WARNING: If @ctx is supplied, regardless of whether success or failure is 831 - * returned, you need to check IS_ERR(@ctx->mrec) and if TRUE the @ctx 831 + * returned, you need to check IS_ERR(@ctx->mrec) and if 'true' the @ctx 832 832 * is no longer valid, i.e. you need to either call 833 833 * ntfs_attr_reinit_search_ctx() or ntfs_attr_put_search_ctx() on it. 834 834 * In that case PTR_ERR(@ctx->mrec) will give you the error code for ··· 847 847 * and it will be left mapped on return. 848 848 */ 849 849 s64 __ntfs_cluster_free(ntfs_inode *ni, const VCN start_vcn, s64 count, 850 - ntfs_attr_search_ctx *ctx, const BOOL is_rollback) 850 + ntfs_attr_search_ctx *ctx, const bool is_rollback) 851 851 { 852 852 s64 delta, to_free, total_freed, real_freed; 853 853 ntfs_volume *vol; ··· 999 999 * If rollback fails, set the volume errors flag, emit an error 1000 1000 * message, and return the error code. 1001 1001 */ 1002 - delta = __ntfs_cluster_free(ni, start_vcn, total_freed, ctx, TRUE); 1002 + delta = __ntfs_cluster_free(ni, start_vcn, total_freed, ctx, true); 1003 1003 if (delta < 0) { 1004 1004 ntfs_error(vol->sb, "Failed to rollback (error %i). Leaving " 1005 1005 "inconsistent metadata! Unmount and run "
+4 -4
fs/ntfs/lcnalloc.h
··· 43 43 extern runlist_element *ntfs_cluster_alloc(ntfs_volume *vol, 44 44 const VCN start_vcn, const s64 count, const LCN start_lcn, 45 45 const NTFS_CLUSTER_ALLOCATION_ZONES zone, 46 - const BOOL is_extension); 46 + const bool is_extension); 47 47 48 48 extern s64 __ntfs_cluster_free(ntfs_inode *ni, const VCN start_vcn, 49 - s64 count, ntfs_attr_search_ctx *ctx, const BOOL is_rollback); 49 + s64 count, ntfs_attr_search_ctx *ctx, const bool is_rollback); 50 50 51 51 /** 52 52 * ntfs_cluster_free - free clusters on an ntfs volume ··· 86 86 * success and -errno on error. 87 87 * 88 88 * WARNING: If @ctx is supplied, regardless of whether success or failure is 89 - * returned, you need to check IS_ERR(@ctx->mrec) and if TRUE the @ctx 89 + * returned, you need to check IS_ERR(@ctx->mrec) and if 'true' the @ctx 90 90 * is no longer valid, i.e. you need to either call 91 91 * ntfs_attr_reinit_search_ctx() or ntfs_attr_put_search_ctx() on it. 92 92 * In that case PTR_ERR(@ctx->mrec) will give you the error code for ··· 107 107 static inline s64 ntfs_cluster_free(ntfs_inode *ni, const VCN start_vcn, 108 108 s64 count, ntfs_attr_search_ctx *ctx) 109 109 { 110 - return __ntfs_cluster_free(ni, start_vcn, count, ctx, FALSE); 110 + return __ntfs_cluster_free(ni, start_vcn, count, ctx, false); 111 111 } 112 112 113 113 extern int ntfs_cluster_free_from_rl_nolock(ntfs_volume *vol,
+54 -54
fs/ntfs/logfile.c
··· 41 41 * @rp: restart page header to check 42 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 45 - * consistent and FALSE otherwise. 44 + * Check the restart page header @rp for consistency and return 'true' if it is 45 + * consistent and 'false' otherwise. 46 46 * 47 47 * This function only needs NTFS_BLOCK_SIZE bytes in @rp, i.e. it does not 48 48 * require the full restart page. 49 49 */ 50 - static BOOL ntfs_check_restart_page_header(struct inode *vi, 50 + static bool ntfs_check_restart_page_header(struct inode *vi, 51 51 RESTART_PAGE_HEADER *rp, s64 pos) 52 52 { 53 53 u32 logfile_system_page_size, logfile_log_page_size; 54 54 u16 ra_ofs, usa_count, usa_ofs, usa_end = 0; 55 - BOOL have_usa = TRUE; 55 + bool have_usa = true; 56 56 57 57 ntfs_debug("Entering."); 58 58 /* ··· 67 67 (logfile_system_page_size - 1) || 68 68 logfile_log_page_size & (logfile_log_page_size - 1)) { 69 69 ntfs_error(vi->i_sb, "$LogFile uses unsupported page size."); 70 - return FALSE; 70 + return false; 71 71 } 72 72 /* 73 73 * We must be either at !pos (1st restart page) or at pos = system page ··· 76 76 if (pos && pos != logfile_system_page_size) { 77 77 ntfs_error(vi->i_sb, "Found restart area in incorrect " 78 78 "position in $LogFile."); 79 - return FALSE; 79 + return false; 80 80 } 81 81 /* We only know how to handle version 1.1. */ 82 82 if (sle16_to_cpu(rp->major_ver) != 1 || ··· 85 85 "supported. (This driver supports version " 86 86 "1.1 only.)", (int)sle16_to_cpu(rp->major_ver), 87 87 (int)sle16_to_cpu(rp->minor_ver)); 88 - return FALSE; 88 + return false; 89 89 } 90 90 /* 91 91 * If chkdsk has been run the restart page may not be protected by an 92 92 * update sequence array. 93 93 */ 94 94 if (ntfs_is_chkd_record(rp->magic) && !le16_to_cpu(rp->usa_count)) { 95 - have_usa = FALSE; 95 + have_usa = false; 96 96 goto skip_usa_checks; 97 97 } 98 98 /* Verify the size of the update sequence array. */ ··· 100 100 if (usa_count != le16_to_cpu(rp->usa_count)) { 101 101 ntfs_error(vi->i_sb, "$LogFile restart page specifies " 102 102 "inconsistent update sequence array count."); 103 - return FALSE; 103 + return false; 104 104 } 105 105 /* Verify the position of the update sequence array. */ 106 106 usa_ofs = le16_to_cpu(rp->usa_ofs); ··· 109 109 usa_end > NTFS_BLOCK_SIZE - sizeof(u16)) { 110 110 ntfs_error(vi->i_sb, "$LogFile restart page specifies " 111 111 "inconsistent update sequence array offset."); 112 - return FALSE; 112 + return false; 113 113 } 114 114 skip_usa_checks: 115 115 /* ··· 124 124 ra_ofs > logfile_system_page_size) { 125 125 ntfs_error(vi->i_sb, "$LogFile restart page specifies " 126 126 "inconsistent restart area offset."); 127 - return FALSE; 127 + return false; 128 128 } 129 129 /* 130 130 * Only restart pages modified by chkdsk are allowed to have chkdsk_lsn ··· 133 133 if (!ntfs_is_chkd_record(rp->magic) && sle64_to_cpu(rp->chkdsk_lsn)) { 134 134 ntfs_error(vi->i_sb, "$LogFile restart page is not modified " 135 135 "by chkdsk but a chkdsk LSN is specified."); 136 - return FALSE; 136 + return false; 137 137 } 138 138 ntfs_debug("Done."); 139 - return TRUE; 139 + return true; 140 140 } 141 141 142 142 /** ··· 145 145 * @rp: restart page whose restart area to check 146 146 * 147 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 150 * This function assumes that the restart page header has already been 151 151 * consistency checked. ··· 153 153 * This function only needs NTFS_BLOCK_SIZE bytes in @rp, i.e. it does not 154 154 * require the full restart page. 155 155 */ 156 - static BOOL ntfs_check_restart_area(struct inode *vi, RESTART_PAGE_HEADER *rp) 156 + static bool ntfs_check_restart_area(struct inode *vi, RESTART_PAGE_HEADER *rp) 157 157 { 158 158 u64 file_size; 159 159 RESTART_AREA *ra; ··· 172 172 NTFS_BLOCK_SIZE - sizeof(u16)) { 173 173 ntfs_error(vi->i_sb, "$LogFile restart area specifies " 174 174 "inconsistent file offset."); 175 - return FALSE; 175 + return false; 176 176 } 177 177 /* 178 178 * Now that we can access ra->client_array_offset, make sure everything ··· 186 186 ra_ofs + ca_ofs > NTFS_BLOCK_SIZE - sizeof(u16)) { 187 187 ntfs_error(vi->i_sb, "$LogFile restart area specifies " 188 188 "inconsistent client array offset."); 189 - return FALSE; 189 + return false; 190 190 } 191 191 /* 192 192 * The restart area must end within the system page size both when ··· 203 203 "of the system page size specified by the " 204 204 "restart page header and/or the specified " 205 205 "restart area length is inconsistent."); 206 - return FALSE; 206 + return false; 207 207 } 208 208 /* 209 209 * The ra->client_free_list and ra->client_in_use_list must be either ··· 218 218 le16_to_cpu(ra->log_clients))) { 219 219 ntfs_error(vi->i_sb, "$LogFile restart area specifies " 220 220 "overflowing client free and/or in use lists."); 221 - return FALSE; 221 + return false; 222 222 } 223 223 /* 224 224 * Check ra->seq_number_bits against ra->file_size for consistency. ··· 233 233 if (le32_to_cpu(ra->seq_number_bits) != 67 - fs_bits) { 234 234 ntfs_error(vi->i_sb, "$LogFile restart area specifies " 235 235 "inconsistent sequence number bits."); 236 - return FALSE; 236 + return false; 237 237 } 238 238 /* The log record header length must be a multiple of 8. */ 239 239 if (((le16_to_cpu(ra->log_record_header_length) + 7) & ~7) != 240 240 le16_to_cpu(ra->log_record_header_length)) { 241 241 ntfs_error(vi->i_sb, "$LogFile restart area specifies " 242 242 "inconsistent log record header length."); 243 - return FALSE; 243 + return false; 244 244 } 245 245 /* Dito for the log page data offset. */ 246 246 if (((le16_to_cpu(ra->log_page_data_offset) + 7) & ~7) != 247 247 le16_to_cpu(ra->log_page_data_offset)) { 248 248 ntfs_error(vi->i_sb, "$LogFile restart area specifies " 249 249 "inconsistent log page data offset."); 250 - return FALSE; 250 + return false; 251 251 } 252 252 ntfs_debug("Done."); 253 - return TRUE; 253 + return true; 254 254 } 255 255 256 256 /** ··· 259 259 * @rp: restart page whose log client array to check 260 260 * 261 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 264 * This function assumes that the restart page header and the restart area have 265 265 * already been consistency checked. ··· 268 268 * function needs @rp->system_page_size bytes in @rp, i.e. it requires the full 269 269 * restart page and the page must be multi sector transfer deprotected. 270 270 */ 271 - static BOOL ntfs_check_log_client_array(struct inode *vi, 271 + static bool ntfs_check_log_client_array(struct inode *vi, 272 272 RESTART_PAGE_HEADER *rp) 273 273 { 274 274 RESTART_AREA *ra; 275 275 LOG_CLIENT_RECORD *ca, *cr; 276 276 u16 nr_clients, idx; 277 - BOOL in_free_list, idx_is_first; 277 + bool in_free_list, idx_is_first; 278 278 279 279 ntfs_debug("Entering."); 280 280 ra = (RESTART_AREA*)((u8*)rp + le16_to_cpu(rp->restart_area_offset)); ··· 290 290 */ 291 291 nr_clients = le16_to_cpu(ra->log_clients); 292 292 idx = le16_to_cpu(ra->client_free_list); 293 - in_free_list = TRUE; 293 + in_free_list = true; 294 294 check_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 296 idx = le16_to_cpu(cr->next_client)) { 297 297 if (!nr_clients || idx >= le16_to_cpu(ra->log_clients)) 298 298 goto err_out; ··· 302 302 if (idx_is_first) { 303 303 if (cr->prev_client != LOGFILE_NO_CLIENT) 304 304 goto err_out; 305 - idx_is_first = FALSE; 305 + idx_is_first = false; 306 306 } 307 307 } 308 308 /* Switch to and check the in use list if we just did the free list. */ 309 309 if (in_free_list) { 310 - in_free_list = FALSE; 310 + in_free_list = false; 311 311 idx = le16_to_cpu(ra->client_in_use_list); 312 312 goto check_list; 313 313 } 314 314 ntfs_debug("Done."); 315 - return TRUE; 315 + return true; 316 316 err_out: 317 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 468 * @log_vi: struct inode of loaded journal $LogFile to check 469 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 472 - * consistent and FALSE if not. On success, the current restart page 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 473 473 * returned in *@rp. Caller must call ntfs_free(*@rp) when finished with it. 474 474 * 475 475 * At present we only check the two restart pages and ignore the log record ··· 480 480 * if the $LogFile was created on a system with a different page size to ours 481 481 * yet and mst deprotection would fail if our page size is smaller. 482 482 */ 483 - BOOL ntfs_check_logfile(struct inode *log_vi, RESTART_PAGE_HEADER **rp) 483 + bool ntfs_check_logfile(struct inode *log_vi, RESTART_PAGE_HEADER **rp) 484 484 { 485 485 s64 size, pos; 486 486 LSN rstr1_lsn, rstr2_lsn; ··· 491 491 RESTART_PAGE_HEADER *rstr1_ph = NULL; 492 492 RESTART_PAGE_HEADER *rstr2_ph = NULL; 493 493 int log_page_size, log_page_mask, err; 494 - BOOL logfile_is_empty = TRUE; 494 + bool logfile_is_empty = true; 495 495 u8 log_page_bits; 496 496 497 497 ntfs_debug("Entering."); ··· 527 527 if (size < log_page_size * 2 || (size - log_page_size * 2) >> 528 528 log_page_bits < MinLogRecordPages) { 529 529 ntfs_error(vol->sb, "$LogFile is too small."); 530 - return FALSE; 530 + return false; 531 531 } 532 532 /* 533 533 * Read through the file looking for a restart page. Since the restart ··· 556 556 * means we are done. 557 557 */ 558 558 if (!ntfs_is_empty_recordp((le32*)kaddr)) 559 - logfile_is_empty = FALSE; 559 + logfile_is_empty = false; 560 560 else if (!logfile_is_empty) 561 561 break; 562 562 /* ··· 615 615 NVolSetLogFileEmpty(vol); 616 616 is_empty: 617 617 ntfs_debug("Done. ($LogFile is empty.)"); 618 - return TRUE; 618 + return true; 619 619 } 620 620 if (!rstr1_ph) { 621 621 BUG_ON(rstr2_ph); 622 622 ntfs_error(vol->sb, "Did not find any restart pages in " 623 623 "$LogFile and it was not empty."); 624 - return FALSE; 624 + return false; 625 625 } 626 626 /* If both restart pages were found, use the more recent one. */ 627 627 if (rstr2_ph) { ··· 648 648 else 649 649 ntfs_free(rstr1_ph); 650 650 ntfs_debug("Done."); 651 - return TRUE; 651 + return true; 652 652 err_out: 653 653 if (rstr1_ph) 654 654 ntfs_free(rstr1_ph); 655 - return FALSE; 655 + return false; 656 656 } 657 657 658 658 /** ··· 660 660 * @log_vi: struct inode of loaded journal $LogFile to check 661 661 * @rp: copy of the current restart page 662 662 * 663 - * Analyze the $LogFile journal and return TRUE if it indicates the volume was 664 - * shutdown cleanly and FALSE if not. 663 + * Analyze the $LogFile journal and return 'true' if it indicates the volume was 664 + * shutdown cleanly and 'false' if not. 665 665 * 666 666 * At present we only look at the two restart pages and ignore the log record 667 667 * pages. This is a little bit crude in that there will be a very small number ··· 675 675 * is empty this function requires that NVolLogFileEmpty() is true otherwise an 676 676 * empty volume will be reported as dirty. 677 677 */ 678 - BOOL ntfs_is_logfile_clean(struct inode *log_vi, const RESTART_PAGE_HEADER *rp) 678 + bool ntfs_is_logfile_clean(struct inode *log_vi, const RESTART_PAGE_HEADER *rp) 679 679 { 680 680 ntfs_volume *vol = NTFS_SB(log_vi->i_sb); 681 681 RESTART_AREA *ra; ··· 684 684 /* An empty $LogFile must have been clean before it got emptied. */ 685 685 if (NVolLogFileEmpty(vol)) { 686 686 ntfs_debug("Done. ($LogFile is empty.)"); 687 - return TRUE; 687 + return true; 688 688 } 689 689 BUG_ON(!rp); 690 690 if (!ntfs_is_rstr_record(rp->magic) && ··· 693 693 "probably a bug in that the $LogFile should " 694 694 "have been consistency checked before calling " 695 695 "this function."); 696 - return FALSE; 696 + return false; 697 697 } 698 698 ra = (RESTART_AREA*)((u8*)rp + le16_to_cpu(rp->restart_area_offset)); 699 699 /* ··· 704 704 if (ra->client_in_use_list != LOGFILE_NO_CLIENT && 705 705 !(ra->flags & RESTART_VOLUME_IS_CLEAN)) { 706 706 ntfs_debug("Done. $LogFile indicates a dirty shutdown."); 707 - return FALSE; 707 + return false; 708 708 } 709 709 /* $LogFile indicates a clean shutdown. */ 710 710 ntfs_debug("Done. $LogFile indicates a clean shutdown."); 711 - return TRUE; 711 + return true; 712 712 } 713 713 714 714 /** 715 715 * ntfs_empty_logfile - empty the contents of the $LogFile journal 716 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 719 - * success and FALSE on error. 718 + * Empty the contents of the $LogFile journal @log_vi and return 'true' on 719 + * success and 'false' on error. 720 720 * 721 721 * This function assumes that the $LogFile journal has already been consistency 722 722 * checked by a call to ntfs_check_logfile() and that ntfs_is_logfile_clean() 723 723 * has been used to ensure that the $LogFile is clean. 724 724 */ 725 - BOOL ntfs_empty_logfile(struct inode *log_vi) 725 + bool ntfs_empty_logfile(struct inode *log_vi) 726 726 { 727 727 ntfs_volume *vol = NTFS_SB(log_vi->i_sb); 728 728 ··· 735 735 if (unlikely(err)) { 736 736 ntfs_error(vol->sb, "Failed to fill $LogFile with " 737 737 "0xff bytes (error code %i).", err); 738 - return FALSE; 738 + return false; 739 739 } 740 740 /* Set the flag so we do not have to do it again on remount. */ 741 741 NVolSetLogFileEmpty(vol); 742 742 } 743 743 ntfs_debug("Done."); 744 - return TRUE; 744 + return true; 745 745 } 746 746 747 747 #endif /* NTFS_RW */
+3 -3
fs/ntfs/logfile.h
··· 296 296 /* sizeof() = 160 (0xa0) bytes */ 297 297 } __attribute__ ((__packed__)) LOG_CLIENT_RECORD; 298 298 299 - extern BOOL ntfs_check_logfile(struct inode *log_vi, 299 + extern bool ntfs_check_logfile(struct inode *log_vi, 300 300 RESTART_PAGE_HEADER **rp); 301 301 302 - extern BOOL ntfs_is_logfile_clean(struct inode *log_vi, 302 + extern bool ntfs_is_logfile_clean(struct inode *log_vi, 303 303 const RESTART_PAGE_HEADER *rp); 304 304 305 - extern BOOL ntfs_empty_logfile(struct inode *log_vi); 305 + extern bool ntfs_empty_logfile(struct inode *log_vi); 306 306 307 307 #endif /* NTFS_RW */ 308 308
+29 -29
fs/ntfs/mft.c
··· 251 251 int i; 252 252 unsigned long mft_no = MREF(mref); 253 253 u16 seq_no = MSEQNO(mref); 254 - BOOL destroy_ni = FALSE; 254 + bool destroy_ni = false; 255 255 256 256 ntfs_debug("Mapping extent mft record 0x%lx (base mft record 0x%lx).", 257 257 mft_no, base_ni->mft_no); ··· 322 322 if (seq_no && (le16_to_cpu(m->sequence_number) != seq_no)) { 323 323 ntfs_error(base_ni->vol->sb, "Found stale extent mft " 324 324 "reference! Corrupt filesystem. Run chkdsk."); 325 - destroy_ni = TRUE; 325 + destroy_ni = true; 326 326 m = ERR_PTR(-EIO); 327 327 goto unm_err_out; 328 328 } ··· 335 335 if (unlikely(!tmp)) { 336 336 ntfs_error(base_ni->vol->sb, "Failed to allocate " 337 337 "internal buffer."); 338 - destroy_ni = TRUE; 338 + destroy_ni = true; 339 339 m = ERR_PTR(-ENOMEM); 340 340 goto unm_err_out; 341 341 } ··· 857 857 * caller is responsible for unlocking the ntfs inode and unpinning the base 858 858 * vfs inode. 859 859 * 860 - * Return TRUE if the mft record may be written out and FALSE if not. 860 + * Return 'true' if the mft record may be written out and 'false' if not. 861 861 * 862 862 * The caller has locked the page and cleared the uptodate flag on it which 863 863 * means that we can safely write out any dirty mft records that do not have ··· 868 868 * Here is a description of the tests we perform: 869 869 * 870 870 * If the inode is found in icache we know the mft record must be a base mft 871 - * record. If it is dirty, we do not write it and return FALSE as the vfs 871 + * record. If it is dirty, we do not write it and return 'false' as the vfs 872 872 * inode write paths will result in the access times being updated which would 873 873 * cause the base mft record to be redirtied and written out again. (We know 874 874 * the access time update will modify the base mft record because Windows ··· 877 877 * 878 878 * If the inode is in icache and not dirty, we attempt to lock the mft record 879 879 * and if we find the lock was already taken, it is not safe to write the mft 880 - * record and we return FALSE. 880 + * record and we return 'false'. 881 881 * 882 882 * If we manage to obtain the lock we have exclusive access to the mft record, 883 883 * which also allows us safe writeout of the mft record. We then set 884 - * @locked_ni to the locked ntfs inode and return TRUE. 884 + * @locked_ni to the locked ntfs inode and return 'true'. 885 885 * 886 886 * Note we cannot just lock the mft record and sleep while waiting for the lock 887 887 * because this would deadlock due to lock reversal (normally the mft record is ··· 891 891 * If the inode is not in icache we need to perform further checks. 892 892 * 893 893 * If the mft record is not a FILE record or it is a base mft record, we can 894 - * safely write it and return TRUE. 894 + * safely write it and return 'true'. 895 895 * 896 896 * We now know the mft record is an extent mft record. We check if the inode 897 897 * corresponding to its base mft record is in icache and obtain a reference to 898 - * it if it is. If it is not, we can safely write it and return TRUE. 898 + * it if it is. If it is not, we can safely write it and return 'true'. 899 899 * 900 900 * We now have the base inode for the extent mft record. We check if it has an 901 901 * ntfs inode for the extent mft record attached and if not it is safe to write 902 - * the extent mft record and we return TRUE. 902 + * the extent mft record and we return 'true'. 903 903 * 904 904 * The ntfs inode for the extent mft record is attached to the base inode so we 905 905 * attempt to lock the extent mft record and if we find the lock was already 906 - * taken, it is not safe to write the extent mft record and we return FALSE. 906 + * taken, it is not safe to write the extent mft record and we return 'false'. 907 907 * 908 908 * If we manage to obtain the lock we have exclusive access to the extent mft 909 909 * record, which also allows us safe writeout of the extent mft record. We 910 910 * set the ntfs inode of the extent mft record clean and then set @locked_ni to 911 - * the now locked ntfs inode and return TRUE. 911 + * the now locked ntfs inode and return 'true'. 912 912 * 913 913 * Note, the reason for actually writing dirty mft records here and not just 914 914 * relying on the vfs inode dirty code paths is that we can have mft records ··· 922 922 * appear if the mft record is reused for a new inode before it got written 923 923 * out. 924 924 */ 925 - BOOL ntfs_may_write_mft_record(ntfs_volume *vol, const unsigned long mft_no, 925 + bool ntfs_may_write_mft_record(ntfs_volume *vol, const unsigned long mft_no, 926 926 const MFT_RECORD *m, ntfs_inode **locked_ni) 927 927 { 928 928 struct super_block *sb = vol->sb; ··· 977 977 mft_no); 978 978 atomic_dec(&ni->count); 979 979 iput(vi); 980 - return FALSE; 980 + return false; 981 981 } 982 982 ntfs_debug("Inode 0x%lx is not dirty.", mft_no); 983 983 /* The inode is not dirty, try to take the mft record lock. */ ··· 986 986 "not write it.", mft_no); 987 987 atomic_dec(&ni->count); 988 988 iput(vi); 989 - return FALSE; 989 + return false; 990 990 } 991 991 ntfs_debug("Managed to lock mft record 0x%lx, write it.", 992 992 mft_no); ··· 995 995 * return the locked ntfs inode. 996 996 */ 997 997 *locked_ni = ni; 998 - return TRUE; 998 + return true; 999 999 } 1000 1000 ntfs_debug("Inode 0x%lx is not in icache.", mft_no); 1001 1001 /* The inode is not in icache. */ ··· 1003 1003 if (!ntfs_is_mft_record(m->magic)) { 1004 1004 ntfs_debug("Mft record 0x%lx is not a FILE record, write it.", 1005 1005 mft_no); 1006 - return TRUE; 1006 + return true; 1007 1007 } 1008 1008 /* Write the mft record if it is a base inode. */ 1009 1009 if (!m->base_mft_record) { 1010 1010 ntfs_debug("Mft record 0x%lx is a base record, write it.", 1011 1011 mft_no); 1012 - return TRUE; 1012 + return true; 1013 1013 } 1014 1014 /* 1015 1015 * This is an extent mft record. Check if the inode corresponding to ··· 1033 1033 */ 1034 1034 ntfs_debug("Base inode 0x%lx is not in icache, write the " 1035 1035 "extent record.", na.mft_no); 1036 - return TRUE; 1036 + return true; 1037 1037 } 1038 1038 ntfs_debug("Base inode 0x%lx is in icache.", na.mft_no); 1039 1039 /* ··· 1051 1051 iput(vi); 1052 1052 ntfs_debug("Base inode 0x%lx has no attached extent inodes, " 1053 1053 "write the extent record.", na.mft_no); 1054 - return TRUE; 1054 + return true; 1055 1055 } 1056 1056 /* Iterate over the attached extent inodes. */ 1057 1057 extent_nis = ni->ext.extent_ntfs_inos; ··· 1075 1075 ntfs_debug("Extent inode 0x%lx is not attached to its base " 1076 1076 "inode 0x%lx, write the extent record.", 1077 1077 mft_no, na.mft_no); 1078 - return TRUE; 1078 + return true; 1079 1079 } 1080 1080 ntfs_debug("Extent inode 0x%lx is attached to its base inode 0x%lx.", 1081 1081 mft_no, na.mft_no); ··· 1091 1091 iput(vi); 1092 1092 ntfs_debug("Extent mft record 0x%lx is already locked, do " 1093 1093 "not write it.", mft_no); 1094 - return FALSE; 1094 + return false; 1095 1095 } 1096 1096 ntfs_debug("Managed to lock extent mft record 0x%lx, write it.", 1097 1097 mft_no); ··· 1103 1103 * the locked extent ntfs inode. 1104 1104 */ 1105 1105 *locked_ni = eni; 1106 - return TRUE; 1106 + return true; 1107 1107 } 1108 1108 1109 1109 static const char *es = " Leaving inconsistent metadata. Unmount and run " ··· 1354 1354 ntfs_unmap_page(page); 1355 1355 /* Allocate a cluster from the DATA_ZONE. */ 1356 1356 rl2 = ntfs_cluster_alloc(vol, rl[1].vcn, 1, lcn, DATA_ZONE, 1357 - TRUE); 1357 + true); 1358 1358 if (IS_ERR(rl2)) { 1359 1359 up_write(&mftbmp_ni->runlist.lock); 1360 1360 ntfs_error(vol->sb, "Failed to allocate a cluster for " ··· 1724 1724 ATTR_RECORD *a = NULL; 1725 1725 int ret, mp_size; 1726 1726 u32 old_alen = 0; 1727 - BOOL mp_rebuilt = FALSE; 1727 + bool mp_rebuilt = false; 1728 1728 1729 1729 ntfs_debug("Extending mft data allocation."); 1730 1730 mft_ni = NTFS_I(vol->mft_ino); ··· 1780 1780 old_last_vcn = rl[1].vcn; 1781 1781 do { 1782 1782 rl2 = ntfs_cluster_alloc(vol, old_last_vcn, nr, lcn, MFT_ZONE, 1783 - TRUE); 1783 + true); 1784 1784 if (likely(!IS_ERR(rl2))) 1785 1785 break; 1786 1786 if (PTR_ERR(rl2) != -ENOSPC || nr == min_nr) { ··· 1884 1884 ret = -EOPNOTSUPP; 1885 1885 goto undo_alloc; 1886 1886 } 1887 - mp_rebuilt = TRUE; 1887 + mp_rebuilt = true; 1888 1888 /* Generate the mapping pairs array directly into the attr record. */ 1889 1889 ret = ntfs_mapping_pairs_build(vol, (u8*)a + 1890 1890 le16_to_cpu(a->data.non_resident.mapping_pairs_offset), ··· 2255 2255 unsigned int ofs; 2256 2256 int err; 2257 2257 le16 seq_no, usn; 2258 - BOOL record_formatted = FALSE; 2258 + bool record_formatted = false; 2259 2259 2260 2260 if (base_ni) { 2261 2261 ntfs_debug("Entering (allocating an extent mft record for " ··· 2454 2454 mft_ni->initialized_size = new_initialized_size; 2455 2455 } 2456 2456 write_unlock_irqrestore(&mft_ni->size_lock, flags); 2457 - record_formatted = TRUE; 2457 + record_formatted = true; 2458 2458 /* Update the mft data attribute record to reflect the new sizes. */ 2459 2459 m = map_mft_record(mft_ni); 2460 2460 if (IS_ERR(m)) {
+1 -1
fs/ntfs/mft.h
··· 111 111 return err; 112 112 } 113 113 114 - extern BOOL ntfs_may_write_mft_record(ntfs_volume *vol, 114 + extern bool ntfs_may_write_mft_record(ntfs_volume *vol, 115 115 const unsigned long mft_no, const MFT_RECORD *m, 116 116 ntfs_inode **locked_ni); 117 117
+1 -1
fs/ntfs/ntfs.h
··· 105 105 extern void post_write_mst_fixup(NTFS_RECORD *b); 106 106 107 107 /* From fs/ntfs/unistr.c */ 108 - extern BOOL ntfs_are_names_equal(const ntfschar *s1, size_t s1_len, 108 + extern bool ntfs_are_names_equal(const ntfschar *s1, size_t s1_len, 109 109 const ntfschar *s2, size_t s2_len, 110 110 const IGNORE_CASE_BOOL ic, 111 111 const ntfschar *upcase, const u32 upcase_size);
+6 -6
fs/ntfs/quota.c
··· 31 31 * ntfs_mark_quotas_out_of_date - mark the quotas out of date on an ntfs volume 32 32 * @vol: ntfs volume on which to mark the quotas out of date 33 33 * 34 - * Mark the quotas out of date on the ntfs volume @vol and return TRUE on 35 - * success and FALSE on error. 34 + * Mark the quotas out of date on the ntfs volume @vol and return 'true' on 35 + * success and 'false' on error. 36 36 */ 37 - BOOL ntfs_mark_quotas_out_of_date(ntfs_volume *vol) 37 + bool ntfs_mark_quotas_out_of_date(ntfs_volume *vol) 38 38 { 39 39 ntfs_index_context *ictx; 40 40 QUOTA_CONTROL_ENTRY *qce; ··· 46 46 goto done; 47 47 if (!vol->quota_ino || !vol->quota_q_ino) { 48 48 ntfs_error(vol->sb, "Quota inodes are not open."); 49 - return FALSE; 49 + return false; 50 50 } 51 51 mutex_lock(&vol->quota_q_ino->i_mutex); 52 52 ictx = ntfs_index_ctx_get(NTFS_I(vol->quota_q_ino)); ··· 106 106 NVolSetQuotaOutOfDate(vol); 107 107 done: 108 108 ntfs_debug("Done."); 109 - return TRUE; 109 + return true; 110 110 err_out: 111 111 if (ictx) 112 112 ntfs_index_ctx_put(ictx); 113 113 mutex_unlock(&vol->quota_q_ino->i_mutex); 114 - return FALSE; 114 + return false; 115 115 } 116 116 117 117 #endif /* NTFS_RW */
+1 -1
fs/ntfs/quota.h
··· 28 28 #include "types.h" 29 29 #include "volume.h" 30 30 31 - extern BOOL ntfs_mark_quotas_out_of_date(ntfs_volume *vol); 31 + extern bool ntfs_mark_quotas_out_of_date(ntfs_volume *vol); 32 32 33 33 #endif /* NTFS_RW */ 34 34
+27 -27
fs/ntfs/runlist.c
··· 149 149 * 150 150 * It is up to the caller to serialize access to the runlists @dst and @src. 151 151 * 152 - * Return: TRUE Success, the runlists can be merged. 153 - * FALSE Failure, the runlists cannot be merged. 152 + * Return: true Success, the runlists can be merged. 153 + * false Failure, the runlists cannot be merged. 154 154 */ 155 - static inline BOOL ntfs_are_rl_mergeable(runlist_element *dst, 155 + static inline bool ntfs_are_rl_mergeable(runlist_element *dst, 156 156 runlist_element *src) 157 157 { 158 158 BUG_ON(!dst); ··· 160 160 161 161 /* We can merge unmapped regions even if they are misaligned. */ 162 162 if ((dst->lcn == LCN_RL_NOT_MAPPED) && (src->lcn == LCN_RL_NOT_MAPPED)) 163 - return TRUE; 163 + return true; 164 164 /* If the runs are misaligned, we cannot merge them. */ 165 165 if ((dst->vcn + dst->length) != src->vcn) 166 - return FALSE; 166 + return false; 167 167 /* If both runs are non-sparse and contiguous, we can merge them. */ 168 168 if ((dst->lcn >= 0) && (src->lcn >= 0) && 169 169 ((dst->lcn + dst->length) == src->lcn)) 170 - return TRUE; 170 + return true; 171 171 /* If we are merging two holes, we can merge them. */ 172 172 if ((dst->lcn == LCN_HOLE) && (src->lcn == LCN_HOLE)) 173 - return TRUE; 173 + return true; 174 174 /* Cannot merge. */ 175 - return FALSE; 175 + return false; 176 176 } 177 177 178 178 /** ··· 218 218 static inline runlist_element *ntfs_rl_append(runlist_element *dst, 219 219 int dsize, runlist_element *src, int ssize, int loc) 220 220 { 221 - BOOL right = FALSE; /* Right end of @src needs merging. */ 221 + bool right = false; /* Right end of @src needs merging. */ 222 222 int marker; /* End of the inserted runs. */ 223 223 224 224 BUG_ON(!dst); ··· 285 285 static inline runlist_element *ntfs_rl_insert(runlist_element *dst, 286 286 int dsize, runlist_element *src, int ssize, int loc) 287 287 { 288 - BOOL left = FALSE; /* Left end of @src needs merging. */ 289 - BOOL disc = FALSE; /* Discontinuity between @dst and @src. */ 288 + bool left = false; /* Left end of @src needs merging. */ 289 + bool disc = false; /* Discontinuity between @dst and @src. */ 290 290 int marker; /* End of the inserted runs. */ 291 291 292 292 BUG_ON(!dst); ··· 382 382 int dsize, runlist_element *src, int ssize, int loc) 383 383 { 384 384 signed delta; 385 - BOOL left = FALSE; /* Left end of @src needs merging. */ 386 - BOOL right = FALSE; /* Right end of @src needs merging. */ 385 + bool left = false; /* Left end of @src needs merging. */ 386 + bool right = false; /* Right end of @src needs merging. */ 387 387 int tail; /* Start of tail of @dst. */ 388 388 int marker; /* End of the inserted runs. */ 389 389 ··· 620 620 ; 621 621 622 622 { 623 - BOOL start; 624 - BOOL finish; 623 + bool start; 624 + bool finish; 625 625 int ds = dend + 1; /* Number of elements in drl & srl */ 626 626 int ss = sfinal - sstart + 1; 627 627 ··· 635 635 if (finish && !drl[dins].length) 636 636 ss++; 637 637 if (marker && (drl[dins].vcn + drl[dins].length > srl[send - 1].vcn)) 638 - finish = FALSE; 638 + finish = false; 639 639 #if 0 640 640 ntfs_debug("dfinal = %i, dend = %i", dfinal, dend); 641 641 ntfs_debug("sstart = %i, sfinal = %i, send = %i", sstart, sfinal, send); ··· 1134 1134 { 1135 1135 LCN prev_lcn; 1136 1136 int rls; 1137 - BOOL the_end = FALSE; 1137 + bool the_end = false; 1138 1138 1139 1139 BUG_ON(first_vcn < 0); 1140 1140 BUG_ON(last_vcn < -1); ··· 1168 1168 s64 s1 = last_vcn + 1; 1169 1169 if (unlikely(rl[1].vcn > s1)) 1170 1170 length = s1 - rl->vcn; 1171 - the_end = TRUE; 1171 + the_end = true; 1172 1172 } 1173 1173 delta = first_vcn - rl->vcn; 1174 1174 /* Header byte + length. */ ··· 1204 1204 s64 s1 = last_vcn + 1; 1205 1205 if (unlikely(rl[1].vcn > s1)) 1206 1206 length = s1 - rl->vcn; 1207 - the_end = TRUE; 1207 + the_end = true; 1208 1208 } 1209 1209 /* Header byte + length. */ 1210 1210 rls += 1 + ntfs_get_nr_significant_bytes(length); ··· 1327 1327 LCN prev_lcn; 1328 1328 s8 *dst_max, *dst_next; 1329 1329 int err = -ENOSPC; 1330 - BOOL the_end = FALSE; 1330 + bool the_end = false; 1331 1331 s8 len_len, lcn_len; 1332 1332 1333 1333 BUG_ON(first_vcn < 0); ··· 1370 1370 s64 s1 = last_vcn + 1; 1371 1371 if (unlikely(rl[1].vcn > s1)) 1372 1372 length = s1 - rl->vcn; 1373 - the_end = TRUE; 1373 + the_end = true; 1374 1374 } 1375 1375 delta = first_vcn - rl->vcn; 1376 1376 /* Write length. */ ··· 1422 1422 s64 s1 = last_vcn + 1; 1423 1423 if (unlikely(rl[1].vcn > s1)) 1424 1424 length = s1 - rl->vcn; 1425 - the_end = TRUE; 1425 + the_end = true; 1426 1426 } 1427 1427 /* Write length. */ 1428 1428 len_len = ntfs_write_significant_bytes(dst + 1, dst_max, ··· 1541 1541 */ 1542 1542 if (rl->length) { 1543 1543 runlist_element *trl; 1544 - BOOL is_end; 1544 + bool is_end; 1545 1545 1546 1546 ntfs_debug("Shrinking runlist."); 1547 1547 /* Determine the runlist size. */ ··· 1555 1555 * If a run was partially truncated, make the following runlist 1556 1556 * element a terminator. 1557 1557 */ 1558 - is_end = FALSE; 1558 + is_end = false; 1559 1559 if (rl->length) { 1560 1560 rl++; 1561 1561 if (!rl->length) 1562 - is_end = TRUE; 1562 + is_end = true; 1563 1563 rl->vcn = new_length; 1564 1564 rl->length = 0; 1565 1565 } ··· 1648 1648 s64 delta; 1649 1649 runlist_element *rl, *rl_end, *rl_real_end, *trl; 1650 1650 int old_size; 1651 - BOOL lcn_fixup = FALSE; 1651 + bool lcn_fixup = false; 1652 1652 1653 1653 ntfs_debug("Entering for start 0x%llx, length 0x%llx.", 1654 1654 (long long)start, (long long)length); ··· 1862 1862 if (rl->lcn >= 0) { 1863 1863 rl->lcn -= delta; 1864 1864 /* Need this in case the lcn just became negative. */ 1865 - lcn_fixup = TRUE; 1865 + lcn_fixup = true; 1866 1866 } 1867 1867 rl->length += delta; 1868 1868 goto split_end;
+89 -89
fs/ntfs/super.c
··· 74 74 * 75 75 * Copied from old ntfs driver (which copied from vfat driver). 76 76 */ 77 - static int simple_getbool(char *s, BOOL *setval) 77 + static int simple_getbool(char *s, bool *setval) 78 78 { 79 79 if (s) { 80 80 if (!strcmp(s, "1") || !strcmp(s, "yes") || !strcmp(s, "true")) 81 - *setval = TRUE; 81 + *setval = true; 82 82 else if (!strcmp(s, "0") || !strcmp(s, "no") || 83 83 !strcmp(s, "false")) 84 - *setval = FALSE; 84 + *setval = false; 85 85 else 86 86 return 0; 87 87 } else 88 - *setval = TRUE; 88 + *setval = true; 89 89 return 1; 90 90 } 91 91 ··· 96 96 * 97 97 * Parse the recognized options in @opt for the ntfs volume described by @vol. 98 98 */ 99 - static BOOL parse_options(ntfs_volume *vol, char *opt) 99 + static bool parse_options(ntfs_volume *vol, char *opt) 100 100 { 101 101 char *p, *v, *ov; 102 102 static char *utf8 = "utf8"; ··· 137 137 } 138 138 #define NTFS_GETOPT_BOOL(option, variable) \ 139 139 if (!strcmp(p, option)) { \ 140 - BOOL val; \ 140 + bool val; \ 141 141 if (!simple_getbool(v, &val)) \ 142 142 goto needs_bool; \ 143 143 variable = val; \ ··· 170 170 else NTFS_GETOPT_OCTAL("fmask", fmask) 171 171 else NTFS_GETOPT_OCTAL("dmask", dmask) 172 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 174 else NTFS_GETOPT_BOOL("show_sys_files", show_sys_files) 175 175 else NTFS_GETOPT_BOOL("case_sensitive", case_sensitive) 176 176 else NTFS_GETOPT_BOOL("disable_sparse", disable_sparse) ··· 194 194 if (!old_nls) { 195 195 ntfs_error(vol->sb, "NLS character set " 196 196 "%s not found.", v); 197 - return FALSE; 197 + return false; 198 198 } 199 199 ntfs_error(vol->sb, "NLS character set %s not " 200 200 "found. Using previous one %s.", ··· 205 205 unload_nls(old_nls); 206 206 } 207 207 } else if (!strcmp(p, "utf8")) { 208 - BOOL val = FALSE; 208 + bool val = false; 209 209 ntfs_warning(vol->sb, "Option utf8 is no longer " 210 210 "supported, using option nls=utf8. Please " 211 211 "use option nls=utf8 in the future and " 212 212 "make sure utf8 is compiled either as a " 213 213 "module or into the kernel."); 214 214 if (!v || !*v) 215 - val = TRUE; 215 + val = true; 216 216 else if (!simple_getbool(v, &val)) 217 217 goto needs_bool; 218 218 if (val) { ··· 231 231 } 232 232 no_mount_options: 233 233 if (errors && !sloppy) 234 - return FALSE; 234 + return false; 235 235 if (sloppy) 236 236 ntfs_warning(vol->sb, "Sloppy option given. Ignoring " 237 237 "unrecognized mount option(s) and continuing."); ··· 240 240 if (!on_errors) { 241 241 ntfs_error(vol->sb, "Invalid errors option argument " 242 242 "or bug in options parser."); 243 - return FALSE; 243 + return false; 244 244 } 245 245 } 246 246 if (nls_map) { 247 247 if (vol->nls_map && vol->nls_map != nls_map) { 248 248 ntfs_error(vol->sb, "Cannot change NLS character set " 249 249 "on remount."); 250 - return FALSE; 250 + return false; 251 251 } /* else (!vol->nls_map) */ 252 252 ntfs_debug("Using NLS character set %s.", nls_map->charset); 253 253 vol->nls_map = nls_map; ··· 257 257 if (!vol->nls_map) { 258 258 ntfs_error(vol->sb, "Failed to load default " 259 259 "NLS character set."); 260 - return FALSE; 260 + return false; 261 261 } 262 262 ntfs_debug("Using default NLS character set (%s).", 263 263 vol->nls_map->charset); ··· 268 268 mft_zone_multiplier) { 269 269 ntfs_error(vol->sb, "Cannot change mft_zone_multiplier " 270 270 "on remount."); 271 - return FALSE; 271 + return false; 272 272 } 273 273 if (mft_zone_multiplier < 1 || mft_zone_multiplier > 4) { 274 274 ntfs_error(vol->sb, "Invalid mft_zone_multiplier. " ··· 318 318 NVolSetSparseEnabled(vol); 319 319 } 320 320 } 321 - return TRUE; 321 + return true; 322 322 needs_arg: 323 323 ntfs_error(vol->sb, "The %s option requires an argument.", p); 324 - return FALSE; 324 + return false; 325 325 needs_bool: 326 326 ntfs_error(vol->sb, "The %s option requires a boolean argument.", p); 327 - return FALSE; 327 + return false; 328 328 needs_val: 329 329 ntfs_error(vol->sb, "Invalid %s option argument: %s", p, ov); 330 - return FALSE; 330 + return false; 331 331 } 332 332 333 333 #ifdef NTFS_RW ··· 543 543 * is_boot_sector_ntfs - check whether a boot sector is a valid NTFS boot sector 544 544 * @sb: Super block of the device to which @b belongs. 545 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 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 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 */ 554 - static BOOL is_boot_sector_ntfs(const struct super_block *sb, 555 - const NTFS_BOOT_SECTOR *b, const BOOL silent) 554 + static bool is_boot_sector_ntfs(const struct super_block *sb, 555 + const NTFS_BOOT_SECTOR *b, const bool silent) 556 556 { 557 557 /* 558 558 * Check that checksum == sum of u32 values from b to the checksum ··· 620 620 */ 621 621 if (!silent && b->end_of_sector_marker != const_cpu_to_le16(0xaa55)) 622 622 ntfs_warning(sb, "Invalid end of sector marker."); 623 - return TRUE; 623 + return true; 624 624 not_ntfs: 625 - return FALSE; 625 + return false; 626 626 } 627 627 628 628 /** ··· 732 732 * @b: boot sector to parse 733 733 * 734 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 */ 737 - static BOOL parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *b) 737 + static bool parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *b) 738 738 { 739 739 unsigned int sectors_per_cluster_bits, nr_hidden_sects; 740 740 int clusters_per_mft_record, clusters_per_index_record; ··· 751 751 "device block size (%lu). This is not " 752 752 "supported. Sorry.", vol->sector_size, 753 753 vol->sb->s_blocksize); 754 - return FALSE; 754 + return false; 755 755 } 756 756 ntfs_debug("sectors_per_cluster = 0x%x", b->bpb.sectors_per_cluster); 757 757 sectors_per_cluster_bits = ffs(b->bpb.sectors_per_cluster) - 1; ··· 770 770 ntfs_error(vol->sb, "Cluster size (%i) is smaller than the " 771 771 "sector size (%i). This is not supported. " 772 772 "Sorry.", vol->cluster_size, vol->sector_size); 773 - return FALSE; 773 + return false; 774 774 } 775 775 clusters_per_mft_record = b->clusters_per_mft_record; 776 776 ntfs_debug("clusters_per_mft_record = %i (0x%x)", ··· 802 802 "PAGE_CACHE_SIZE on your system (%lu). " 803 803 "This is not supported. Sorry.", 804 804 vol->mft_record_size, PAGE_CACHE_SIZE); 805 - return FALSE; 805 + return false; 806 806 } 807 807 /* We cannot support mft record sizes below the sector size. */ 808 808 if (vol->mft_record_size < vol->sector_size) { ··· 810 810 "sector size (%i). This is not supported. " 811 811 "Sorry.", vol->mft_record_size, 812 812 vol->sector_size); 813 - return FALSE; 813 + return false; 814 814 } 815 815 clusters_per_index_record = b->clusters_per_index_record; 816 816 ntfs_debug("clusters_per_index_record = %i (0x%x)", ··· 841 841 "the sector size (%i). This is not " 842 842 "supported. Sorry.", vol->index_record_size, 843 843 vol->sector_size); 844 - return FALSE; 844 + return false; 845 845 } 846 846 /* 847 847 * Get the size of the volume in clusters and check for 64-bit-ness. ··· 851 851 ll = sle64_to_cpu(b->number_of_sectors) >> sectors_per_cluster_bits; 852 852 if ((u64)ll >= 1ULL << 32) { 853 853 ntfs_error(vol->sb, "Cannot handle 64-bit clusters. Sorry."); 854 - return FALSE; 854 + return false; 855 855 } 856 856 vol->nr_clusters = ll; 857 857 ntfs_debug("vol->nr_clusters = 0x%llx", (long long)vol->nr_clusters); ··· 867 867 "Maximum supported is 2TiB. Sorry.", 868 868 (unsigned long long)ll >> (40 - 869 869 vol->cluster_size_bits)); 870 - return FALSE; 870 + return false; 871 871 } 872 872 } 873 873 ll = sle64_to_cpu(b->mft_lcn); ··· 875 875 ntfs_error(vol->sb, "MFT LCN (%lli, 0x%llx) is beyond end of " 876 876 "volume. Weird.", (unsigned long long)ll, 877 877 (unsigned long long)ll); 878 - return FALSE; 878 + return false; 879 879 } 880 880 vol->mft_lcn = ll; 881 881 ntfs_debug("vol->mft_lcn = 0x%llx", (long long)vol->mft_lcn); ··· 884 884 ntfs_error(vol->sb, "MFTMirr LCN (%lli, 0x%llx) is beyond end " 885 885 "of volume. Weird.", (unsigned long long)ll, 886 886 (unsigned long long)ll); 887 - return FALSE; 887 + return false; 888 888 } 889 889 vol->mftmirr_lcn = ll; 890 890 ntfs_debug("vol->mftmirr_lcn = 0x%llx", (long long)vol->mftmirr_lcn); ··· 907 907 vol->serial_no = le64_to_cpu(b->volume_serial_number); 908 908 ntfs_debug("vol->serial_no = 0x%llx", 909 909 (unsigned long long)vol->serial_no); 910 - return TRUE; 910 + return true; 911 911 } 912 912 913 913 /** ··· 1000 1000 * load_and_init_mft_mirror - load and setup the mft mirror inode for a volume 1001 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 */ 1005 - static BOOL load_and_init_mft_mirror(ntfs_volume *vol) 1005 + static bool load_and_init_mft_mirror(ntfs_volume *vol) 1006 1006 { 1007 1007 struct inode *tmp_ino; 1008 1008 ntfs_inode *tmp_ni; ··· 1014 1014 if (!IS_ERR(tmp_ino)) 1015 1015 iput(tmp_ino); 1016 1016 /* Caller will display error message. */ 1017 - return FALSE; 1017 + return false; 1018 1018 } 1019 1019 /* 1020 1020 * Re-initialize some specifics about $MFTMirr's inode as ··· 1041 1041 tmp_ni->itype.index.block_size_bits = vol->mft_record_size_bits; 1042 1042 vol->mftmirr_ino = tmp_ino; 1043 1043 ntfs_debug("Done."); 1044 - return TRUE; 1044 + return true; 1045 1045 } 1046 1046 1047 1047 /** 1048 1048 * check_mft_mirror - compare contents of the mft mirror with the mft 1049 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 1053 * Note, this function also results in the mft mirror runlist being completely 1054 1054 * mapped into memory. The mft mirror write code requires this and will BUG() 1055 1055 * should it find an unmapped runlist element. 1056 1056 */ 1057 - static BOOL check_mft_mirror(ntfs_volume *vol) 1057 + static bool check_mft_mirror(ntfs_volume *vol) 1058 1058 { 1059 1059 struct super_block *sb = vol->sb; 1060 1060 ntfs_inode *mirr_ni; ··· 1086 1086 index); 1087 1087 if (IS_ERR(mft_page)) { 1088 1088 ntfs_error(sb, "Failed to read $MFT."); 1089 - return FALSE; 1089 + return false; 1090 1090 } 1091 1091 kmft = page_address(mft_page); 1092 1092 /* Get the $MFTMirr page. */ ··· 1110 1110 ntfs_unmap_page(mirr_page); 1111 1111 mft_unmap_out: 1112 1112 ntfs_unmap_page(mft_page); 1113 - return FALSE; 1113 + return false; 1114 1114 } 1115 1115 } 1116 1116 /* Do not check the mirror record if it is not in use. */ ··· 1169 1169 ntfs_error(sb, "$MFTMirr location mismatch. " 1170 1170 "Run chkdsk."); 1171 1171 up_read(&mirr_ni->runlist.lock); 1172 - return FALSE; 1172 + return false; 1173 1173 } 1174 1174 } while (rl2[i++].length); 1175 1175 up_read(&mirr_ni->runlist.lock); 1176 1176 ntfs_debug("Done."); 1177 - return TRUE; 1177 + return true; 1178 1178 } 1179 1179 1180 1180 /** 1181 1181 * load_and_check_logfile - load and check the logfile inode for a volume 1182 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 */ 1186 - static BOOL load_and_check_logfile(ntfs_volume *vol, 1186 + static bool load_and_check_logfile(ntfs_volume *vol, 1187 1187 RESTART_PAGE_HEADER **rp) 1188 1188 { 1189 1189 struct inode *tmp_ino; ··· 1194 1194 if (!IS_ERR(tmp_ino)) 1195 1195 iput(tmp_ino); 1196 1196 /* Caller will display error message. */ 1197 - return FALSE; 1197 + return false; 1198 1198 } 1199 1199 if (!ntfs_check_logfile(tmp_ino, rp)) { 1200 1200 iput(tmp_ino); 1201 1201 /* ntfs_check_logfile() will have displayed error output. */ 1202 - return FALSE; 1202 + return false; 1203 1203 } 1204 1204 NInoSetSparseDisabled(NTFS_I(tmp_ino)); 1205 1205 vol->logfile_ino = tmp_ino; 1206 1206 ntfs_debug("Done."); 1207 - return TRUE; 1207 + return true; 1208 1208 } 1209 1209 1210 1210 #define NTFS_HIBERFIL_HEADER_SIZE 4096 ··· 1329 1329 * load_and_init_quota - load and setup the quota file for a volume if present 1330 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 1333 * leave vol->quota_ino as NULL and return success. 1334 1334 */ 1335 - static BOOL load_and_init_quota(ntfs_volume *vol) 1335 + static bool load_and_init_quota(ntfs_volume *vol) 1336 1336 { 1337 1337 MFT_REF mref; 1338 1338 struct inode *tmp_ino; ··· 1366 1366 * not enabled. 1367 1367 */ 1368 1368 NVolSetQuotaOutOfDate(vol); 1369 - return TRUE; 1369 + return true; 1370 1370 } 1371 1371 /* A real error occured. */ 1372 1372 ntfs_error(vol->sb, "Failed to find inode number for $Quota."); 1373 - return FALSE; 1373 + return false; 1374 1374 } 1375 1375 /* We do not care for the type of match that was found. */ 1376 1376 kfree(name); ··· 1380 1380 if (!IS_ERR(tmp_ino)) 1381 1381 iput(tmp_ino); 1382 1382 ntfs_error(vol->sb, "Failed to load $Quota."); 1383 - return FALSE; 1383 + return false; 1384 1384 } 1385 1385 vol->quota_ino = tmp_ino; 1386 1386 /* Get the $Q index allocation attribute. */ 1387 1387 tmp_ino = ntfs_index_iget(vol->quota_ino, Q, 2); 1388 1388 if (IS_ERR(tmp_ino)) { 1389 1389 ntfs_error(vol->sb, "Failed to load $Quota/$Q index."); 1390 - return FALSE; 1390 + return false; 1391 1391 } 1392 1392 vol->quota_q_ino = tmp_ino; 1393 1393 ntfs_debug("Done."); 1394 - return TRUE; 1394 + return true; 1395 1395 } 1396 1396 1397 1397 /** 1398 1398 * load_and_init_usnjrnl - load and setup the transaction log if present 1399 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 1403 * If $UsnJrnl is not present or in the process of being disabled, we set 1404 1404 * NVolUsnJrnlStamped() and return success. ··· 1408 1408 * stamped and nothing has been logged since, we also set NVolUsnJrnlStamped() 1409 1409 * and return success. 1410 1410 */ 1411 - static BOOL load_and_init_usnjrnl(ntfs_volume *vol) 1411 + static bool load_and_init_usnjrnl(ntfs_volume *vol) 1412 1412 { 1413 1413 MFT_REF mref; 1414 1414 struct inode *tmp_ino; ··· 1450 1450 * transaction logging is not enabled. 1451 1451 */ 1452 1452 NVolSetUsnJrnlStamped(vol); 1453 - return TRUE; 1453 + return true; 1454 1454 } 1455 1455 /* A real error occured. */ 1456 1456 ntfs_error(vol->sb, "Failed to find inode number for " 1457 1457 "$UsnJrnl."); 1458 - return FALSE; 1458 + return false; 1459 1459 } 1460 1460 /* We do not care for the type of match that was found. */ 1461 1461 kfree(name); ··· 1465 1465 if (!IS_ERR(tmp_ino)) 1466 1466 iput(tmp_ino); 1467 1467 ntfs_error(vol->sb, "Failed to load $UsnJrnl."); 1468 - return FALSE; 1468 + return false; 1469 1469 } 1470 1470 vol->usnjrnl_ino = tmp_ino; 1471 1471 /* ··· 1483 1483 if (IS_ERR(tmp_ino)) { 1484 1484 ntfs_error(vol->sb, "Failed to load $UsnJrnl/$DATA/$Max " 1485 1485 "attribute."); 1486 - return FALSE; 1486 + return false; 1487 1487 } 1488 1488 vol->usnjrnl_max_ino = tmp_ino; 1489 1489 if (unlikely(i_size_read(tmp_ino) < sizeof(USN_HEADER))) { ··· 1491 1491 "attribute (size is 0x%llx but should be at " 1492 1492 "least 0x%zx bytes).", i_size_read(tmp_ino), 1493 1493 sizeof(USN_HEADER)); 1494 - return FALSE; 1494 + return false; 1495 1495 } 1496 1496 /* Get the $DATA/$J attribute. */ 1497 1497 tmp_ino = ntfs_attr_iget(vol->usnjrnl_ino, AT_DATA, J, 2); 1498 1498 if (IS_ERR(tmp_ino)) { 1499 1499 ntfs_error(vol->sb, "Failed to load $UsnJrnl/$DATA/$J " 1500 1500 "attribute."); 1501 - return FALSE; 1501 + return false; 1502 1502 } 1503 1503 vol->usnjrnl_j_ino = tmp_ino; 1504 1504 /* Verify $J is non-resident and sparse. */ ··· 1506 1506 if (unlikely(!NInoNonResident(tmp_ni) || !NInoSparse(tmp_ni))) { 1507 1507 ntfs_error(vol->sb, "$UsnJrnl/$DATA/$J attribute is resident " 1508 1508 "and/or not sparse."); 1509 - return FALSE; 1509 + return false; 1510 1510 } 1511 1511 /* Read the USN_HEADER from $DATA/$Max. */ 1512 1512 page = ntfs_map_page(vol->usnjrnl_max_ino->i_mapping, 0); 1513 1513 if (IS_ERR(page)) { 1514 1514 ntfs_error(vol->sb, "Failed to read from $UsnJrnl/$DATA/$Max " 1515 1515 "attribute."); 1516 - return FALSE; 1516 + return false; 1517 1517 } 1518 1518 uh = (USN_HEADER*)page_address(page); 1519 1519 /* Sanity check the $Max. */ ··· 1524 1524 (long long)sle64_to_cpu(uh->allocation_delta), 1525 1525 (long long)sle64_to_cpu(uh->maximum_size)); 1526 1526 ntfs_unmap_page(page); 1527 - return FALSE; 1527 + return false; 1528 1528 } 1529 1529 /* 1530 1530 * If the transaction log has been stamped and nothing has been written ··· 1548 1548 (long long)sle64_to_cpu(uh->lowest_valid_usn), 1549 1549 i_size_read(vol->usnjrnl_j_ino)); 1550 1550 ntfs_unmap_page(page); 1551 - return FALSE; 1551 + return false; 1552 1552 } 1553 1553 ntfs_unmap_page(page); 1554 1554 ntfs_debug("Done."); 1555 - return TRUE; 1555 + return true; 1556 1556 } 1557 1557 1558 1558 /** 1559 1559 * load_and_init_attrdef - load the attribute definitions table for a volume 1560 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 */ 1564 - static BOOL load_and_init_attrdef(ntfs_volume *vol) 1564 + static bool load_and_init_attrdef(ntfs_volume *vol) 1565 1565 { 1566 1566 loff_t i_size; 1567 1567 struct super_block *sb = vol->sb; ··· 1607 1607 vol->attrdef_size = i_size; 1608 1608 ntfs_debug("Read %llu bytes from $AttrDef.", i_size); 1609 1609 iput(ino); 1610 - return TRUE; 1610 + return true; 1611 1611 free_iput_failed: 1612 1612 ntfs_free(vol->attrdef); 1613 1613 vol->attrdef = NULL; ··· 1615 1615 iput(ino); 1616 1616 failed: 1617 1617 ntfs_error(sb, "Failed to initialize attribute definition table."); 1618 - return FALSE; 1618 + return false; 1619 1619 } 1620 1620 1621 1621 #endif /* NTFS_RW */ ··· 1624 1624 * load_and_init_upcase - load the upcase table for an ntfs volume 1625 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 */ 1629 - static BOOL load_and_init_upcase(ntfs_volume *vol) 1629 + static bool load_and_init_upcase(ntfs_volume *vol) 1630 1630 { 1631 1631 loff_t i_size; 1632 1632 struct super_block *sb = vol->sb; ··· 1682 1682 ntfs_debug("Using volume specified $UpCase since default is " 1683 1683 "not present."); 1684 1684 mutex_unlock(&ntfs_lock); 1685 - return TRUE; 1685 + return true; 1686 1686 } 1687 1687 max = default_upcase_len; 1688 1688 if (max > vol->upcase_len) ··· 1698 1698 mutex_unlock(&ntfs_lock); 1699 1699 ntfs_debug("Volume specified $UpCase matches default. Using " 1700 1700 "default."); 1701 - return TRUE; 1701 + return true; 1702 1702 } 1703 1703 mutex_unlock(&ntfs_lock); 1704 1704 ntfs_debug("Using volume specified $UpCase since it does not match " 1705 1705 "the default."); 1706 - return TRUE; 1706 + return true; 1707 1707 iput_upcase_failed: 1708 1708 iput(ino); 1709 1709 ntfs_free(vol->upcase); ··· 1717 1717 mutex_unlock(&ntfs_lock); 1718 1718 ntfs_error(sb, "Failed to load $UpCase from the volume. Using " 1719 1719 "default."); 1720 - return TRUE; 1720 + return true; 1721 1721 } 1722 1722 mutex_unlock(&ntfs_lock); 1723 1723 ntfs_error(sb, "Failed to initialize upcase table."); 1724 - return FALSE; 1724 + return false; 1725 1725 } 1726 1726 1727 1727 /* ··· 1739 1739 * Open the system files with normal access functions and complete setting up 1740 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 */ 1744 - static BOOL load_system_files(ntfs_volume *vol) 1744 + static bool load_system_files(ntfs_volume *vol) 1745 1745 { 1746 1746 struct super_block *sb = vol->sb; 1747 1747 MFT_RECORD *m; ··· 2067 2067 #endif /* NTFS_RW */ 2068 2068 /* If on NTFS versions before 3.0, we are done. */ 2069 2069 if (unlikely(vol->major_ver < 3)) 2070 - return TRUE; 2070 + return true; 2071 2071 /* NTFS 3.0+ specific initialization. */ 2072 2072 /* Get the security descriptors inode. */ 2073 2073 vol->secure_ino = ntfs_iget(sb, FILE_Secure); ··· 2173 2173 NVolSetErrors(vol); 2174 2174 } 2175 2175 #endif /* NTFS_RW */ 2176 - return TRUE; 2176 + return true; 2177 2177 #ifdef NTFS_RW 2178 2178 iput_usnjrnl_err_out: 2179 2179 if (vol->usnjrnl_j_ino) ··· 2229 2229 if (vol->mftmirr_ino) 2230 2230 iput(vol->mftmirr_ino); 2231 2231 #endif /* NTFS_RW */ 2232 - return FALSE; 2232 + return false; 2233 2233 } 2234 2234 2235 2235 /**
-5
fs/ntfs/types.h
··· 62 62 typedef sle64 leUSN; 63 63 64 64 typedef enum { 65 - FALSE = 0, 66 - TRUE = 1 67 - } BOOL; 68 - 69 - typedef enum { 70 65 CASE_SENSITIVE = 0, 71 66 IGNORE_CASE = 1, 72 67 } IGNORE_CASE_BOOL;
+4 -4
fs/ntfs/unistr.c
··· 61 61 * @upcase: upcase table (only if @ic == IGNORE_CASE) 62 62 * @upcase_size: length in Unicode characters of @upcase (if present) 63 63 * 64 - * Compare the names @s1 and @s2 and return TRUE (1) if the names are 65 - * identical, or FALSE (0) if they are not identical. If @ic is IGNORE_CASE, 64 + * Compare the names @s1 and @s2 and return 'true' (1) if the names are 65 + * identical, or 'false' (0) if they are not identical. If @ic is IGNORE_CASE, 66 66 * the @upcase table is used to performa a case insensitive comparison. 67 67 */ 68 - BOOL ntfs_are_names_equal(const ntfschar *s1, size_t s1_len, 68 + bool ntfs_are_names_equal(const ntfschar *s1, size_t s1_len, 69 69 const ntfschar *s2, size_t s2_len, const IGNORE_CASE_BOOL ic, 70 70 const ntfschar *upcase, const u32 upcase_size) 71 71 { 72 72 if (s1_len != s2_len) 73 - return FALSE; 73 + return false; 74 74 if (ic == CASE_SENSITIVE) 75 75 return !ntfs_ucsncmp(s1, s2, s1_len); 76 76 return !ntfs_ucsncasecmp(s1, s2, s1_len, upcase, upcase_size);
+4 -4
fs/ntfs/usnjrnl.c
··· 39 39 * @vol: ntfs volume on which to stamp the transaction log 40 40 * 41 41 * Stamp the transaction log ($UsnJrnl) on the ntfs volume @vol and return 42 - * TRUE on success and FALSE on error. 42 + * 'true' on success and 'false' on error. 43 43 * 44 44 * This function assumes that the transaction log has already been loaded and 45 45 * consistency checked by a call to fs/ntfs/super.c::load_and_init_usnjrnl(). 46 46 */ 47 - BOOL ntfs_stamp_usnjrnl(ntfs_volume *vol) 47 + bool ntfs_stamp_usnjrnl(ntfs_volume *vol) 48 48 { 49 49 ntfs_debug("Entering."); 50 50 if (likely(!NVolUsnJrnlStamped(vol))) { ··· 56 56 if (IS_ERR(page)) { 57 57 ntfs_error(vol->sb, "Failed to read from " 58 58 "$UsnJrnl/$DATA/$Max attribute."); 59 - return FALSE; 59 + return false; 60 60 } 61 61 uh = (USN_HEADER*)page_address(page); 62 62 stamp = get_current_ntfs_time(); ··· 78 78 NVolSetUsnJrnlStamped(vol); 79 79 } 80 80 ntfs_debug("Done."); 81 - return TRUE; 81 + return true; 82 82 } 83 83 84 84 #endif /* NTFS_RW */
+1 -1
fs/ntfs/usnjrnl.h
··· 198 198 /* sizeof() = 60 (0x3c) bytes */ 199 199 } __attribute__ ((__packed__)) USN_RECORD; 200 200 201 - extern BOOL ntfs_stamp_usnjrnl(ntfs_volume *vol); 201 + extern bool ntfs_stamp_usnjrnl(ntfs_volume *vol); 202 202 203 203 #endif /* NTFS_RW */ 204 204