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