Skip to content

Commit a0ebf8c

Browse files
henryZedchinner
authored andcommitted
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: Zeng Heng <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Dave Chinner <[email protected]>
1 parent de94a2e commit a0ebf8c

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

fs/xfs/xfs_reflink.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ xfs_reflink_trim_around_shared(
200200
if (fbno == NULLAGBLOCK) {
201201
/* No shared blocks at all. */
202202
return 0;
203-
} else if (fbno == agbno) {
203+
}
204+
205+
if (fbno == agbno) {
204206
/*
205207
* The start of this extent is shared. Truncate the
206208
* mapping at the end of the shared region so that a
@@ -210,16 +212,16 @@ xfs_reflink_trim_around_shared(
210212
irec->br_blockcount = flen;
211213
*shared = true;
212214
return 0;
213-
} else {
214-
/*
215-
* There's a shared extent midway through this extent.
216-
* Truncate the mapping at the start of the shared
217-
* extent so that a subsequent iteration starts at the
218-
* start of the shared region.
219-
*/
220-
irec->br_blockcount = fbno - agbno;
221-
return 0;
222215
}
216+
217+
/*
218+
* There's a shared extent midway through this extent.
219+
* Truncate the mapping at the start of the shared
220+
* extent so that a subsequent iteration starts at the
221+
* start of the shared region.
222+
*/
223+
irec->br_blockcount = fbno - agbno;
224+
return 0;
223225
}
224226

225227
int

0 commit comments

Comments
 (0)