From e34702ef89649df47745121f45df32bec1f2fccb Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Wed, 6 Jan 2010 15:12:32 +0000 Subject: [PATCH] Linux: Use the correct ATIME flag Since Linux kernel 2.4.0, MS_NOATIME has been a super block flag, and S_NOATIME has been the corresponding inode flag. Use the correct flag when we're opening cache files. FIXES 126084 Change-Id: I69cbcd651584cc86568c51793dd3f6d3e8644709 Reviewed-on: http://gerrit.openafs.org/1070 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/afs/LINUX/osi_file.c | 2 +- src/afs/LINUX24/osi_file.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/afs/LINUX/osi_file.c b/src/afs/LINUX/osi_file.c index 7af6b6d710..c159823075 100644 --- a/src/afs/LINUX/osi_file.c +++ b/src/afs/LINUX/osi_file.c @@ -51,7 +51,7 @@ afs_linux_raw_open(afs_dcache_id_t *ainode) osi_Panic("Can't get dentry\n"); tip = dp->d_inode; #endif - tip->i_flags |= MS_NOATIME; /* Disable updating access times. */ + tip->i_flags |= S_NOATIME; /* Disable updating access times. */ #if defined(STRUCT_TASK_HAS_CRED) /* Use stashed credentials - prevent selinux/apparmor problems */ diff --git a/src/afs/LINUX24/osi_file.c b/src/afs/LINUX24/osi_file.c index ba58d051bf..8e965957ca 100644 --- a/src/afs/LINUX24/osi_file.c +++ b/src/afs/LINUX24/osi_file.c @@ -55,7 +55,12 @@ afs_linux_raw_open(afs_dcache_id_t *ainode) osi_Panic("Can't get dentry\n"); tip = dp->d_inode; #endif + +#if defined(S_NOATIME) + tip->i_flags |= S_NOATIME; /* Disable updating access times. */ +#else tip->i_flags |= MS_NOATIME; /* Disable updating access times. */ +#endif #if defined(STRUCT_TASK_HAS_CRED) filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR, current_cred());