afs: use read_seqbegin() in afs_check_validity() and afs_getattr()
authorOleg Nesterov <oleg@redhat.com>
Thu, 30 Nov 2023 11:56:17 +0000 (12:56 +0100)
committerDavid Howells <dhowells@redhat.com>
Sun, 24 Dec 2023 15:22:48 +0000 (15:22 +0000)
commitdf91b9dfdee23072641570b1efc049f19d839ae8
treedcfa69ea62242d637ff7bf8b5fd32c00127a3af7
parent1702e0654ca9a7bcd7c7619c8a5004db58945b71
afs: use read_seqbegin() in afs_check_validity() and afs_getattr()

David Howells says:

 (3) afs_check_validity().
 (4) afs_getattr().

     These are both pretty short, so your solution is probably good for them.
     That said, afs_vnode_commit_status() can spend a long time under the
     write lock - and pretty much every file RPC op returns a status update.

Change these functions to use read_seqbegin(). This simplifies the code
and doesn't change the current behaviour, the "seq" counter is always even
so read_seqbegin_or_lock() can never take the lock.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/r/20231130115617.GA21584@redhat.com/
fs/afs/inode.c