As the 'gen' field in 'struct tarfs_node' (and then 'struct tarfs_fid')
is filled with arc4random() which returns an unsigned int, change its
type in both structures. This allows reordering fields in 'struct
tarfs_fid' to reduce its size, finally avoiding the use of '__packed' to
ensure it fits into 'struct fid'.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/fs/tarfs/tarfs.h | ||
---|---|---|
78 | I initially wanted to put uint32_t for this exact reason, but then I surveyed tarfs code and saw there were no occurrences of uint32_t (consistency of style). Also, as this is a purely internal structure, I thought that being explicit with its size wasn't that much required here. Either way is fine with me (just saying in case someone insists in keeping unsigned int). | |
166 | This case is a bit different, as struct tarfs_fid is meant to be an encoding, so the need to change it is more compelling. There's perhaps still the style consistency issue. |
sys/fs/tarfs/tarfs.h | ||
---|---|---|
165 | this isn't needed if the struct isn't packed. |