summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_buf.h
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2020-01-24 02:01:15 +0100
committerDarrick J. Wong <darrick.wong@oracle.com>2020-01-26 23:32:25 +0100
commit3848b5f6709221b7ab52c9639baee50dc4b006bb (patch)
tree48c1fecf9dee9aa436060c9240ce9e6bfcfa6f71 /fs/xfs/xfs_buf.h
parentxfs: make xfs_buf_alloc return an error code (diff)
downloadlinux-3848b5f6709221b7ab52c9639baee50dc4b006bb.tar.xz
linux-3848b5f6709221b7ab52c9639baee50dc4b006bb.zip
xfs: make xfs_buf_get_map return an error code
Convert xfs_buf_get_map() to return numeric error codes like most everywhere else in xfs. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_buf.h')
-rw-r--r--fs/xfs/xfs_buf.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h
index 56e081dd1d96..25dd2aa4322b 100644
--- a/fs/xfs/xfs_buf.h
+++ b/fs/xfs/xfs_buf.h
@@ -192,9 +192,8 @@ struct xfs_buf *xfs_buf_incore(struct xfs_buftarg *target,
xfs_daddr_t blkno, size_t numblks,
xfs_buf_flags_t flags);
-struct xfs_buf *xfs_buf_get_map(struct xfs_buftarg *target,
- struct xfs_buf_map *map, int nmaps,
- xfs_buf_flags_t flags);
+int xfs_buf_get_map(struct xfs_buftarg *target, struct xfs_buf_map *map,
+ int nmaps, xfs_buf_flags_t flags, struct xfs_buf **bpp);
struct xfs_buf *xfs_buf_read_map(struct xfs_buftarg *target,
struct xfs_buf_map *map, int nmaps,
xfs_buf_flags_t flags,
@@ -209,8 +208,14 @@ xfs_buf_get(
xfs_daddr_t blkno,
size_t numblks)
{
+ struct xfs_buf *bp;
+ int error;
DEFINE_SINGLE_BUF_MAP(map, blkno, numblks);
- return xfs_buf_get_map(target, &map, 1, 0);
+
+ error = xfs_buf_get_map(target, &map, 1, 0, &bp);
+ if (error)
+ return NULL;
+ return bp;
}
static inline struct xfs_buf *