Commit 140ac52
btrfs: simplify the return value handling in search_ioctl()
Move the assignment of -EFAULT to within the error condition check
in fault_in_subpage_writeable(). The previous placement outside the
condition could lead to the error value being overwritten by subsequent
assignments, cause unnecessary assignments.
Simplify loop exit logic by removing redundant goto.
The original code used 'goto err' to bypass post-loop processing after
handling errors from btrfs_search_forward(). However, the loop's
termination naturally falls through to the post-loop section, which
already handles 'ret' values. Replacing 'goto err' with 'break'
eliminates redundant control flow, consolidates error handling, and
makes the loop's exit conditions explicit.
Signed-off-by: Sun YangKai <sunk67188@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent 009ca35 commit 140ac52
1 file changed
+8
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1641 | 1641 | | |
1642 | 1642 | | |
1643 | 1643 | | |
1644 | | - | |
1645 | 1644 | | |
1646 | 1645 | | |
1647 | 1646 | | |
1648 | 1647 | | |
1649 | | - | |
1650 | | - | |
| 1648 | + | |
| 1649 | + | |
1651 | 1650 | | |
| 1651 | + | |
1652 | 1652 | | |
1653 | 1653 | | |
1654 | | - | |
1655 | | - | |
1656 | | - | |
1657 | | - | |
1658 | | - | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
1659 | 1657 | | |
1660 | 1658 | | |
1661 | 1659 | | |
1662 | 1660 | | |
1663 | 1661 | | |
1664 | 1662 | | |
1665 | 1663 | | |
| 1664 | + | |
1666 | 1665 | | |
1667 | 1666 | | |
1668 | | - | |
| 1667 | + | |
1669 | 1668 | | |
1670 | 1669 | | |
1671 | 1670 | | |
| |||
0 commit comments