From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Brian Foster <bfoster@redhat.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 05/25] xfs: use ->t_firstblock in attrfork add
Date: Tue, 3 Jul 2018 17:43:50 -0700 [thread overview]
Message-ID: <20180704004350.GE32415@magnolia> (raw)
In-Reply-To: <20180703172319.24509-6-bfoster@redhat.com>
On Tue, Jul 03, 2018 at 01:22:59PM -0400, Brian Foster wrote:
> Note that this codepath is a user of struct xfs_da_args. Switch it
> over to ->t_firstblock in preparation to remove
> xfs_da_args.firstblock.
>
> Signed-off-by: Brian Foster <bfoster@redhat.com>
Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
> fs/xfs/libxfs/xfs_bmap.c | 33 +++++++++++++--------------------
> 1 file changed, 13 insertions(+), 20 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index c6a5a957674d..fcd10b47044a 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -915,7 +915,6 @@ STATIC int /* error */
> xfs_bmap_add_attrfork_btree(
> xfs_trans_t *tp, /* transaction pointer */
> xfs_inode_t *ip, /* incore inode pointer */
> - xfs_fsblock_t *firstblock, /* first block allocated */
> int *flags) /* inode logging flags */
> {
> xfs_btree_cur_t *cur; /* btree cursor */
> @@ -928,7 +927,7 @@ xfs_bmap_add_attrfork_btree(
> *flags |= XFS_ILOG_DBROOT;
> else {
> cur = xfs_bmbt_init_cursor(mp, tp, ip, XFS_DATA_FORK);
> - cur->bc_private.b.firstblock = *firstblock;
> + cur->bc_private.b.firstblock = tp->t_firstblock;
> error = xfs_bmbt_lookup_first(cur, &stat);
> if (error)
> goto error0;
> @@ -940,7 +939,7 @@ xfs_bmap_add_attrfork_btree(
> xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
> return -ENOSPC;
> }
> - *firstblock = cur->bc_private.b.firstblock;
> + tp->t_firstblock = cur->bc_private.b.firstblock;
> cur->bc_private.b.allocated = 0;
> xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
> }
> @@ -957,7 +956,6 @@ STATIC int /* error */
> xfs_bmap_add_attrfork_extents(
> struct xfs_trans *tp, /* transaction pointer */
> struct xfs_inode *ip, /* incore inode pointer */
> - xfs_fsblock_t *firstblock, /* first block allocated */
> int *flags) /* inode logging flags */
> {
> xfs_btree_cur_t *cur; /* bmap btree cursor */
> @@ -966,8 +964,8 @@ xfs_bmap_add_attrfork_extents(
> if (ip->i_d.di_nextents * sizeof(xfs_bmbt_rec_t) <= XFS_IFORK_DSIZE(ip))
> return 0;
> cur = NULL;
> - error = xfs_bmap_extents_to_btree(tp, ip, firstblock, &cur, 0, flags,
> - XFS_DATA_FORK);
> + error = xfs_bmap_extents_to_btree(tp, ip, &tp->t_firstblock, &cur, 0,
> + flags, XFS_DATA_FORK);
> if (cur) {
> cur->bc_private.b.allocated = 0;
> xfs_btree_del_cursor(cur,
> @@ -989,12 +987,11 @@ xfs_bmap_add_attrfork_extents(
> */
> STATIC int /* error */
> xfs_bmap_add_attrfork_local(
> - xfs_trans_t *tp, /* transaction pointer */
> - xfs_inode_t *ip, /* incore inode pointer */
> - xfs_fsblock_t *firstblock, /* first block allocated */
> + struct xfs_trans *tp, /* transaction pointer */
> + struct xfs_inode *ip, /* incore inode pointer */
> int *flags) /* inode logging flags */
> {
> - xfs_da_args_t dargs; /* args for dir/attr code */
> + struct xfs_da_args dargs; /* args for dir/attr code */
>
> if (ip->i_df.if_bytes <= XFS_IFORK_DSIZE(ip))
> return 0;
> @@ -1003,7 +1000,7 @@ xfs_bmap_add_attrfork_local(
> memset(&dargs, 0, sizeof(dargs));
> dargs.geo = ip->i_mount->m_dir_geo;
> dargs.dp = ip;
> - dargs.firstblock = firstblock;
> + dargs.firstblock = &tp->t_firstblock;
> dargs.total = dargs.geo->fsbcount;
> dargs.whichfork = XFS_DATA_FORK;
> dargs.trans = tp;
> @@ -1011,7 +1008,7 @@ xfs_bmap_add_attrfork_local(
> }
>
> if (S_ISLNK(VFS_I(ip)->i_mode))
> - return xfs_bmap_local_to_extents(tp, ip, firstblock, 1,
> + return xfs_bmap_local_to_extents(tp, ip, &tp->t_firstblock, 1,
> flags, XFS_DATA_FORK,
> xfs_symlink_local_to_remote);
>
> @@ -1030,7 +1027,6 @@ xfs_bmap_add_attrfork(
> int size, /* space new attribute needs */
> int rsvd) /* xact may use reserved blks */
> {
> - xfs_fsblock_t firstblock; /* 1st block/ag allocated */
> struct xfs_defer_ops dfops; /* freed extent records */
> xfs_mount_t *mp; /* mount structure */
> xfs_trans_t *tp; /* transaction pointer */
> @@ -1050,7 +1046,7 @@ xfs_bmap_add_attrfork(
> rsvd ? XFS_TRANS_RESERVE : 0, &tp);
> if (error)
> return error;
> - xfs_defer_init(tp, &dfops, &firstblock);
> + xfs_defer_init(tp, &dfops, &tp->t_firstblock);
>
> xfs_ilock(ip, XFS_ILOCK_EXCL);
> error = xfs_trans_reserve_quota_nblks(tp, ip, blks, 0, rsvd ?
> @@ -1100,16 +1096,13 @@ xfs_bmap_add_attrfork(
> logflags = 0;
> switch (ip->i_d.di_format) {
> case XFS_DINODE_FMT_LOCAL:
> - error = xfs_bmap_add_attrfork_local(tp, ip, &firstblock,
> - &logflags);
> + error = xfs_bmap_add_attrfork_local(tp, ip, &logflags);
> break;
> case XFS_DINODE_FMT_EXTENTS:
> - error = xfs_bmap_add_attrfork_extents(tp, ip, &firstblock,
> - &logflags);
> + error = xfs_bmap_add_attrfork_extents(tp, ip, &logflags);
> break;
> case XFS_DINODE_FMT_BTREE:
> - error = xfs_bmap_add_attrfork_btree(tp, ip, &firstblock,
> - &logflags);
> + error = xfs_bmap_add_attrfork_btree(tp, ip, &logflags);
> break;
> default:
> error = 0;
> --
> 2.17.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-07-04 0:44 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-03 17:22 [PATCH 00/25] xfs: embed firstblock in xfs_trans Brian Foster
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 [this message]
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=20180704004350.GE32415@magnolia \
--to=darrick.wong@oracle.com \
--cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.