xfs: one-shot cached buffers
authorDave Chinner <dchinner@redhat.com>
Mon, 14 May 2018 06:10:05 +0000 (23:10 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 16 May 2018 01:12:51 +0000 (18:12 -0700)
commit879de98ead5106ffd5486aa6c11a3fad141049d9
tree9f1edecb6e305aacb9cef8b990c8cbb36bc72a37
parent84d42ea6b6269aee7eb3d91a4425a08b8965fd4a
xfs: one-shot cached buffers

For the new growfs work, we want to ensure that we serialise
secondary superblock updates with other operations (e.g. scrub)
correctly, but we don't want to cache the buffers for long term
reuse. We need cached buffers for serialisation, however.

To solve this, introduce a "oneshot" buffer which will be marshalled
through the cache but then released once the last current reference
goes away. If the buffer is already cached, then we ignore the
"one-shot" behaviour and leave the buffer in the state it was prior
to the one-shot command being run. This means we don't perturb
either the working set or existing cached buffer state by a one-shot
operation.

Signed-Off-By: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_buf.h