diff options
author | Dave Chinner <dchinner@redhat.com> | 2010-05-06 21:05:19 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2010-05-24 11:33:39 -0400 |
commit | c11554104f4dcb509fd43973389b097a04b9d51d (patch) | |
tree | 18b67546aa2baacaa729ae51ad656465bdc2654f /fs/xfs/xfs_buf_item.c | |
parent | 64fc35de60da3b1fe970168d10914bf1cf34a3e3 (diff) |
xfs: Clean up XFS_BLI_* flag namespace
Clean up the buffer log format (XFS_BLI_*) flags because they have a
polluted namespace. They XFS_BLI_ prefix is used for both in-memory
and on-disk flag feilds, but have overlapping values for different
flags. Rename the buffer log format flags to use the XFS_BLF_*
prefix to avoid confusing them with the in-memory XFS_BLI_* prefixed
flags.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_buf_item.c')
-rw-r--r-- | fs/xfs/xfs_buf_item.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 4cd5f615371d..bcbb66150838 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c | |||
@@ -64,7 +64,7 @@ xfs_buf_item_log_debug( | |||
64 | nbytes = last - first + 1; | 64 | nbytes = last - first + 1; |
65 | bfset(bip->bli_logged, first, nbytes); | 65 | bfset(bip->bli_logged, first, nbytes); |
66 | for (x = 0; x < nbytes; x++) { | 66 | for (x = 0; x < nbytes; x++) { |
67 | chunk_num = byte >> XFS_BLI_SHIFT; | 67 | chunk_num = byte >> XFS_BLF_SHIFT; |
68 | word_num = chunk_num >> BIT_TO_WORD_SHIFT; | 68 | word_num = chunk_num >> BIT_TO_WORD_SHIFT; |
69 | bit_num = chunk_num & (NBWORD - 1); | 69 | bit_num = chunk_num & (NBWORD - 1); |
70 | wordp = &(bip->bli_format.blf_data_map[word_num]); | 70 | wordp = &(bip->bli_format.blf_data_map[word_num]); |
@@ -166,7 +166,7 @@ xfs_buf_item_size( | |||
166 | * cancel flag in it. | 166 | * cancel flag in it. |
167 | */ | 167 | */ |
168 | trace_xfs_buf_item_size_stale(bip); | 168 | trace_xfs_buf_item_size_stale(bip); |
169 | ASSERT(bip->bli_format.blf_flags & XFS_BLI_CANCEL); | 169 | ASSERT(bip->bli_format.blf_flags & XFS_BLF_CANCEL); |
170 | return 1; | 170 | return 1; |
171 | } | 171 | } |
172 | 172 | ||
@@ -197,9 +197,9 @@ xfs_buf_item_size( | |||
197 | } else if (next_bit != last_bit + 1) { | 197 | } else if (next_bit != last_bit + 1) { |
198 | last_bit = next_bit; | 198 | last_bit = next_bit; |
199 | nvecs++; | 199 | nvecs++; |
200 | } else if (xfs_buf_offset(bp, next_bit * XFS_BLI_CHUNK) != | 200 | } else if (xfs_buf_offset(bp, next_bit * XFS_BLF_CHUNK) != |
201 | (xfs_buf_offset(bp, last_bit * XFS_BLI_CHUNK) + | 201 | (xfs_buf_offset(bp, last_bit * XFS_BLF_CHUNK) + |
202 | XFS_BLI_CHUNK)) { | 202 | XFS_BLF_CHUNK)) { |
203 | last_bit = next_bit; | 203 | last_bit = next_bit; |
204 | nvecs++; | 204 | nvecs++; |
205 | } else { | 205 | } else { |
@@ -261,7 +261,7 @@ xfs_buf_item_format( | |||
261 | * cancel flag in it. | 261 | * cancel flag in it. |
262 | */ | 262 | */ |
263 | trace_xfs_buf_item_format_stale(bip); | 263 | trace_xfs_buf_item_format_stale(bip); |
264 | ASSERT(bip->bli_format.blf_flags & XFS_BLI_CANCEL); | 264 | ASSERT(bip->bli_format.blf_flags & XFS_BLF_CANCEL); |
265 | bip->bli_format.blf_size = nvecs; | 265 | bip->bli_format.blf_size = nvecs; |
266 | return; | 266 | return; |
267 | } | 267 | } |
@@ -294,28 +294,28 @@ xfs_buf_item_format( | |||
294 | * keep counting and scanning. | 294 | * keep counting and scanning. |
295 | */ | 295 | */ |
296 | if (next_bit == -1) { | 296 | if (next_bit == -1) { |
297 | buffer_offset = first_bit * XFS_BLI_CHUNK; | 297 | buffer_offset = first_bit * XFS_BLF_CHUNK; |
298 | vecp->i_addr = xfs_buf_offset(bp, buffer_offset); | 298 | vecp->i_addr = xfs_buf_offset(bp, buffer_offset); |
299 | vecp->i_len = nbits * XFS_BLI_CHUNK; | 299 | vecp->i_len = nbits * XFS_BLF_CHUNK; |
300 | vecp->i_type = XLOG_REG_TYPE_BCHUNK; | 300 | vecp->i_type = XLOG_REG_TYPE_BCHUNK; |
301 | nvecs++; | 301 | nvecs++; |
302 | break; | 302 | break; |
303 | } else if (next_bit != last_bit + 1) { | 303 | } else if (next_bit != last_bit + 1) { |
304 | buffer_offset = first_bit * XFS_BLI_CHUNK; | 304 | buffer_offset = first_bit * XFS_BLF_CHUNK; |
305 | vecp->i_addr = xfs_buf_offset(bp, buffer_offset); | 305 | vecp->i_addr = xfs_buf_offset(bp, buffer_offset); |
306 | vecp->i_len = nbits * XFS_BLI_CHUNK; | 306 | vecp->i_len = nbits * XFS_BLF_CHUNK; |
307 | vecp->i_type = XLOG_REG_TYPE_BCHUNK; | 307 | vecp->i_type = XLOG_REG_TYPE_BCHUNK; |
308 | nvecs++; | 308 | nvecs++; |
309 | vecp++; | 309 | vecp++; |
310 | first_bit = next_bit; | 310 | first_bit = next_bit; |
311 | last_bit = next_bit; | 311 | last_bit = next_bit; |
312 | nbits = 1; | 312 | nbits = 1; |
313 | } else if (xfs_buf_offset(bp, next_bit << XFS_BLI_SHIFT) != | 313 | } else if (xfs_buf_offset(bp, next_bit << XFS_BLF_SHIFT) != |
314 | (xfs_buf_offset(bp, last_bit << XFS_BLI_SHIFT) + | 314 | (xfs_buf_offset(bp, last_bit << XFS_BLF_SHIFT) + |
315 | XFS_BLI_CHUNK)) { | 315 | XFS_BLF_CHUNK)) { |
316 | buffer_offset = first_bit * XFS_BLI_CHUNK; | 316 | buffer_offset = first_bit * XFS_BLF_CHUNK; |
317 | vecp->i_addr = xfs_buf_offset(bp, buffer_offset); | 317 | vecp->i_addr = xfs_buf_offset(bp, buffer_offset); |
318 | vecp->i_len = nbits * XFS_BLI_CHUNK; | 318 | vecp->i_len = nbits * XFS_BLF_CHUNK; |
319 | vecp->i_type = XLOG_REG_TYPE_BCHUNK; | 319 | vecp->i_type = XLOG_REG_TYPE_BCHUNK; |
320 | /* You would think we need to bump the nvecs here too, but we do not | 320 | /* You would think we need to bump the nvecs here too, but we do not |
321 | * this number is used by recovery, and it gets confused by the boundary | 321 | * this number is used by recovery, and it gets confused by the boundary |
@@ -399,7 +399,7 @@ xfs_buf_item_unpin( | |||
399 | ASSERT(XFS_BUF_VALUSEMA(bp) <= 0); | 399 | ASSERT(XFS_BUF_VALUSEMA(bp) <= 0); |
400 | ASSERT(!(XFS_BUF_ISDELAYWRITE(bp))); | 400 | ASSERT(!(XFS_BUF_ISDELAYWRITE(bp))); |
401 | ASSERT(XFS_BUF_ISSTALE(bp)); | 401 | ASSERT(XFS_BUF_ISSTALE(bp)); |
402 | ASSERT(bip->bli_format.blf_flags & XFS_BLI_CANCEL); | 402 | ASSERT(bip->bli_format.blf_flags & XFS_BLF_CANCEL); |
403 | trace_xfs_buf_item_unpin_stale(bip); | 403 | trace_xfs_buf_item_unpin_stale(bip); |
404 | 404 | ||
405 | /* | 405 | /* |
@@ -550,7 +550,7 @@ xfs_buf_item_unlock( | |||
550 | */ | 550 | */ |
551 | if (bip->bli_flags & XFS_BLI_STALE) { | 551 | if (bip->bli_flags & XFS_BLI_STALE) { |
552 | trace_xfs_buf_item_unlock_stale(bip); | 552 | trace_xfs_buf_item_unlock_stale(bip); |
553 | ASSERT(bip->bli_format.blf_flags & XFS_BLI_CANCEL); | 553 | ASSERT(bip->bli_format.blf_flags & XFS_BLF_CANCEL); |
554 | if (!aborted) { | 554 | if (!aborted) { |
555 | atomic_dec(&bip->bli_refcount); | 555 | atomic_dec(&bip->bli_refcount); |
556 | return; | 556 | return; |
@@ -707,12 +707,12 @@ xfs_buf_item_init( | |||
707 | } | 707 | } |
708 | 708 | ||
709 | /* | 709 | /* |
710 | * chunks is the number of XFS_BLI_CHUNK size pieces | 710 | * chunks is the number of XFS_BLF_CHUNK size pieces |
711 | * the buffer can be divided into. Make sure not to | 711 | * the buffer can be divided into. Make sure not to |
712 | * truncate any pieces. map_size is the size of the | 712 | * truncate any pieces. map_size is the size of the |
713 | * bitmap needed to describe the chunks of the buffer. | 713 | * bitmap needed to describe the chunks of the buffer. |
714 | */ | 714 | */ |
715 | chunks = (int)((XFS_BUF_COUNT(bp) + (XFS_BLI_CHUNK - 1)) >> XFS_BLI_SHIFT); | 715 | chunks = (int)((XFS_BUF_COUNT(bp) + (XFS_BLF_CHUNK - 1)) >> XFS_BLF_SHIFT); |
716 | map_size = (int)((chunks + NBWORD) >> BIT_TO_WORD_SHIFT); | 716 | map_size = (int)((chunks + NBWORD) >> BIT_TO_WORD_SHIFT); |
717 | 717 | ||
718 | bip = (xfs_buf_log_item_t*)kmem_zone_zalloc(xfs_buf_item_zone, | 718 | bip = (xfs_buf_log_item_t*)kmem_zone_zalloc(xfs_buf_item_zone, |
@@ -780,8 +780,8 @@ xfs_buf_item_log( | |||
780 | /* | 780 | /* |
781 | * Convert byte offsets to bit numbers. | 781 | * Convert byte offsets to bit numbers. |
782 | */ | 782 | */ |
783 | first_bit = first >> XFS_BLI_SHIFT; | 783 | first_bit = first >> XFS_BLF_SHIFT; |
784 | last_bit = last >> XFS_BLI_SHIFT; | 784 | last_bit = last >> XFS_BLF_SHIFT; |
785 | 785 | ||
786 | /* | 786 | /* |
787 | * Calculate the total number of bits to be set. | 787 | * Calculate the total number of bits to be set. |