From: Eric Sandeen <sandeen@redhat.com>
To: linux-xfs <linux-xfs@vger.kernel.org>
Subject: [PATCH 4/4] xfsprogs: don't use enum for buffer flags
Date: Fri, 12 Jul 2019 16:46:59 -0500 [thread overview]
Message-ID: <9a4275dd-3e33-1fbb-efd4-57db6f646bff@redhat.com> (raw)
In-Reply-To: <a40115ca-93e2-6dd2-7940-5911988f8fe4@redhat.com>
This roughly mirrors
807cbbdb xfs: do not use emums for flags used in tracing
and lets us use the xfs_buf_flags_t type in function calls as is
done in the kernel.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/include/xfs_trans.h b/include/xfs_trans.h
index 60e1dbdb..926fe102 100644
--- a/include/xfs_trans.h
+++ b/include/xfs_trans.h
@@ -107,12 +107,12 @@ bool libxfs_trans_ordered_buf(xfs_trans_t *, struct xfs_buf *);
struct xfs_buf *libxfs_trans_get_buf_map(struct xfs_trans *tp,
struct xfs_buftarg *btp,
struct xfs_buf_map *map, int nmaps,
- uint flags);
+ xfs_buf_flags_t flags);
int libxfs_trans_read_buf_map(struct xfs_mount *mp, struct xfs_trans *tp,
struct xfs_buftarg *btp,
struct xfs_buf_map *map, int nmaps,
- uint flags, struct xfs_buf **bpp,
+ xfs_buf_flags_t flags, struct xfs_buf **bpp,
const struct xfs_buf_ops *ops);
static inline struct xfs_buf *
libxfs_trans_get_buf(
@@ -133,7 +133,7 @@ libxfs_trans_read_buf(
struct xfs_buftarg *btp,
xfs_daddr_t blkno,
int numblks,
- uint flags,
+ xfs_buf_flags_t flags,
struct xfs_buf **bpp,
const struct xfs_buf_ops *ops)
{
diff --git a/libxfs/libxfs_io.h b/libxfs/libxfs_io.h
index 79ffd470..e09dd849 100644
--- a/libxfs/libxfs_io.h
+++ b/libxfs/libxfs_io.h
@@ -81,14 +81,15 @@ typedef struct xfs_buf {
bool xfs_verify_magic(struct xfs_buf *bp, __be32 dmagic);
bool xfs_verify_magic16(struct xfs_buf *bp, __be16 dmagic);
-enum xfs_buf_flags_t { /* b_flags bits */
- LIBXFS_B_EXIT = 0x0001, /* ==LIBXFS_EXIT_ON_FAILURE */
- LIBXFS_B_DIRTY = 0x0002, /* buffer has been modified */
- LIBXFS_B_STALE = 0x0004, /* buffer marked as invalid */
- LIBXFS_B_UPTODATE = 0x0008, /* buffer is sync'd to disk */
- LIBXFS_B_DISCONTIG = 0x0010, /* discontiguous buffer */
- LIBXFS_B_UNCHECKED = 0x0020, /* needs verification */
-};
+/* b_flags bits */
+#define LIBXFS_B_EXIT 0x0001 /* ==LIBXFS_EXIT_ON_FAILURE */
+#define LIBXFS_B_DIRTY 0x0002 /* buffer has been modified */
+#define LIBXFS_B_STALE 0x0004 /* buffer marked as invalid */
+#define LIBXFS_B_UPTODATE 0x0008 /* buffer is sync'd to disk */
+#define LIBXFS_B_DISCONTIG 0x0010 /* discontiguous buffer */
+#define LIBXFS_B_UNCHECKED 0x0020 /* needs verification */
+
+typedef unsigned int xfs_buf_flags_t;
#define XFS_BUF_DADDR_NULL ((xfs_daddr_t) (-1LL))
diff --git a/libxfs/trans.c b/libxfs/trans.c
index 453e5476..faf36daa 100644
--- a/libxfs/trans.c
+++ b/libxfs/trans.c
@@ -404,7 +404,7 @@ libxfs_trans_get_buf_map(
struct xfs_buftarg *target,
struct xfs_buf_map *map,
int nmaps,
- uint flags)
+ xfs_buf_flags_t flags)
{
xfs_buf_t *bp;
struct xfs_buf_log_item *bip;
@@ -480,7 +480,7 @@ libxfs_trans_read_buf_map(
struct xfs_buftarg *target,
struct xfs_buf_map *map,
int nmaps,
- uint flags,
+ xfs_buf_flags_t flags,
struct xfs_buf **bpp,
const struct xfs_buf_ops *ops)
{
next prev parent reply other threads:[~2019-07-12 21:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-12 21:31 [PATCH 0/4] xfsprogs: inch libxfs/trans.c towards xfs_trans_buf.c Eric Sandeen
2019-07-12 21:34 ` [PATCH 1/4] xfsprogs: reorder functions in libxfs/trans.c Eric Sandeen
2019-07-16 11:30 ` Carlos Maiolino
2019-07-12 21:36 ` [PATCH 2/4] xfsprogs: cosmetic changes to libxfs/trans.c Eric Sandeen
2019-07-16 11:31 ` Carlos Maiolino
2019-07-12 21:38 ` [PATCH 3/4] xfsprogs: trivial " Eric Sandeen
2019-07-16 11:31 ` Carlos Maiolino
2019-07-12 21:46 ` Eric Sandeen [this message]
2019-07-16 11:38 ` [PATCH 4/4] xfsprogs: don't use enum for buffer flags Carlos Maiolino
2019-07-16 13:30 ` 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=9a4275dd-3e33-1fbb-efd4-57db6f646bff@redhat.com \
--to=sandeen@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.