diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2025-11-19 19:45:04 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2026-01-13 15:16:44 -0500 |
| commit | 8c888b31903cc2acfbf054c23d702caf68857810 (patch) | |
| tree | b8677601b8a43f4fec6990d12ca1a07fbcd74a60 /include/linux/annotate.h | |
| parent | c3a3577cdb351e74d6ff6bc328c3bee18ce69298 (diff) | |
struct filename: saner handling of long names
Always allocate struct filename from names_cachep, long name or short;
short names would be embedded into struct filename. Longer ones do
not cannibalize the original struct filename - put them into kmalloc'ed
buffers (PATH_MAX-sized for import from userland, strlen() + 1 - for
ones originating kernel-side, where we know the length beforehand).
Cutoff length for short names is chosen so that struct filename would be
192 bytes long - that's both a multiple of 64 and large enough to cover
the majority of real-world uses.
Simplifies logics in getname()/putname() and friends.
[fixed an embarrassing braino in EMBEDDED_NAME_MAX, first reported by
Dan Carpenter]
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/annotate.h')
0 files changed, 0 insertions, 0 deletions
