ocfs2: constify struct ocfs2_stack_operations
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 14 Jun 2024 20:57:09 +0000 (22:57 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 25 Jun 2024 05:25:10 +0000 (22:25 -0700)
commit03bf0044e13ad6f20b6b4513131b73b090b9dbb8
treeaca30e3a9ec9b38380ddbdcff87a197450a7b868
parent3ebe69c0c3ae3ef5ecd1ad86aa98a3b7cbe3c7e9
ocfs2: constify struct ocfs2_stack_operations

"struct ocfs2_stack_operations" are not modified in this driver.

Constifying this structure moves some data to a read-only section, so
increase overall security.

In order to do it, "struct ocfs2_stack_plugin" also needs to be adjusted
to this new const qualifier.

On a x86_64, with allmodconfig:
Before:
======
   text    data     bss     dec     hex filename
   6241     644       0    6885    1ae5 fs/ocfs2/stack_o2cb.o

After:
=====
   text    data     bss     dec     hex filename
   6337     548       0    6885    1ae5 fs/ocfs2/stack_o2cb.o

Link: https://lkml.kernel.org/r/f52dab89ee0049ec6271de29183a781efbb275ab.1718398605.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Joseph Qi <jiangqi903@gmail.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/stack_o2cb.c
fs/ocfs2/stack_user.c
fs/ocfs2/stackglue.h