All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: sandeen@sandeen.net, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: [PATCH 07/26] libxfs: rename libxfs_writebufr to libxfs_bwrite
Date: Fri, 28 Feb 2020 15:37:00 -0800	[thread overview]
Message-ID: <158293302026.1549542.11606082894335329556.stgit@magnolia> (raw)
In-Reply-To: <158293297395.1549542.18143701542461010748.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

Rename this function so that we have an API that matches the kernel
without a #define.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 db/io.c                  |    4 ++--
 libxfs/libxfs_api_defs.h |    1 +
 libxfs/libxfs_io.h       |    2 +-
 libxfs/libxfs_priv.h     |    1 -
 libxfs/rdwr.c            |   11 ++++++-----
 5 files changed, 10 insertions(+), 9 deletions(-)


diff --git a/db/io.c b/db/io.c
index 163ccc89..7c7a4624 100644
--- a/db/io.c
+++ b/db/io.c
@@ -426,7 +426,7 @@ write_cur_buf(void)
 {
 	int ret;
 
-	ret = -libxfs_writebufr(iocur_top->bp);
+	ret = -libxfs_bwrite(iocur_top->bp);
 	if (ret != 0)
 		dbprintf(_("write error: %s\n"), strerror(ret));
 
@@ -442,7 +442,7 @@ write_cur_bbs(void)
 {
 	int ret;
 
-	ret = -libxfs_writebufr(iocur_top->bp);
+	ret = -libxfs_bwrite(iocur_top->bp);
 	if (ret != 0)
 		dbprintf(_("write error: %s\n"), strerror(ret));
 
diff --git a/libxfs/libxfs_api_defs.h b/libxfs/libxfs_api_defs.h
index 57cf5f83..df267c98 100644
--- a/libxfs/libxfs_api_defs.h
+++ b/libxfs/libxfs_api_defs.h
@@ -48,6 +48,7 @@
 #define xfs_buf_read			libxfs_buf_read
 #define xfs_buf_relse			libxfs_buf_relse
 #define xfs_bunmapi			libxfs_bunmapi
+#define xfs_bwrite			libxfs_bwrite
 #define xfs_calc_dquots_per_chunk	libxfs_calc_dquots_per_chunk
 #define xfs_da3_node_hdr_from_disk	libxfs_da3_node_hdr_from_disk
 #define xfs_da_get_buf			libxfs_da_get_buf
diff --git a/libxfs/libxfs_io.h b/libxfs/libxfs_io.h
index 1b8318af..0370d685 100644
--- a/libxfs/libxfs_io.h
+++ b/libxfs/libxfs_io.h
@@ -220,7 +220,7 @@ extern xfs_buf_t *libxfs_getbufr(struct xfs_buftarg *, xfs_daddr_t, int);
 extern void	libxfs_putbufr(xfs_buf_t *);
 
 extern int	libxfs_writebuf_int(xfs_buf_t *, int);
-extern int	libxfs_writebufr(struct xfs_buf *);
+int		libxfs_bwrite(struct xfs_buf *bp);
 extern int	libxfs_readbufr(struct xfs_buftarg *, xfs_daddr_t, xfs_buf_t *, int, int);
 extern int	libxfs_readbufr_map(struct xfs_buftarg *, struct xfs_buf *, int);
 
diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
index 0f26120f..5d6dd063 100644
--- a/libxfs/libxfs_priv.h
+++ b/libxfs/libxfs_priv.h
@@ -377,7 +377,6 @@ roundup_64(uint64_t x, uint32_t y)
 	(len) = __bar; /* no set-but-unused warning */	\
 	NULL;						\
 })
-#define xfs_bwrite(bp)			libxfs_writebuf((bp), 0)
 #define xfs_buf_oneshot(bp)		((void) 0)
 
 #define XBRW_READ			LIBXFS_BREAD
diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
index 7b91ebf6..bbec1135 100644
--- a/libxfs/rdwr.c
+++ b/libxfs/rdwr.c
@@ -1090,9 +1090,10 @@ __write_buf(int fd, void *buf, int len, off64_t offset, int flags)
 }
 
 int
