diff options
| author | Christophe Leroy (CS GROUP) <chleroy@kernel.org> | 2026-03-24 12:41:15 +0100 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-03-24 14:44:02 +0100 |
| commit | 4bf798e027d35e4fd9a31b32e6bc2d33a73c0041 (patch) | |
| tree | 82e511d4b1d07ecf206dbc96b91d609aea0471e4 /drivers/message/i2o/git@git.tavy.me:linux.git | |
| parent | f30186b0c7829841744a40f7345e6cc9865f8a67 (diff) | |
readdir: Introduce dirent_size()
In several places in readdir.c there are calculations of the total size
of a dirent, which contains a few fixed fields plus a name field with
variable size. To add fun every dirent is of a slightly different type:
- struct old_linux_dirent
- struct linux_dirent
- struct linux_dirent64
- struct compat_old_linux_dirent
- struct compat_linux_dirent
Replace ugly size calculation by a macro called dirent_size() which
calculates the size of the structure based on the pointed type and
the name field len.
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Link: https://patch.msgid.link/c20d2f8f6817a39401155cfc80f0dff88df116e0.1774350128.git.chleroy@kernel.org
Reviewed-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'drivers/message/i2o/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
