don't allow cache bypass if execsOrWriters is true
don't trigger cache bypass based on being larger than the
"disabled" value of -1.
Change-Id: Ic174b133e5da3e9215465c9c2705c25e81a8beca
Reviewed-on: http://gerrit.openafs.org/8248
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
static inline int
afs_linux_can_bypass(struct inode *ip) {
+
switch(cache_bypass_strategy) {
case NEVER_BYPASS_CACHE:
return 0;
case ALWAYS_BYPASS_CACHE:
return 1;
case LARGE_FILES_BYPASS_CACHE:
- if(i_size_read(ip) > cache_bypass_threshold)
+ if (i_size_read(ip) > cache_bypass_threshold)
return 1;
default:
return 0;
cache_bypass_threshold = threshold;
afs_warn("Cache Bypass Threshold set to: %d\n", threshold);
/* TODO: move to separate pioctl, or enhance pioctl */
- cache_bypass_strategy = LARGE_FILES_BYPASS_CACHE;
+ if (threshold == AFS_CACHE_BYPASS_DISABLED)
+ cache_bypass_strategy = NEVER_BYPASS_CACHE;
+ else if (!threshold)
+ cache_bypass_strategy = ALWAYS_BYPASS_CACHE;
+ else
+ cache_bypass_strategy = LARGE_FILES_BYPASS_CACHE;
}
/* Return the current size threshold */