Since xfs_buf_get_maps() now always returns 0, we can change its return type to void, so callers no longer need to check for errors. Signed-off-by: Julian Sun <sunjunchao2870@xxxxxxxxx> --- fs/xfs/xfs_buf.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 4b53dde32689..adb9a84b86fc 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -167,7 +167,7 @@ xfs_buf_stale( spin_unlock(&bp->b_lock); } -static int +static void xfs_buf_get_maps( struct xfs_buf *bp, int map_count) @@ -177,12 +177,11 @@ xfs_buf_get_maps( if (map_count == 1) { bp->b_maps = &bp->__b_map; - return 0; + return; } bp->b_maps = kzalloc(map_count * sizeof(struct xfs_buf_map), GFP_KERNEL | __GFP_NOLOCKDEP | __GFP_NOFAIL); - return 0; } static void @@ -236,11 +235,7 @@ _xfs_buf_alloc( bp->b_mount = target->bt_mount; bp->b_flags = flags; - error = xfs_buf_get_maps(bp, nmaps); - if (error) { - kmem_cache_free(xfs_buf_cache, bp); - return error; - } + xfs_buf_get_maps(bp, nmaps); bp->b_rhash_key = map[0].bm_bn; bp->b_length = 0; -- 2.39.5