ocfs2: constify struct ocfs2_lock_res_ops
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 14 Jun 2024 16:25:07 +0000 (18:25 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 25 Jun 2024 05:25:10 +0000 (22:25 -0700)
commit3ebe69c0c3ae3ef5ecd1ad86aa98a3b7cbe3c7e9
treee52a492ae68db55ca451686abc26ebefab49d3ae
parentc8dab79f9eef6f1063128f1340f266321cccd17c
ocfs2: constify struct ocfs2_lock_res_ops

"struct ocfs2_lock_res_ops" 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_lock_res" also needs to be adjusted to
this new const qualifier.

On a x86_64, with allmodconfig:
Before:
======
   text    data     bss     dec     hex filename
  83038    2632     400   86070   15036 fs/ocfs2/dlmglue.o

After:
=====
   text    data     bss     dec     hex filename
  83806    1992     272   86070   15036 fs/ocfs2/dlmglue.o

Link: https://lkml.kernel.org/r/43d3e2ae3a97d3cbe93d6ba6ce48ae5ec04d7526.1718382288.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/dlmglue.c
fs/ocfs2/ocfs2.h