From: Brian Foster <bfoster@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH 00/25] xfs: embed firstblock in xfs_trans
Date: Tue, 3 Jul 2018 13:22:54 -0400 [thread overview]
Message-ID: <20180703172319.24509-1-bfoster@redhat.com> (raw)
Hi all,
This is a quick refactor of firstblock usage thoughout XFS. A firstblock
variable is used to track the first allocation of a transaction to help
maintain AG lock order, but it has historically been passed all over the
place independent from the associated transaction (similar to dfops).
This makes sense in some cases where the transaction is rolled, but even
with that case, this can all be handled with a bit less code by pushing
firstblock directly into the transaction.
These are mostly simple, mechanical refactoring patches. The whole thing
could probably be squashed into half the patch count, but I opted to
keep smaller patches as it is easier to squash them later than take them
apart depending on preference. The series applies on top of the recent
->t_dfops refactoring series [1].
Patch 1 is a simple prepatory patch. Patch 2 adds the new ->t_firstblock
field to xfs_trans. Patches 3-24 are a sequence of replacing on-stack
firstblock usage with ->t_firstblock and removing unnecessary firstblock
function parameters and args passing struct fields. Once every
transaction that requires it is converted over to ->t_firstblock, patch
25 eliminates the unnecessary parameter and initialization from
xfs_defer_init().
This all survives a couple rounds of xfstests (with KASAN enabled)
without any explosions. Thoughts, reviews, flames appreciated.
Brian
[1] https://marc.info/?l=linux-xfs&m=153020380302037&w=2
Brian Foster (25):
xfs: allow null firstblock in xfs_bmapi_write() when tp is null
xfs: add firstblock field to xfs_trans
xfs: use ->t_firstblock in dir ops
xfs: remove firstblock param from xfs dir ops
xfs: use ->t_firstblock in attrfork add
xfs: use ->t_firstblock in xattr ops
xfs: use ->t_firstblock for all xfs_bmapi_write() callers
xfs: use ->t_firstblock for all xfs_bunmapi() callers
xfs: use ->t_firstblock in xfs_bmapi_remap()
xfs: use ->t_firstblock in insert/collapse range
xfs: remove xfs_bmapi_write() firstblock param
xfs: remove xfs_bunmapi() firstblock param
xfs: remove bmap insert/collapse firstblock param
xfs: use ->t_firstblock in bmap extent split
xfs: remove xfs_bmalloca firstblock field
xfs: remove bmap extent add helper firstblock params
xfs: remove bmap format helpers firstblock params
xfs: remove xfs_btree_cur private firstblock field
xfs: remove xfs_alloc_arg firstblock field
xfs: use ->t_firstblock in dq alloc
xfs: replace no-op firstblock init with ->t_firstblock
xfs: use ->t_firstblock in reflink cow block cancel
xfs: use ->t_firstblock in extent swap
xfs: use ->t_firstblock in inode inactivate
xfs: remove xfs_defer_init() firstblock param
fs/xfs/libxfs/xfs_alloc.c | 20 ++--
fs/xfs/libxfs/xfs_alloc.h | 1 -
fs/xfs/libxfs/xfs_attr.c | 29 ++---
fs/xfs/libxfs/xfs_attr_leaf.c | 2 -
fs/xfs/libxfs/xfs_attr_remote.c | 13 +--
fs/xfs/libxfs/xfs_bmap.c | 181 +++++++++--------------------
fs/xfs/libxfs/xfs_bmap.h | 13 +--
fs/xfs/libxfs/xfs_bmap_btree.c | 11 +-
fs/xfs/libxfs/xfs_btree.h | 1 -
fs/xfs/libxfs/xfs_da_btree.c | 9 +-
fs/xfs/libxfs/xfs_da_btree.h | 1 -
fs/xfs/libxfs/xfs_defer.c | 5 +-
fs/xfs/libxfs/xfs_defer.h | 3 +-
fs/xfs/libxfs/xfs_dir2.c | 12 +-
fs/xfs/libxfs/xfs_dir2.h | 6 +-
fs/xfs/libxfs/xfs_refcount.c | 2 +-
fs/xfs/libxfs/xfs_refcount_btree.c | 1 -
fs/xfs/xfs_bmap_util.c | 29 ++---
fs/xfs/xfs_dquot.c | 9 +-
fs/xfs/xfs_inode.c | 55 ++++-----
fs/xfs/xfs_iomap.c | 20 ++--
fs/xfs/xfs_log_recover.c | 3 +-
fs/xfs/xfs_reflink.c | 28 ++---
fs/xfs/xfs_rtalloc.c | 7 +-
fs/xfs/xfs_symlink.c | 14 +--
fs/xfs/xfs_trace.h | 2 +-
fs/xfs/xfs_trans.c | 2 +
fs/xfs/xfs_trans.h | 1 +
28 files changed, 170 insertions(+), 310 deletions(-)
--
2.17.1
next reply other threads:[~2018-07-03 17:23 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-03 17:22 Brian Foster [this message]
2018-07-03 17:22 ` [PATCH 01/25] xfs: allow null firstblock in xfs_bmapi_write() when tp is null Brian Foster
2018-07-04 0:24 ` Darrick J. Wong
2018-07-08 15:26 ` Christoph Hellwig
2018-07-03 17:22 ` [PATCH 02/25] xfs: add firstblock field to xfs_trans Brian Foster
2018-07-04 0:41 ` Darrick J. Wong
2018-07-08 15:26 ` Christoph Hellwig
2018-07-03 17:22 ` [PATCH 03/25] xfs: use ->t_firstblock in dir ops Brian Foster
2018-07-04 0:42 ` Darrick J. Wong
2018-07-03 17:22 ` [PATCH 04/25] xfs: remove firstblock param from xfs " Brian Foster
2018-07-03 18:06 ` Darrick J. Wong
2018-07-03 18:15 ` Brian Foster
2018-07-03 17:22 ` [PATCH 05/25] xfs: use ->t_firstblock in attrfork add Brian Foster
2018-07-04 0:43 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 06/25] xfs: use ->t_firstblock in xattr ops Brian Foster
2018-07-04 0:45 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 07/25] xfs: use ->t_firstblock for all xfs_bmapi_write() callers Brian Foster
2018-07-04 0:47 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 08/25] xfs: use ->t_firstblock for all xfs_bunmapi() callers Brian Foster
2018-07-04 0:47 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 09/25] xfs: use ->t_firstblock in xfs_bmapi_remap() Brian Foster
2018-07-04 0:47 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 10/25] xfs: use ->t_firstblock in insert/collapse range Brian Foster
2018-07-04 0:48 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 11/25] xfs: remove xfs_bmapi_write() firstblock param Brian Foster
2018-07-04 0:50 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 12/25] xfs: remove xfs_bunmapi() " Brian Foster
2018-07-04 0:51 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 13/25] xfs: remove bmap insert/collapse " Brian Foster
2018-07-04 0:51 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 14/25] xfs: use ->t_firstblock in bmap extent split Brian Foster
2018-07-04 0:51 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 15/25] xfs: remove xfs_bmalloca firstblock field Brian Foster
2018-07-04 0:52 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 16/25] xfs: remove bmap extent add helper firstblock params Brian Foster
2018-07-04 0:52 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 17/25] xfs: remove bmap format helpers " Brian Foster
2018-07-04 0:53 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 18/25] xfs: remove xfs_btree_cur private firstblock field Brian Foster
2018-07-04 0:54 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 19/25] xfs: remove xfs_alloc_arg " Brian Foster
2018-07-04 0:54 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 20/25] xfs: use ->t_firstblock in dq alloc Brian Foster
2018-07-04 0:54 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 21/25] xfs: replace no-op firstblock init with ->t_firstblock Brian Foster
2018-07-04 0:54 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 22/25] xfs: use ->t_firstblock in reflink cow block cancel Brian Foster
2018-07-04 0:55 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 23/25] xfs: use ->t_firstblock in extent swap Brian Foster
2018-07-04 0:55 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 24/25] xfs: use ->t_firstblock in inode inactivate Brian Foster
2018-07-04 0:55 ` Darrick J. Wong
2018-07-03 17:23 ` [PATCH 25/25] xfs: remove xfs_defer_init() firstblock param Brian Foster
2018-07-04 1:27 ` Darrick J. Wong
2018-07-08 15:37 ` Christoph Hellwig
2018-07-08 16:34 ` Darrick J. Wong
2018-07-10 1:07 ` Brian Foster
2018-07-10 7:11 ` [PATCH 00/25] xfs: embed firstblock in xfs_trans Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180703172319.24509-1-bfoster@redhat.com \
--to=bfoster@redhat.com \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).