Skip to content

Commit 593e343

Browse files
dgchinnerdchinner
authored andcommitted
xfs: CIL context doesn't need to count iovecs
Now that we account for log opheaders in the log item formatting code, we don't actually use the aggregated count of log iovecs in the CIL for anything. Remove it and the tracking code that calculates it. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Chandan Babu R <chandan.babu@oracle.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
1 parent 14b07ec commit 593e343

2 files changed

Lines changed: 6 additions & 17 deletions

File tree

fs/xfs/xfs_log_cil.c

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -284,22 +284,18 @@ xlog_cil_alloc_shadow_bufs(
284284

285285
/*
286286
* Prepare the log item for insertion into the CIL. Calculate the difference in
287-
* log space and vectors it will consume, and if it is a new item pin it as
288-
* well.
287+
* log space it will consume, and if it is a new item pin it as well.
289288
*/
290289
STATIC void
291290
xfs_cil_prepare_item(
292291
struct xlog *log,
293292
struct xfs_log_vec *lv,
294293
struct xfs_log_vec *old_lv,
295-
int *diff_len,
296-
int *diff_iovecs)
294+
int *diff_len)
297295
{
298296
/* Account for the new LV being passed in */
299-
if (lv->lv_buf_len != XFS_LOG_VEC_ORDERED) {
297+
if (lv->lv_buf_len != XFS_LOG_VEC_ORDERED)
300298
*diff_len += lv->lv_bytes;
301-
*diff_iovecs += lv->lv_niovecs;
302-
}
303299

304300
/*
305301
* If there is no old LV, this is the first time we've seen the item in
@@ -316,7 +312,6 @@ xfs_cil_prepare_item(
316312
ASSERT(lv->lv_buf_len != XFS_LOG_VEC_ORDERED);
317313

318314
*diff_len -= old_lv->lv_bytes;
319-
*diff_iovecs -= old_lv->lv_niovecs;
320315
lv->lv_item->li_lv_shadow = old_lv;
321316
}
322317

@@ -365,12 +360,10 @@ static void
365360
xlog_cil_insert_format_items(
366361
struct xlog *log,
367362
struct xfs_trans *tp,
368-
int *diff_len,
369-
int *diff_iovecs)
363+
int *diff_len)
370364
{
371365
struct xfs_log_item *lip;
372366

373-
374367
/* Bail out if we didn't find a log item. */
375368
if (list_empty(&tp->t_items)) {
376369
ASSERT(0);
@@ -413,7 +406,6 @@ xlog_cil_insert_format_items(
413406
* set the item up as though it is a new insertion so
414407
* that the space reservation accounting is correct.
415408
*/
416-
*diff_iovecs -= lv->lv_niovecs;
417409
*diff_len -= lv->lv_bytes;
418410

419411
/* Ensure the lv is set up according to ->iop_size */
@@ -438,7 +430,7 @@ xlog_cil_insert_format_items(
438430
ASSERT(IS_ALIGNED((unsigned long)lv->lv_buf, sizeof(uint64_t)));
439431
lip->li_ops->iop_format(lip, lv);
440432
insert:
441-
xfs_cil_prepare_item(log, lv, old_lv, diff_len, diff_iovecs);
433+
xfs_cil_prepare_item(log, lv, old_lv, diff_len);
442434
}
443435
}
444436

@@ -458,7 +450,6 @@ xlog_cil_insert_items(
458450
struct xfs_cil_ctx *ctx = cil->xc_ctx;
459451
struct xfs_log_item *lip;
460452
int len = 0;
461-
int diff_iovecs = 0;
462453
int iclog_space;
463454
int iovhdr_res = 0, split_res = 0, ctx_res = 0;
464455

@@ -468,7 +459,7 @@ xlog_cil_insert_items(
468459
* We can do this safely because the context can't checkpoint until we
469460
* are done so it doesn't matter exactly how we update the CIL.
470461
*/
471-
xlog_cil_insert_format_items(log, tp, &len, &diff_iovecs);
462+
xlog_cil_insert_format_items(log, tp, &len);
472463

473464
spin_lock(&cil->xc_cil_lock);
474465

@@ -503,7 +494,6 @@ xlog_cil_insert_items(
503494
}
504495
tp->t_ticket->t_curr_res -= len;
505496
ctx->space_used += len;
506-
ctx->nvecs += diff_iovecs;
507497

508498
/*
509499
* If we've overrun the reservation, dump the tx details before we move

fs/xfs/xfs_log_priv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ struct xfs_cil_ctx {
221221
xfs_lsn_t commit_lsn; /* chkpt commit record lsn */
222222
struct xlog_in_core *commit_iclog;
223223
struct xlog_ticket *ticket; /* chkpt ticket */
224-
int nvecs; /* number of regions */
225224
int space_used; /* aggregate size of regions */
226225
struct list_head busy_extents; /* busy extents in chkpt */
227226
struct xfs_log_vec *lv_chain; /* logvecs being pushed */

0 commit comments

Comments
 (0)