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

Arnaud Bonnet <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.nfs
Message-ID <[email protected]>
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 <[email protected]>
Link: https://kernelnewbies.org/Beginner%20Cleanup%20and%20Refactor%20Tasks%20by%20Agatha%20Isabelle%20Moreira#task_007
Signed-off-by: Arnaud Bonnet <[email protected]>
---

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.