]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: add a flags field to libxfs_getbuf_map
authorDave Chinner <dchinner@redhat.com>
Mon, 3 Feb 2014 00:10:17 +0000 (11:10 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 3 Feb 2014 00:10:17 +0000 (11:10 +1100)
It will be needed to make the repair prefetch code aware of compound
buffers.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
include/libxfs.h
libxfs/rdwr.c
libxfs/trans.c

index 4bf331c4c1d75cd94425735957cb80d3e79ec6ff..287241032104af29edcda5a5a25d6f4fb28d47b2 100644 (file)
@@ -392,9 +392,9 @@ extern struct cache_operations      libxfs_bcache_operations;
 #define libxfs_getbuf(dev, daddr, len) \
        libxfs_trace_getbuf(__FUNCTION__, __FILE__, __LINE__, \
                            (dev), (daddr), (len))
-#define libxfs_getbuf_map(dev, map, nmaps) \
+#define libxfs_getbuf_map(dev, map, nmaps, flags) \
        libxfs_trace_getbuf_map(__FUNCTION__, __FILE__, __LINE__, \
-                           (dev), (map), (nmaps))
+                           (dev), (map), (nmaps), (flags))
 #define libxfs_getbuf_flags(dev, daddr, len, flags) \
        libxfs_trace_getbuf_flags(__FUNCTION__, __FILE__, __LINE__, \
                            (dev), (daddr), (len), (flags))
@@ -412,7 +412,7 @@ extern int  libxfs_trace_writebuf(const char *, const char *, int,
 extern xfs_buf_t *libxfs_trace_getbuf(const char *, const char *, int,
                        struct xfs_buftarg *, xfs_daddr_t, int);
 extern xfs_buf_t *libxfs_trace_getbuf_map(const char *, const char *, int,
-                       struct xfs_buftarg *, struct xfs_buf_map *, int);
+                       struct xfs_buftarg *, struct xfs_buf_map *, int, int);
 extern xfs_buf_t *libxfs_trace_getbuf_flags(const char *, const char *, int,
                        struct xfs_buftarg *, xfs_daddr_t, int, unsigned int);
 extern void    libxfs_trace_putbuf (const char *, const char *, int,
@@ -427,7 +427,7 @@ extern xfs_buf_t *libxfs_readbuf_map(struct xfs_buftarg *, struct xfs_buf_map *,
 extern int     libxfs_writebuf(xfs_buf_t *, int);
 extern xfs_buf_t *libxfs_getbuf(struct xfs_buftarg *, xfs_daddr_t, int);
 extern xfs_buf_t *libxfs_getbuf_map(struct xfs_buftarg *,
-                       struct xfs_buf_map *, int);
+                       struct xfs_buf_map *, int, int);
 extern xfs_buf_t *libxfs_getbuf_flags(struct xfs_buftarg *, xfs_daddr_t,
                        int, unsigned int);
 extern void    libxfs_putbuf (xfs_buf_t *);
index 0219a08bc1dd38e44157cac1a9a90fbcf90557c0..bf92788df20bebeda698f37fd29d1b707143b360 100644 (file)
@@ -203,7 +203,8 @@ xfs_buf_t   *libxfs_readbuf_map(struct xfs_buftarg *, struct xfs_buf_map *,
                                int, int, const struct xfs_buf_ops *);
 int            libxfs_writebuf(xfs_buf_t *, int);
 xfs_buf_t      *libxfs_getbuf(struct xfs_buftarg *, xfs_daddr_t, int);
-xfs_buf_t      *libxfs_getbuf_map(struct xfs_buftarg *, struct xfs_buf_map *, int);
+xfs_buf_t      *libxfs_getbuf_map(struct xfs_buftarg *, struct xfs_buf_map *,
+                               int, int);
 xfs_buf_t      *libxfs_getbuf_flags(struct xfs_buftarg *, xfs_daddr_t, int,
                                unsigned int);
 void           libxfs_putbuf (xfs_buf_t *);
@@ -255,9 +256,10 @@ libxfs_trace_getbuf(const char *func, const char *file, int line,
 
 xfs_buf_t *
 libxfs_trace_getbuf_map(const char *func, const char *file, int line,
-               struct xfs_buftarg *btp, struct xfs_buf_map *map, int nmaps)
+               struct xfs_buftarg *btp, struct xfs_buf_map *map, int nmaps,
+               int flags)
 {
-       xfs_buf_t       *bp = libxfs_getbuf_map(btp, map, nmaps);
+       xfs_buf_t       *bp = libxfs_getbuf_map(btp, map, nmaps, flags);
        __add_trace(bp, func, file, line);
        return bp;
 }
@@ -582,7 +584,8 @@ libxfs_getbuf(struct xfs_buftarg *btp, xfs_daddr_t blkno, int len)
 }
 
 struct xfs_buf *
-libxfs_getbuf_map(struct xfs_buftarg *btp, struct xfs_buf_map *map, int nmaps)
+libxfs_getbuf_map(struct xfs_buftarg *btp, struct xfs_buf_map *map,
+                 int nmaps, int flags)
 {
        struct xfs_bufkey key = {0};
        int i;
@@ -595,7 +598,7 @@ libxfs_getbuf_map(struct xfs_buftarg *btp, struct xfs_buf_map *map, int nmaps)
        key.map = map;
        key.nmaps = nmaps;
 
-       return __cache_lookup(&key, 0);
+       return __cache_lookup(&key, flags);
 }
 
 void
@@ -775,7 +778,7 @@ libxfs_readbuf_map(struct xfs_buftarg *btp, struct xfs_buf_map *map, int nmaps,
                return libxfs_readbuf(btp, map[0].bm_bn, map[0].bm_len,
                                        flags, ops);
 
-       bp = libxfs_getbuf_map(btp, map, nmaps);
+       bp = libxfs_getbuf_map(btp, map, nmaps, 0);
        if (!bp)
                return NULL;
 
index 6a0567342b76b10907c0df488333e3afa4a52e7d..6c9d202b75429b37d9ca4e77380efcfff25a00b8 100644 (file)
@@ -511,7 +511,7 @@ libxfs_trans_get_buf_map(
        xfs_buf_log_item_t      *bip;
 
        if (tp == NULL)
-               return libxfs_getbuf_map(btp, map, nmaps);
+               return libxfs_getbuf_map(btp, map, nmaps, 0);
 
        bp = xfs_trans_buf_item_match(tp, btp, map, nmaps);
        if (bp != NULL) {
@@ -522,7 +522,7 @@ libxfs_trans_get_buf_map(
                return bp;
        }
 
-       bp = libxfs_getbuf_map(btp, map, nmaps);
+       bp = libxfs_getbuf_map(btp, map, nmaps, 0);
        if (bp == NULL)
                return NULL;
 #ifdef XACT_DEBUG