LINUX24: Define afs_linux_can_bypass
authorAndrew Deason <adeason@sinenomine.net>
Mon, 20 Dec 2010 16:05:46 +0000 (11:05 -0500)
committerDerrick Brashear <shadow@dementia.org>
Mon, 20 Dec 2010 21:41:27 +0000 (13:41 -0800)
We call afs_linux_can_bypass, so make sure it exists.

Change-Id: Ie4393cc57af1a52748b76d3403370fbd788d9f8a
Reviewed-on: http://gerrit.openafs.org/3554
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/afs/LINUX24/osi_vnodeops.c

index fe4a026..f7f4ca6 100644 (file)
@@ -1516,6 +1516,21 @@ afs_linux_follow_link(struct dentry *dp, struct dentry *basep,
 #endif /* AFS_LINUX24_ENV */
 #endif /* USABLE_KERNEL_PAGE_SYMLINK_CACHE */
 
+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)
+               return 1;
+       default:
+           return 0;
+     }
+}
+
 /* afs_linux_readpage
  * all reads come through here. A strategy-like read call.
  */