Page MenuHomeFreeBSD

D54554.1793796373.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D54554.1793796373.diff

diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -412,19 +412,19 @@
* tied to VFS SMR. Even if retaining them, the current split should be
* re-evaluated.
*/
-#ifdef __LP64__
-#define CACHE_PATH_CUTOFF 45
-#else
-#define CACHE_PATH_CUTOFF 41
-#endif
+#define CACHE_PATH_CUTOFF_MIN 40
+#define CACHE_STRUCT_LEN(pathlen) \
+ (offsetof(struct namecache, nc_name) + (pathlen) + 1)
+#define CACHE_PATH_CUTOFF \
+ (roundup2(CACHE_STRUCT_LEN(CACHE_PATH_CUTOFF_MIN), \
+ _Alignof(struct namecache_ts)) - CACHE_STRUCT_LEN(0))
#define CACHE_ZONE_SMALL_SIZE \
- (offsetof(struct namecache, nc_name) + CACHE_PATH_CUTOFF + 1)
+ CACHE_STRUCT_LEN(CACHE_PATH_CUTOFF)
#define CACHE_ZONE_SMALL_TS_SIZE \
(offsetof(struct namecache_ts, nc_nc) + CACHE_ZONE_SMALL_SIZE)
#define CACHE_ZONE_LARGE_SIZE \
- roundup2(offsetof(struct namecache, nc_name) + NAME_MAX + 1, \
- _Alignof(struct namecache_ts))
+ roundup2(CACHE_STRUCT_LEN(NAME_MAX), _Alignof(struct namecache_ts))
#define CACHE_ZONE_LARGE_TS_SIZE \
(offsetof(struct namecache_ts, nc_nc) + CACHE_ZONE_LARGE_SIZE)

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 4, 12:46 PM (4 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41431061
Default Alt Text
D54554.1793796373.diff (1 KB)

Event Timeline