From 67457eb0d225521a0e81327aef808cd0f9075880 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Fri, 4 Dec 2020 13:20:00 -0800 Subject: xfs: refactor data device extent validation Refactor all the open-coded validation of non-static data device extents into a single helper. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Brian Foster --- fs/xfs/xfs_refcount_item.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'fs/xfs/xfs_refcount_item.c') diff --git a/fs/xfs/xfs_refcount_item.c b/fs/xfs/xfs_refcount_item.c index 937d482c9be4..07ebccbbf4df 100644 --- a/fs/xfs/xfs_refcount_item.c +++ b/fs/xfs/xfs_refcount_item.c @@ -439,16 +439,7 @@ xfs_cui_validate_phys( return false; } - if (refc->pe_startblock + refc->pe_len <= refc->pe_startblock) - return false; - - if (!xfs_verify_fsbno(mp, refc->pe_startblock)) - return false; - - if (!xfs_verify_fsbno(mp, refc->pe_startblock + refc->pe_len - 1)) - return false; - - return true; + return xfs_verify_fsbext(mp, refc->pe_startblock, refc->pe_len); } /* -- cgit v1.2.3