diff options
Diffstat (limited to 'fs/xfs/xfs_buf_item.c')
-rw-r--r-- | fs/xfs/xfs_buf_item.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 1975b3d9007a..c48e60bd857d 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c | |||
@@ -287,6 +287,17 @@ xfs_buf_item_format_segment( | |||
287 | */ | 287 | */ |
288 | base_size = offsetof(struct xfs_buf_log_format, blf_data_map) + | 288 | base_size = offsetof(struct xfs_buf_log_format, blf_data_map) + |
289 | (blfp->blf_map_size * sizeof(blfp->blf_data_map[0])); | 289 | (blfp->blf_map_size * sizeof(blfp->blf_data_map[0])); |
290 | |||
291 | nvecs = 0; | ||
292 | first_bit = xfs_next_bit(blfp->blf_data_map, blfp->blf_map_size, 0); | ||
293 | if (!(bip->bli_flags & XFS_BLI_STALE) && first_bit == -1) { | ||
294 | /* | ||
295 | * If the map is not be dirty in the transaction, mark | ||
296 | * the size as zero and do not advance the vector pointer. | ||
297 | */ | ||
298 | goto out; | ||
299 | } | ||
300 | |||
290 | vecp->i_addr = blfp; | 301 | vecp->i_addr = blfp; |
291 | vecp->i_len = base_size; | 302 | vecp->i_len = base_size; |
292 | vecp->i_type = XLOG_REG_TYPE_BFORMAT; | 303 | vecp->i_type = XLOG_REG_TYPE_BFORMAT; |
@@ -301,15 +312,13 @@ xfs_buf_item_format_segment( | |||
301 | */ | 312 | */ |
302 | trace_xfs_buf_item_format_stale(bip); | 313 | trace_xfs_buf_item_format_stale(bip); |
303 | ASSERT(blfp->blf_flags & XFS_BLF_CANCEL); | 314 | ASSERT(blfp->blf_flags & XFS_BLF_CANCEL); |
304 | blfp->blf_size = nvecs; | 315 | goto out; |
305 | return vecp; | ||
306 | } | 316 | } |
307 | 317 | ||
308 | /* | 318 | /* |
309 | * Fill in an iovec for each set of contiguous chunks. | 319 | * Fill in an iovec for each set of contiguous chunks. |
310 | */ | 320 | */ |
311 | first_bit = xfs_next_bit(blfp->blf_data_map, blfp->blf_map_size, 0); | 321 | |
312 | ASSERT(first_bit != -1); | ||
313 | last_bit = first_bit; | 322 | last_bit = first_bit; |
314 | nbits = 1; | 323 | nbits = 1; |
315 | for (;;) { | 324 | for (;;) { |
@@ -371,7 +380,8 @@ xfs_buf_item_format_segment( | |||
371 | nbits++; | 380 | nbits++; |
372 | } | 381 | } |
373 | } | 382 | } |
374 | bip->__bli_format.blf_size = nvecs; | 383 | out: |
384 | blfp->blf_size = nvecs; | ||
375 | return vecp; | 385 | return vecp; |
376 | } | 386 | } |
377 | 387 | ||