From: Allison Collins <allison.henderson@oracle.com>
To: Eric Sandeen <sandeen@sandeen.net>,
Eric Sandeen <sandeen@redhat.com>,
linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH 3/3] xfsprogs: remove unused flags arg from getsb interfaces
Date: Fri, 17 May 2019 14:09:36 -0700 [thread overview]
Message-ID: <cb1ff021-c170-1c4b-a94a-5e8ca84f281a@oracle.com> (raw)
In-Reply-To: <9807c398-8bfe-367f-3f45-0ff3d5ad84f9@sandeen.net>
On 5/16/19 10:46 AM, Eric Sandeen wrote:
> The flags value is always* passed as 0 so remove the argument.
>
> *mkfs.xfs is the sole exception; it passes a flag to fail on read
> error, but we can easily detect the error and exit from main()
> manually instead.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Looks ok to me.
Reviewed-by: Allison Collins <allison.henderson@oracle.com>
> ---
>
> (This one might actually come in via a libxfs merge instead)
>
> diff --git a/include/xfs_trans.h b/include/xfs_trans.h
> index d32acc9e..953da5d1 100644
> --- a/include/xfs_trans.h
> +++ b/include/xfs_trans.h
> @@ -87,7 +87,7 @@ void xfs_trans_cancel(struct xfs_trans *);
> /* cancel dfops associated with a transaction */
> void xfs_defer_cancel(struct xfs_trans *);
>
> -struct xfs_buf *xfs_trans_getsb(struct xfs_trans *, struct xfs_mount *, int);
> +struct xfs_buf *xfs_trans_getsb(struct xfs_trans *, struct xfs_mount *);
>
> void xfs_trans_ijoin(struct xfs_trans *, struct xfs_inode *, uint);
> void xfs_trans_log_inode (struct xfs_trans *, struct xfs_inode *,
> diff --git a/libxfs/libxfs_io.h b/libxfs/libxfs_io.h
> index 8fa2c2c5..4dc4d5f3 100644
> --- a/libxfs/libxfs_io.h
> +++ b/libxfs/libxfs_io.h
> @@ -177,7 +177,7 @@ extern void libxfs_putbuf (xfs_buf_t *);
>
> extern void libxfs_readbuf_verify(struct xfs_buf *bp,
> const struct xfs_buf_ops *ops);
> -extern xfs_buf_t *xfs_getsb(struct xfs_mount *, int);
> +extern xfs_buf_t *xfs_getsb(struct xfs_mount *);
> extern void libxfs_bcache_purge(void);
> extern void libxfs_bcache_free(void);
> extern void libxfs_bcache_flush(void);
> diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
> index 8d6f958a..132ed0a9 100644
> --- a/libxfs/rdwr.c
> +++ b/libxfs/rdwr.c
> @@ -476,10 +476,10 @@ libxfs_trace_putbuf(const char *func, const char *file, int line, xfs_buf_t *bp)
>
>
> xfs_buf_t *
> -xfs_getsb(xfs_mount_t *mp, int flags)
> +xfs_getsb(xfs_mount_t *mp)
> {
> return libxfs_readbuf(mp->m_ddev_targp, XFS_SB_DADDR,
> - XFS_FSS_TO_BB(mp, 1), flags, &xfs_sb_buf_ops);
> + XFS_FSS_TO_BB(mp, 1), 0, &xfs_sb_buf_ops);
> }
>
> kmem_zone_t *xfs_buf_zone;
> diff --git a/libxfs/trans.c b/libxfs/trans.c
> index 5ef0c055..9e49def0 100644
> --- a/libxfs/trans.c
> +++ b/libxfs/trans.c
> @@ -628,8 +628,7 @@ xfs_trans_get_buf_map(
> xfs_buf_t *
> xfs_trans_getsb(
> xfs_trans_t *tp,
> - xfs_mount_t *mp,
> - int flags)
> + xfs_mount_t *mp)
> {
> xfs_buf_t *bp;
> xfs_buf_log_item_t *bip;
> @@ -637,7 +636,7 @@ xfs_trans_getsb(
> DEFINE_SINGLE_BUF_MAP(map, XFS_SB_DADDR, len);
>
> if (tp == NULL)
> - return xfs_getsb(mp, flags);
> + return xfs_getsb(mp);
>
> bp = xfs_trans_buf_item_match(tp, mp->m_dev, &map, 1);
> if (bp != NULL) {
> @@ -648,7 +647,7 @@ xfs_trans_getsb(
> return bp;
> }
>
> - bp = xfs_getsb(mp, flags);
> + bp = xfs_getsb(mp);
> #ifdef XACT_DEBUG
> fprintf(stderr, "trans_get_sb buffer %p, transaction %p\n", bp, tp);
> #endif
> diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c
> index f1e2ba57..a1857e10 100644
> --- a/libxfs/xfs_sb.c
> +++ b/libxfs/xfs_sb.c
> @@ -915,7 +915,7 @@ xfs_log_sb(
> struct xfs_trans *tp)
> {
> struct xfs_mount *mp = tp->t_mountp;
> - struct xfs_buf *bp = xfs_trans_getsb(tp, mp, 0);
> + struct xfs_buf *bp = xfs_trans_getsb(tp, mp);
>
> mp->m_sb.sb_icount = percpu_counter_sum(&mp->m_icount);
> mp->m_sb.sb_ifree = percpu_counter_sum(&mp->m_ifree);
> @@ -1045,7 +1045,7 @@ xfs_sync_sb_buf(
> if (error)
> return error;
>
> - bp = xfs_trans_getsb(tp, mp, 0);
> + bp = xfs_trans_getsb(tp, mp);
> xfs_log_sb(tp);
> xfs_trans_bhold(tp, bp);
> xfs_trans_set_sync(tp);
> diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> index 09106648..647e2bc2 100644
> --- a/mkfs/xfs_mkfs.c
> +++ b/mkfs/xfs_mkfs.c
> @@ -4123,7 +4123,11 @@ main(
> /*
> * Mark the filesystem ok.
> */
> - buf = libxfs_getsb(mp, LIBXFS_EXIT_ON_FAILURE);
> + buf = libxfs_getsb(mp);
> + if (!buf) {
> + fprintf(stderr, _("couldn't get superblock\n"));
> + exit(1);
> + }
> (XFS_BUF_TO_SBP(buf))->sb_inprogress = 0;
> libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
>
> diff --git a/repair/phase5.c b/repair/phase5.c
> index 0f6a8395..8ad32365 100644
> --- a/repair/phase5.c
> +++ b/repair/phase5.c
> @@ -2177,7 +2177,7 @@ sync_sb(xfs_mount_t *mp)
> {
> xfs_buf_t *bp;
>
> - bp = libxfs_getsb(mp, 0);
> + bp = libxfs_getsb(mp);
> if (!bp)
> do_error(_("couldn't get superblock\n"));
>
> diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c
> index 9657503f..4000b3e6 100644
> --- a/repair/xfs_repair.c
> +++ b/repair/xfs_repair.c
> @@ -1044,7 +1044,7 @@ _("Warning: project quota information would be cleared.\n"
> /*
> * Clear the quota flags if they're on.
> */
> - sbp = libxfs_getsb(mp, 0);
> + sbp = libxfs_getsb(mp);
> if (!sbp)
> do_error(_("couldn't get superblock\n"));
>
>
next prev parent reply other threads:[~2019-05-17 21:12 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-16 17:42 [PATCH 0/3] xfsprogs: more libxfs/ spring cleaning Eric Sandeen
2019-05-16 17:43 ` [PATCH 1/3] libxfs: rename shared kernel functions from libxfs_ to xfs_ Eric Sandeen
2019-05-17 20:49 ` Allison Collins
2019-05-17 21:00 ` Eric Sandeen
2019-05-16 17:45 ` [PATCH 2/3] libxfs: remove libxfs API #defines for unexported xfs functions Eric Sandeen
2019-05-17 21:06 ` Allison Collins
2019-05-16 17:46 ` [PATCH 3/3] xfsprogs: remove unused flags arg from getsb interfaces Eric Sandeen
2019-05-17 21:09 ` Allison Collins [this message]
2019-05-16 20:38 ` [PATCH 4/3] libxfs: Remove XACT_DEBUG #ifdefs Eric Sandeen
2019-05-17 21:36 ` Allison Collins
2019-05-20 22:53 ` Darrick J. Wong
2019-05-16 20:39 ` [PATCH 5/3] libxfs: rename bli_format to avoid confusion with bli_formats Eric Sandeen
2019-05-17 22:29 ` Allison Collins
2019-05-17 23:01 ` Eric Sandeen
2019-05-17 23:41 ` Allison Collins
2019-05-16 20:39 ` [PATCH 6/3] libxfs: factor common xfs_trans_bjoin code Eric Sandeen
2019-05-17 22:56 ` Allison Collins
2019-05-20 22:56 ` Darrick J. Wong
2019-05-20 22:58 ` Eric Sandeen
2019-05-20 23:12 ` Darrick J. Wong
2019-05-16 20:40 ` [PATCH 7/3] libxfs: fix argument to xfs_trans_add_item Eric Sandeen
2019-05-17 22:57 ` Allison Collins
2019-05-16 20:41 ` [PATCH 8/3] xfs: factor log item initialisation Eric Sandeen
2019-05-17 23:50 ` Allison Collins
2019-05-17 19:46 ` [PATCH 9/3] libxfs: create current_time helper and sync xfs_trans_ichgtime Eric Sandeen
2019-05-17 19:50 ` [PATCH 10/3] libxfs: share kernel's xfs_trans_inode.c Eric Sandeen
2019-05-20 23:00 ` Darrick J. Wong
2019-05-20 23:03 ` [PATCH 0/3] xfsprogs: more libxfs/ spring cleaning Darrick J. Wong
2019-05-20 23:10 ` Darrick J. Wong
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=cb1ff021-c170-1c4b-a94a-5e8ca84f281a@oracle.com \
--to=allison.henderson@oracle.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=sandeen@sandeen.net \
/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