diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2020-01-24 02:01:18 +0100 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-01-26 23:32:26 +0100 |
commit | 9676b54e6e28689af1b4247569f14466bdfc5390 (patch) | |
tree | d3990f7db1dd029a83465e86b531da8f36ad05cf /fs/xfs/xfs_trans.h | |
parent | xfs: make xfs_buf_read return an error code (diff) | |
download | linux-9676b54e6e28689af1b4247569f14466bdfc5390.tar.xz linux-9676b54e6e28689af1b4247569f14466bdfc5390.zip |
xfs: make xfs_trans_get_buf_map return an error code
Convert xfs_trans_get_buf_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_trans.h')
-rw-r--r-- | fs/xfs/xfs_trans.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h index 64d7f171ebd3..a0be934ec811 100644 --- a/fs/xfs/xfs_trans.h +++ b/fs/xfs/xfs_trans.h @@ -169,10 +169,9 @@ int xfs_trans_alloc_empty(struct xfs_mount *mp, struct xfs_trans **tpp); void xfs_trans_mod_sb(xfs_trans_t *, uint, int64_t); -struct xfs_buf *xfs_trans_get_buf_map(struct xfs_trans *tp, - struct xfs_buftarg *target, - struct xfs_buf_map *map, int nmaps, - uint flags); +int xfs_trans_get_buf_map(struct xfs_trans *tp, struct xfs_buftarg *target, + struct xfs_buf_map *map, int nmaps, xfs_buf_flags_t flags, + struct xfs_buf **bpp); static inline struct xfs_buf * xfs_trans_get_buf( @@ -182,8 +181,14 @@ xfs_trans_get_buf( int numblks, uint flags) { + struct xfs_buf *bp; + int error; + DEFINE_SINGLE_BUF_MAP(map, blkno, numblks); - return xfs_trans_get_buf_map(tp, target, &map, 1, flags); + error = xfs_trans_get_buf_map(tp, target, &map, 1, flags, &bp); + if (error) + return NULL; + return bp; } int xfs_trans_read_buf_map(struct xfs_mount *mp, |