[PATCH 0/2] nfs: refactor bit operations using clear_and_wake_up_bit

From: Arnaud Bonnet

Date: Mon Jun 22 2026 - 15:13:28 EST


Several functions in nfs code use the exact following sequence of calls
when dealing with flags:

clear_bit_unlock();
smp_mb__after_atomic();
wake_up_bit();

Since commit 8236b0ae31c8 ("bdi: wake up concurrent wb_shutdown()
callers.") came the helper clear_and_wake_up_bit() for this exact
purpose, and has since been adopted by several subsystems, including
vfs.

This function is already used in files such as nfs4state.c and
pnfs_nfs.c and this serie aims to continue this effort, which also
allows to remove some no longer used code.

Tested on x86 hardware using a loopback pNFS SCSI layout:
* doing image compression/decompression using xz and
* recompiling tinyconfig kernels on the remounted partition
No error reported under sanitizers.

Suggested-by: Agatha Isabelle Moreira <code@xxxxxxxxxx>
Link: https://kernelnewbies.org/Beginner%20Cleanup%20and%20Refactor%20Tasks%20by%20Agatha%20Isabelle%20Moreira#task_007
Signed-off-by: Arnaud Bonnet <abo@xxxxxxxxxxx>
---

Arnaud Bonnet (2):
nfs: replace atomic bitops sequence with clear_and_wake_up_bit helper
nfs: refactor pNFS functions using clear_and_wake_up_bit

fs/nfs/inode.c | 4 +---
fs/nfs/pnfs.c | 35 ++++++++++-------------------------
2 files changed, 11 insertions(+), 28 deletions(-)

--
2.53.0