-libxfs_writebufr(xfs_buf_t *bp)
+libxfs_bwrite(
+	struct xfs_buf	*bp)
 {
-	int	fd = libxfs_device_to_fd(bp->b_target->dev);
+	int		fd = libxfs_device_to_fd(bp->b_target->dev);
 
 	/*
 	 * we never write buffers that are marked stale. This indicates they
@@ -1301,7 +1302,7 @@ libxfs_bflush(
 	struct xfs_buf		*bp = (struct xfs_buf *)node;
 
 	if (!bp->b_error && bp->b_flags & LIBXFS_B_DIRTY)
-		return libxfs_writebufr(bp);
+		return libxfs_bwrite(bp);
 	return bp->b_error;
 }
 
@@ -1309,7 +1310,7 @@ void
 libxfs_putbufr(xfs_buf_t *bp)
 {
 	if (bp->b_flags & LIBXFS_B_DIRTY)
-		libxfs_writebufr(bp);
+		libxfs_bwrite(bp);
 	libxfs_brelse((struct cache_node *)bp);
 }
 
@@ -1522,7 +1523,7 @@ xfs_buf_delwri_submit(
 
 	list_for_each_entry_safe(bp, n, buffer_list, b_list) {
 		list_del_init(&bp->b_list);
-		error2 = libxfs_writebufr(bp);
+		error2 = libxfs_bwrite(bp);
 		if (!error)
 			error = error2;
 		libxfs_buf_relse(bp);


  parent reply	other threads:[~2020-02-28 23:39 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28 23:36 [PATCH v3 00/26] xfsprogs: refactor buffer function names Darrick J. Wong
2020-02-28 23:36 ` [PATCH 01/26] libxfs: open-code "exit on buffer read failure" in upper level callers Darrick J. Wong
2020-02-28 23:36 ` [PATCH 02/26] libxfs: remove LIBXFS_EXIT_ON_FAILURE Darrick J. Wong
2020-02-28 23:36 ` [PATCH 03/26] libxfs: remove LIBXFS_B_EXIT Darrick J. Wong
2020-02-28 23:36 ` [PATCH 04/26] libxfs: replace libxfs_putbuf with libxfs_buf_relse Darrick J. Wong
2020-02-28 23:36 ` [PATCH 05/26] libxfs: replace libxfs_getbuf with libxfs_buf_get Darrick J. Wong
2020-02-28 23:36 ` [PATCH 06/26] libxfs: replace libxfs_readbuf with libxfs_buf_read Darrick J. Wong
2020-02-28 23:37 ` Darrick J. Wong [this message]
2020-02-28 23:37 ` [PATCH 08/26] libxfs: make libxfs_readbuf_verify return an error code Darrick J. Wong
2020-02-28 23:37 ` [PATCH 09/26] libxfs: make libxfs_readbufr stash the error value in b_error Darrick J. Wong
2020-02-28 23:37 ` [PATCH 10/26] libxfs: introduce libxfs_buf_read_uncached Darrick J. Wong
2020-02-28 23:37 ` [PATCH 11/26] xfs_db: use uncached buffer reads to get the superblock Darrick J. Wong
2020-02-28 23:37 ` [PATCH 12/26] xfs_copy: " Darrick J. Wong
2020-02-28 23:37 ` [PATCH 13/26] libxfs: move log functions for convenience Darrick J. Wong
2020-02-29 22:35   ` Eric Sandeen
2020-02-28 23:37 ` [PATCH 14/26] libxfs: convert libxfs_log_clear to use uncached buffers Darrick J. Wong
2020-02-29 22:45   ` Eric Sandeen
2020-02-28 23:37 ` [PATCH 15/26] libxlog: use uncached buffers instead of open-coding them Darrick J. Wong
2020-02-28 23:38 ` [PATCH 16/26] libxfs: use uncached buffers for initial mkfs writes Darrick J. Wong
2020-02-28 23:38 ` [PATCH 17/26] libxfs: straighten out libxfs_writebuf naming confusion Darrick J. Wong
2020-02-28 23:38 ` [PATCH 18/26] libxfs: remove unused flags parameter to libxfs_buf_mark_dirty Darrick J. Wong
2020-02-28 23:38 ` [PATCH 19/26] libxfs: remove libxfs_writebuf_int Darrick J. Wong
2020-02-28 23:38 ` [PATCH 20/26] libxfs: remove dangerous casting between xfs_buf and cache_node Darrick J. Wong
2020-02-28 23:38 ` [PATCH 21/26] libxfs: remove dangerous casting between cache_node and xfs_buf Darrick J. Wong
2020-02-28 23:38 ` [PATCH 22/26] libxfs: remove the libxfs_{get,put}bufr APIs Darrick J. Wong
2020-02-28 23:38 ` [PATCH 23/26] libxfs: hide libxfs_getbuf_flags Darrick J. Wong
2020-02-28 23:38 ` [PATCH 24/26] libxfs: rename libxfs_readbuf_map to libxfs_buf_read_map Darrick J. Wong
2020-02-28 23:38 ` [PATCH 25/26] libxfs: rename libxfs_getbuf_map to libxfs_buf_get_map Darrick J. Wong
2020-02-28 23:39 ` [PATCH 26/26] libxfs: convert buffer priority get/set macros to functions Darrick J. Wong
2020-02-29 22:52   ` Eric Sandeen

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=158293302026.1549542.11606082894335329556.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    --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 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.