]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xfs: scrub: use kstrdup_const() for metapath scan setups
authorDmitry Antipov <dmantipov@yandex.ru>
Thu, 18 Sep 2025 11:14:03 +0000 (14:14 +0300)
committerCarlos Maiolino <cem@kernel.org>
Mon, 22 Sep 2025 10:57:34 +0000 (12:57 +0200)
commitfc0d192303bd385ac24dc52eb31ceb6ca7e027d0
tree8eb594bcc2ed756e9f0cb4f75bf9bc12bb8b7386
parent6ef2175fce30ccab80d519f2afcc93d8b138c16c
xfs: scrub: use kstrdup_const() for metapath scan setups

Except 'xchk_setup_metapath_rtginode()' case, 'path' argument of
'xchk_setup_metapath_scan()' is a compile-time constant. So it may
be reasonable to use 'kstrdup_const()' / 'kree_const()' to manage
'path' field of 'struct xchk_metapath' in attempt to reuse .rodata
instance rather than making a copy. Compile tested only.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/scrub/metapath.c