Skip to content

Commit

Permalink
stress-lease: add LIKELY/UNLIKELY hints for stress_continue_flag
Browse files Browse the repository at this point in the history
Signed-off-by: Colin Ian King <[email protected]>
  • Loading branch information
ColinIanKing committed Feb 12, 2025
1 parent 857ecc0 commit cd0ea4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stress-lease.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ static int stress_try_lease(
* attempt a lease lock
*/
while (fcntl(fd, F_SETLEASE, lock) < 0) {
if (!stress_continue_flag())
if (UNLIKELY(!stress_continue_flag()))
goto tidy;
}
(void)stress_get_lease(fd);
Expand All @@ -153,7 +153,7 @@ static int stress_try_lease(
* attempt a lease unlock
*/
while (fcntl(fd, F_SETLEASE, F_UNLCK) < 0) {
if (!stress_continue_flag())
if (UNLIKELY(!stress_continue_flag()))
break;
if (errno != EAGAIN) {
pr_fail("%s: fcntl failed: errno=%d: (%s)%s\n",
Expand Down

0 comments on commit cd0ea4d

Please sign in to comment.