posix_acl: Use try_cmpxchg in get_acl
authorUros Bizjak <ubizjak@gmail.com>
Wed, 21 Dec 2022 19:35:40 +0000 (20:35 +0100)
committerChristian Brauner (Microsoft) <brauner@kernel.org>
Sun, 8 Jan 2023 11:37:49 +0000 (12:37 +0100)
commit4e1da8fe031303599e78f88e0dad9f44272e4f99
treebe4f00de082d570ac06a21010528c2150bde5670
parent1b929c02afd37871d5afb9d498426f83432e71c2
posix_acl: Use try_cmpxchg in get_acl

Use try_cmpxchg instead of cmpxchg (*ptr, old, new) == old
in get_acl. x86 CMPXCHG instruction returns success in ZF flag,
so this change saves a compare after cmpxchg (and related move
instruction in front of cmpxchg).

No functional change intended.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
fs/posix_acl.c