ocfs2: remove custom swap functions in favor of built-in sort swap
authorKuan-Wei Chiu <visitorckw@gmail.com>
Sat, 10 Aug 2024 19:53:16 +0000 (03:53 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 2 Sep 2024 03:43:37 +0000 (20:43 -0700)
commite60255f07c6a1f5bbbd490a2db23fe9eee8c6fd4
tree5bde96046e7ff6df4efa0fd1f360109012166aab
parentc91c6062d6cd1bc366efb04973ee449c30398a49
ocfs2: remove custom swap functions in favor of built-in sort swap

The custom swap functions used in ocfs2 do not perform any special
operations and can be replaced with the built-in swap function of sort.
This change not only reduces code size but also improves efficiency,
especially in scenarios where CONFIG_RETPOLINE is enabled, as it makes
indirect function calls more expensive.

By using the built-in swap, we avoid these costly indirect function calls,
leading to better performance.

Link: https://lkml.kernel.org/r/20240810195316.186504-1-visitorckw@gmail.com
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: Heming Zhao <heming.zhao@suse.com>
Cc: Ching-Chun (Jim) Huang <jserv@ccns.ncku.edu.tw>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/dir.c
fs/ocfs2/refcounttree.c
fs/ocfs2/xattr.c