]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: avoid CIL allocation during insert
authorDave Chinner <dchinner@redhat.com>
Mon, 12 Aug 2013 10:50:06 +0000 (20:50 +1000)
committerBen Myers <bpm@sgi.com>
Tue, 13 Aug 2013 21:19:03 +0000 (16:19 -0500)
commit1d5c00ae42dba640900cc357d66645d1674d6868
treed4751244552a0c974d9e627209104a2a33e179ca
parentf5b4ade4de8e88fc8c5c8ed6159140e3b68be5df
xfs: avoid CIL allocation during insert

Now that we have the size of the log vector that has been allocated,
we can determine if we need to allocate a new log vector for
formatting and insertion. We only need to allocate a new vector if
it won't fit into the existing buffer.

However, we need to hold the CIL context lock while we do this so
that we can't race with a push draining the currently queued log
vectors. It is safe to do this as long as we do GFP_NOFS allocation
to avoid avoid memory allocation recursing into the filesystem.
Hence we can safely overwrite the existing log vector on the CIL if
it is large enough to hold all the dirty regions of the current
item.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_log_cil.c
fs/xfs/xfs_trans.h