Commit a0ebf8c4 authored by Zeng Heng's avatar Zeng Heng Committed by Dave Chinner

xfs: simplify if-else condition in xfs_reflink_trim_around_shared

"else" is not generally useful after a return,
so remove it for clean code.

There is no logical changes.
Signed-off-by: default avatarZeng Heng <zengheng4@huawei.com>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent de94a2e1
...@@ -200,7 +200,9 @@ xfs_reflink_trim_around_shared( ...@@ -200,7 +200,9 @@ xfs_reflink_trim_around_shared(
if (fbno == NULLAGBLOCK) { if (fbno == NULLAGBLOCK) {
/* No shared blocks at all. */ /* No shared blocks at all. */
return 0; return 0;
} else if (fbno == agbno) { }
if (fbno == agbno) {
/* /*
* The start of this extent is shared. Truncate the * The start of this extent is shared. Truncate the
* mapping at the end of the shared region so that a * mapping at the end of the shared region so that a
...@@ -210,16 +212,16 @@ xfs_reflink_trim_around_shared( ...@@ -210,16 +212,16 @@ xfs_reflink_trim_around_shared(
irec->br_blockcount = flen; irec->br_blockcount = flen;
*shared = true; *shared = true;
return 0; return 0;
} else {
/*
* There's a shared extent midway through this extent.
* Truncate the mapping at the start of the shared
* extent so that a subsequent iteration starts at the
* start of the shared region.
*/
irec->br_blockcount = fbno - agbno;
return 0;
} }
/*
* There's a shared extent midway through this extent.
* Truncate the mapping at the start of the shared
* extent so that a subsequent iteration starts at the
* start of the shared region.
*/
irec->br_blockcount = fbno - agbno;
return 0;
} }
int int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment