From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH 4/6] xfs: remove XBF_WRITE flag wrapper macros
Date: Fri, 5 Feb 2016 11:38:01 +1100 [thread overview]
Message-ID: <1454632683-20543-5-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1454632683-20543-1-git-send-email-david@fromorbit.com>
From: Dave Chinner <dchinner@redhat.com>
They only set/clear/check a flag, no need for obfuscating this
with a macro.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
fs/xfs/xfs_buf.h | 4 ----
fs/xfs/xfs_log.c | 8 +++-----
fs/xfs/xfs_log_recover.c | 2 +-
3 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h
index 329e612..a118962 100644
--- a/fs/xfs/xfs_buf.h
+++ b/fs/xfs/xfs_buf.h
@@ -321,10 +321,6 @@ void xfs_buf_stale(struct xfs_buf *bp);
#define XFS_BUF_UNSTALE(bp) ((bp)->b_flags &= ~XBF_STALE)
#define XFS_BUF_ISSTALE(bp) ((bp)->b_flags & XBF_STALE)
-#define XFS_BUF_WRITE(bp) ((bp)->b_flags |= XBF_WRITE)
-#define XFS_BUF_UNWRITE(bp) ((bp)->b_flags &= ~XBF_WRITE)
-#define XFS_BUF_ISWRITE(bp) ((bp)->b_flags & XBF_WRITE)
-
/*
* These macros use the IO block map rather than b_bn. b_bn is now really
* just for the buffer cache index for cached buffers. As IO does not use b_bn
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 19db3da..edf20b2 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -1865,7 +1865,7 @@ xlog_sync(
bp->b_io_length = BTOBB(count);
bp->b_fspriv = iclog;
XFS_BUF_ZEROFLAGS(bp);
- bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO);
+ bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE);
if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) {
bp->b_flags |= XBF_FUA;
@@ -1892,12 +1892,11 @@ xlog_sync(
/* account for log which doesn't start at block #0 */
XFS_BUF_SET_ADDR(bp, XFS_BUF_ADDR(bp) + log->l_logBBstart);
+
/*
* Don't call xfs_bwrite here. We do log-syncs even when the filesystem
* is shutting down.
*/
- XFS_BUF_WRITE(bp);
-
error = xlog_bdstrat(bp);
if (error) {
xfs_buf_ioerror_alert(bp, "xlog_sync");
@@ -1910,7 +1909,7 @@ xlog_sync(
(char *)&iclog->ic_header + count, split);
bp->b_fspriv = iclog;
XFS_BUF_ZEROFLAGS(bp);
- bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO);
+ bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE);
if (log->l_mp->m_flags & XFS_MOUNT_BARRIER)
bp->b_flags |= XBF_FUA;
@@ -1919,7 +1918,6 @@ xlog_sync(
/* account for internal log which doesn't start at block #0 */
XFS_BUF_SET_ADDR(bp, XFS_BUF_ADDR(bp) + log->l_logBBstart);
- XFS_BUF_WRITE(bp);
error = xlog_bdstrat(bp);
if (error) {
xfs_buf_ioerror_alert(bp, "xlog_sync (split)");
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 81c525a..68406fd 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -4927,7 +4927,7 @@ xlog_do_recover(
*/
bp = xfs_getsb(log->l_mp, 0);
bp->b_flags &= ~(XBF_DONE | XBF_ASYNC);
- ASSERT(!(XFS_BUF_ISWRITE(bp)));
+ ASSERT(!(bp->b_flags & XBF_WRITE));
bp->b_flags |= XBF_READ;
bp->b_ops = &xfs_sb_buf_ops;
--
2.5.0
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2016-02-05 0:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-05 0:37 [PATCH 0/6] xfs: clean up buffer flag macros Dave Chinner
2016-02-05 0:37 ` [PATCH 1/6] xfs: remove XBF_DONE flag wrapper macros Dave Chinner
2016-02-08 9:04 ` Christoph Hellwig
2016-02-05 0:37 ` [PATCH 2/6] xfs: remove XBF_ASYNC " Dave Chinner
2016-02-08 9:05 ` Christoph Hellwig
2016-02-05 0:38 ` [PATCH 3/6] xfs: remove XBF_READ " Dave Chinner
2016-02-08 9:05 ` Christoph Hellwig
2016-02-05 0:38 ` Dave Chinner [this message]
2016-02-08 9:06 ` [PATCH 4/6] xfs: remove XBF_WRITE " Christoph Hellwig
2016-02-05 0:38 ` [PATCH 5/6] xfs: remove XBF_STALE " Dave Chinner
2016-02-08 9:07 ` Christoph Hellwig
2016-02-05 0:38 ` [PATCH 6/6] xfs: rename XFS_BUF_ZEROFLAGS macro Dave Chinner
2016-02-08 9:12 ` Christoph Hellwig
2016-02-08 22:31 ` Dave Chinner
2016-02-08 22:59 ` [PATCH 6/6 v2] " Dave Chinner
2016-02-09 9:16 ` [PATCH 6/6] " Christoph Hellwig
2016-02-09 21:23 ` Dave Chinner
2016-02-09 21:38 ` [PATCH 6/6 v3] xfs: remove " Dave Chinner
2016-02-09 21:49 ` 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=1454632683-20543-5-git-send-email-david@fromorbit.com \
--to=david@fromorbit.com \
--cc=xfs@oss.sgi.com \
/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