]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: don't use enum for buffer flags
authorEric Sandeen <sandeen@redhat.com>
Wed, 24 Jul 2019 21:28:26 +0000 (17:28 -0400)
committerEric Sandeen <sandeen@redhat.com>
Wed, 24 Jul 2019 21:28:26 +0000 (17:28 -0400)
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>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
include/xfs_trans.h
libxfs/libxfs_io.h
libxfs/trans.c

index e0046b51aee9c880ea920eff417ea52660017bac..bcf931b77b0bae38a8002a7699e747aef767632a 100644 (file)
@@ -108,12 +108,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(
@@ -134,7 +134,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)
 {
index 79ffd4703baf0e8d7132a322832f9e79010bb69d..173d496d46e3df17ea5cc08b5938a4d2c31385bc 100644 (file)
@@ -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))
 
index f6f7d89ff68622e2afa45fc300796a49fc6aa57f..caeb9103c06666768ac01a897f9779f628c23fe8 100644 (file)
@@ -422,7 +422,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;
@@ -498,7 +498,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)
 {