diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2020-12-05 00:20:00 +0300 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-12-09 20:49:38 +0300 |
commit | 67457eb0d225521a0e81327aef808cd0f9075880 (patch) | |
tree | 6f580386f59abce8f6dbac4de467365f8256308f /fs/xfs/xfs_rmap_item.c | |
parent | 4b80ac64450f169bae364df631d233d66070a06e (diff) | |
download | linux-67457eb0d225521a0e81327aef808cd0f9075880.tar.xz |
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 <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_rmap_item.c')
-rw-r--r-- | fs/xfs/xfs_rmap_item.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/fs/xfs/xfs_rmap_item.c b/fs/xfs/xfs_rmap_item.c index 9b84017184d9..4fa875237422 100644 --- a/fs/xfs/xfs_rmap_item.c +++ b/fs/xfs/xfs_rmap_item.c @@ -493,16 +493,7 @@ xfs_rui_validate_map( if (rmap->me_startoff + rmap->me_len <= rmap->me_startoff) return false; - if (rmap->me_startblock + rmap->me_len <= rmap->me_startblock) - return false; - - if (!xfs_verify_fsbno(mp, rmap->me_startblock)) - return false; - - if (!xfs_verify_fsbno(mp, rmap->me_startblock + rmap->me_len - 1)) - return false; - - return true; + return xfs_verify_fsbext(mp, rmap->me_startblock, rmap->me_len); } /* |