]> www.infradead.org Git - users/jedix/linux-maple.git/commit
nilfs2: Constify struct kobj_type
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 8 Jul 2024 14:32:42 +0000 (23:32 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 12 Jul 2024 23:39:52 +0000 (16:39 -0700)
commitfbc8846cd9c258e3844d22afd4d1ae7240077aab
treefb10070505480e6fe8d2efe9f2d7b7f6882e15df
parent0f3819e8c483771a59cf9d3190cd68a7a990083c
nilfs2: Constify struct kobj_type

'struct kobj_type' is not modified in this driver. It is only used with
kobject_init_and_add() which takes a "const struct kobj_type *" parameter.

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

On a x86_64, with allmodconfig:
Before:
======
   text    data     bss     dec     hex filename
  22403    4184      24   26611    67f3 fs/nilfs2/sysfs.o

After:
=====
   text    data     bss     dec     hex filename
  22723    3928      24   26675    6833 fs/nilfs2/sysfs.o

Link: https://lkml.kernel.org/r/20240708143242.3296-1-konishi.ryusuke@gmail.com
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/nilfs2/sysfs.c