Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kernfs: Rearrange kernfs_node fields to reduce its size on 64bit

Moving .flags and .mode right below .hash makes kernfs_node smaller by 8
bytes on 64bit. To avoid creating a hole from 8 bytes alignment on 32bit
archs, .priv is moved below so that there are two 32bit pointers after the
64bit .id field.

v2: Updated to avoid size increase on 32bit noticed by Geert.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/ZZ7hwA18nfmFjYpj@slm.duckdns.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Tejun Heo and committed by
Greg Kroah-Hartman
1c9f2c76 41bccc98

+4 -4
+4 -4
include/linux/kernfs.h
··· 206 206 207 207 const void *ns; /* namespace tag */ 208 208 unsigned int hash; /* ns + name hash */ 209 + unsigned short flags; 210 + umode_t mode; 211 + 209 212 union { 210 213 struct kernfs_elem_dir dir; 211 214 struct kernfs_elem_symlink symlink; 212 215 struct kernfs_elem_attr attr; 213 216 }; 214 - 215 - void *priv; 216 217 217 218 /* 218 219 * 64bit unique ID. On 64bit ino setups, id is the ino. On 32bit, ··· 221 220 */ 222 221 u64 id; 223 222 224 - unsigned short flags; 225 - umode_t mode; 223 + void *priv; 226 224 struct kernfs_iattrs *iattr; 227 225 }; 228 226