linux/fs/nfs
Mark Rutland 6aa7de0591 locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE()
Please do not apply this to mainline directly, instead please re-run the
coccinelle script shown below and apply its output.

For several reasons, it is desirable to use {READ,WRITE}_ONCE() in
preference to ACCESS_ONCE(), and new code is expected to use one of the
former. So far, there's been no reason to change most existing uses of
ACCESS_ONCE(), as these aren't harmful, and changing them results in
churn.

However, for some features, the read/write distinction is critical to
correct operation. To distinguish these cases, separate read/write
accessors must be used. This patch migrates (most) remaining
ACCESS_ONCE() instances to {READ,WRITE}_ONCE(), using the following
coccinelle script:

----
// Convert trivial ACCESS_ONCE() uses to equivalent READ_ONCE() and
// WRITE_ONCE()

// $ make coccicheck COCCI=/home/mark/once.cocci SPFLAGS="--include-headers" MODE=patch

virtual patch

@ depends on patch @
expression E1, E2;
@@

- ACCESS_ONCE(E1) = E2
+ WRITE_ONCE(E1, E2)

@ depends on patch @
expression E;
@@

- ACCESS_ONCE(E)
+ READ_ONCE(E)
----

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: davem@davemloft.net
Cc: linux-arch@vger.kernel.org
Cc: mpe@ellerman.id.au
Cc: shuah@kernel.org
Cc: snitzer@redhat.com
Cc: thor.thayer@linux.intel.com
Cc: tj@kernel.org
Cc: viro@zeniv.linux.org.uk
Cc: will.deacon@arm.com
Link: http://lkml.kernel.org/r/1508792849-3115-19-git-send-email-paulmck@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-10-25 11:01:08 +02:00
..
blocklayout block: replace bi_bdev with a gendisk pointer and partitions index 2017-08-23 12:49:55 -06:00
filelayout nfs/filelayout: fix oops when freeing filelayout segment 2017-10-01 18:51:30 -04:00
flexfilelayout nfs/flexfiles: fix leak of nfs4_ff_ds_version arrays 2017-08-08 17:18:10 -04:00
Kconfig pnfs/blocklayout: require 64-bit sector_t 2017-08-11 14:10:13 -04:00
Makefile
cache_lib.c
cache_lib.h
callback.c sunrpc: Const-ify struct sv_serv_ops 2017-08-24 22:13:50 -04:00
callback.h
callback_proc.c NFS: Use an atomic_long_t to count the number of requests 2017-08-15 11:54:47 -04:00
callback_xdr.c
client.c NFS: Fix uninitialized rpc_wait_queue 2017-10-01 18:51:30 -04:00
delegation.c NFS: Use an atomic_long_t to count the number of requests 2017-08-15 11:54:47 -04:00
delegation.h
dir.c locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE() 2017-10-25 11:01:08 +02:00
direct.c NFSv4: Use a mutex to protect the per-inode commit lists 2017-08-15 11:54:47 -04:00
dns_resolve.c
dns_resolve.h
export.c
file.c NFS: various changes relating to reporting IO errors. 2017-09-11 22:28:56 -04:00
fscache-index.c fscache: remove unused ->now_uncached callback 2017-09-06 17:27:26 -07:00
fscache.c
fscache.h
getroot.c
inode.c NFS: Use an atomic_long_t to count the number of commits 2017-08-15 11:54:48 -04:00
internal.h NFS: various changes relating to reporting IO errors. 2017-09-11 22:28:56 -04:00
io.c
iostat.h
mount_clnt.c
namespace.c
netns.h
nfs.h
nfs2super.c
nfs2xdr.c
nfs3_fs.h
nfs3acl.c
nfs3client.c
nfs3proc.c
nfs3super.c
nfs3xdr.c
nfs4_fs.h NFSv4.1: don't use machine credentials for CLOSE when using 'sec=sys' 2017-08-20 12:43:17 -04:00
nfs4client.c NFSv4: Fix double frees in nfs4_test_session_trunk() 2017-08-02 09:45:55 -04:00
nfs4file.c
nfs4getroot.c
nfs4idmap.c NFS: Cleanup error handling in nfs_idmap_request_key() 2017-10-01 18:51:30 -04:00
nfs4idmap.h
nfs4namespace.c
nfs4proc.c NFSv4/pnfs: Fix an infinite layoutget loop 2017-10-04 14:06:54 -04:00
nfs4renewd.c
nfs4session.c
nfs4session.h
nfs4state.c
nfs4super.c
nfs4sysctl.c
nfs4trace.c
nfs4trace.h
nfs4xdr.c nfs: RPC_MAX_AUTH_SIZE is in bytes 2017-10-01 18:51:30 -04:00
nfs42.h
nfs42proc.c
nfs42xdr.c
nfsroot.c
nfstrace.c
nfstrace.h NFS: Add static NFS I/O tracepoints 2017-09-11 22:20:38 -04:00
pagelist.c NFS: various changes relating to reporting IO errors. 2017-09-11 22:28:56 -04:00
pnfs.c pNFS: Use the standard I/O stateid when calling LAYOUTGET 2017-09-11 22:19:00 -04:00
pnfs.h NFSv4/pnfs: Replace pnfs_put_lseg_locked() with pnfs_put_lseg() 2017-08-15 11:54:48 -04:00
pnfs_dev.c
pnfs_nfs.c NFS: Remove pnfs_generic_transfer_commit_list() 2017-09-09 12:51:40 -04:00
proc.c
read.c NFS: Add static NFS I/O tracepoints 2017-09-11 22:20:38 -04:00
super.c Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-09-14 18:54:01 -07:00
symlink.c
sysctl.c
unlink.c
write.c NFS: various changes relating to reporting IO errors. 2017-09-11 22:28:56 -04:00