diff options
author | Dave Chinner <dchinner@redhat.com> | 2013-08-12 20:50:04 +1000 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-08-13 16:10:21 -0500 |
commit | 166d13688a0e2d0aa379e259af8e2ee6a401de9a (patch) | |
tree | 2f30092475185ee80d941e0be7689a0f5151be9f /fs/xfs/xfs_log_cil.c | |
parent | 050a1952c3f9304eccddc4f084e2401b5205ff55 (diff) |
xfs: return log item size in IOP_SIZE
To begin optimising the CIL commit process, we need to have IOP_SIZE
return both the number of vectors and the size of the data pointed
to by the vectors. This enables us to calculate the size ofthe
memory allocation needed before the formatting step and reduces the
number of memory allocations per item by one.
While there, kill the IOP_SIZE macro.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_log_cil.c')
-rw-r--r-- | fs/xfs/xfs_log_cil.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/xfs/xfs_log_cil.c b/fs/xfs/xfs_log_cil.c index 02b9cf3f8252..4e108720a789 100644 --- a/fs/xfs/xfs_log_cil.c +++ b/fs/xfs/xfs_log_cil.c @@ -122,19 +122,23 @@ xlog_cil_prepare_log_vecs( } list_for_each_entry(lidp, &tp->t_items, lid_trans) { + struct xfs_log_item *lip = lidp->lid_item; struct xfs_log_vec *new_lv; void *ptr; int index; int len = 0; - uint niovecs; + uint niovecs = 0; + uint nbytes = 0; bool ordered = false; /* Skip items which aren't dirty in this transaction. */ if (!(lidp->lid_flags & XFS_LID_DIRTY)) continue; + /* get number of vecs and size of data to be stored */ + lip->li_ops->iop_size(lip, &niovecs, &nbytes); + /* Skip items that do not have any vectors for writing */ - niovecs = IOP_SIZE(lidp->lid_item); if (!niovecs) continue; @@ -152,7 +156,7 @@ xlog_cil_prepare_log_vecs( niovecs * sizeof(struct xfs_log_iovec), KM_SLEEP|KM_NOFS); - new_lv->lv_item = lidp->lid_item; + new_lv->lv_item = lip; new_lv->lv_niovecs = niovecs; if (ordered) { /* track as an ordered logvec */ |