Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177089190
D54554.1793796373.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D54554.1793796373.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D54554: cache: avoid hardcoded CACHE_PATH_CUTOFF
Attached
Detach File
Event Timeline