On Mon, Jun 26, 2006 at 09:34:00AM +0100, Number Cruncher wrote:
> (1) has anyone already done this as a single patch (i.e. aside from the
> 1.5.0 major changes) and
> (2) will 1.5.0 be released in the next month, making such an effort
> rather pointless :-) ?
We are pretty close to a 1.5.0 release. Thanks for your patience.
Should within the week.
The attached patch is not perfect, but should get 1.4.0 compiling on
2.6.16 and newer kernels.
==rob
--
Rob Latham
Mathematics and Computer Science Division A215 0178 EA2D B059 8CDF
Argonne National Labs, IL USA B29D F333 664A 4280 315B
---------------------
PatchSet 4897
Date: 2006/03/21 13:58:04
Author: robl
Branch: HEAD
Tag: (none)
Log:
2.6.16 (and the FC5 2.6.15-1.2054_FC5 kernel) no longer provide update_atime.
Use touch_atime, which appears to be in all 2.6 kernels. Add a configure-time
test so we can fall back to the older update_atime method.
Members:
configure:1.279->1.280
configure.in:1.280->1.281
pvfs2-config.h.in:1.64->1.65
src/kernel/linux-2.6/dir.c:1.37->1.38
src/kernel/linux-2.6/file.c:1.112->1.113
Index: pvfs2-1/configure
diff -u pvfs2-1/configure:1.279 pvfs2-1/configure:1.280
--- pvfs2-1/configure:1.279 Fri Mar 17 18:00:26 2006
+++ pvfs2-1/configure Tue Mar 21 14:58:04 2006
@@ -6588,7 +6588,7 @@
NOSTDINCFLAGS="-nostdinc -isystem `$CC -print-file-name=include`"
-CFLAGS="$USR_CFLAGS $NOSTDINCFLAGS -I$lk_src/include
-I$lk_src/include/asm-i386/mach-generic -I$lk_src/include/asm-i386/mach-default"
+CFLAGS="$USR_CFLAGS $NOSTDINCFLAGS -I$lk_src/include
-I$lk_src/include/asm-i386/mach-generic -I$lk_src/include/asm-i386/mach-default
-DKBUILD_STR(s)=#s -DKBUILD_BASENAME=KBUILD_STR(empty)
-DKBUILD_MODNAME=KBUILD_STR(empty)"
echo "$as_me:$LINENO: checking for i_size_write in kernel" >&5
echo $ECHO_N "checking for i_size_write in kernel... $ECHO_C" >&6
@@ -6964,6 +6964,70 @@
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+echo "$as_me:$LINENO: checking for touch_atime support in kernel" >&5
+echo $ECHO_N "checking for touch_atime support in kernel... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #define __KERNEL__
+ #include <linux/fs.h>
+ void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
+ {
+ return;
+ }
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_TOUCH_ATIME 1
+_ACEOF
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
Index: pvfs2-1/configure.in
diff -u pvfs2-1/configure.in:1.280 pvfs2-1/configure.in:1.281
--- pvfs2-1/configure.in:1.280 Fri Mar 17 18:00:26 2006
+++ pvfs2-1/configure.in Tue Mar 21 14:58:05 2006
@@ -462,8 +462,6 @@
dnl now that we have the path to kernel source we can feature-test kernels.
-dnl currently it's a few functions that SuSE-8 backports from
-dnl 2.6 into 2.4
oldcflags=$CFLAGS
if test -z "${LINUX_KERNEL_SRC}" ; then
@@ -482,7 +480,7 @@
dnl hack will bring in just enough system headers for kernel compilation
NOSTDINCFLAGS="-nostdinc -isystem `$CC -print-file-name=include`"
-CFLAGS="$USR_CFLAGS $NOSTDINCFLAGS -I$lk_src/include
-I$lk_src/include/asm-i386/mach-generic
-I$lk_src/include/asm-i386/mach-default"
+CFLAGS="$USR_CFLAGS $NOSTDINCFLAGS -I$lk_src/include
-I$lk_src/include/asm-i386/mach-generic -I$lk_src/include/asm-i386/mach-default
-DKBUILD_STR(s)=#s -DKBUILD_BASENAME=KBUILD_STR(empty)
-DKBUILD_MODNAME=KBUILD_STR(empty)"
AC_MSG_CHECKING(for i_size_write in kernel)
dnl if this test passes, the kernel does not have it
@@ -577,6 +575,21 @@
AC_MSG_RESULT(no)
have_aio=no
)
+
+AC_MSG_CHECKING(for touch_atime support in kernel)
+AC_TRY_COMPILE([
+ #define __KERNEL__
+ #include <linux/fs.h>
+ void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
+ {
+ return;
+ }
+], [],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_TOUCH_ATIME, 1, Define if kernel has touch_atime
routine),
+ AC_MSG_RESULT(no)
+)
+
dnl
dnl some kernels (SLES9 2.6.5-7.191, for one) will pass the test for ki_dtor
Index: pvfs2-1/pvfs2-config.h.in
diff -u pvfs2-1/pvfs2-config.h.in:1.64 pvfs2-1/pvfs2-config.h.in:1.65
--- pvfs2-1/pvfs2-config.h.in:1.64 Tue Mar 7 16:35:08 2006
+++ pvfs2-1/pvfs2-config.h.in Tue Mar 21 14:58:05 2006
@@ -179,6 +179,9 @@
/* Define to 1 if you have the <sys/xattr.h> header file. */
#undef HAVE_SYS_XATTR_H
+/* Define if kernel has touch_atime routine */
+#undef HAVE_TOUCH_ATIME
+
/* Define if DB open function takes a txnid parameter */
#undef HAVE_TXNID_PARAMETER_TO_DB_OPEN
Index: pvfs2-1/src/kernel/linux-2.6/dir.c
diff -u pvfs2-1/src/kernel/linux-2.6/dir.c:1.37
pvfs2-1/src/kernel/linux-2.6/dir.c:1.38
--- pvfs2-1/src/kernel/linux-2.6/dir.c:1.37 Wed Jan 18 12:41:28 2006
+++ pvfs2-1/src/kernel/linux-2.6/dir.c Tue Mar 21 14:58:06 2006
@@ -266,7 +266,12 @@
break;
}
+#ifdef HAVE_TOUCH_ATIME
+ touch_atime(file->f_vfsmnt, dentry);
+#else
update_atime(dentry->d_inode);
+#endif
+
pvfs2_print("pvfs2_readdir returning %d\n",ret);
return ret;
Index: pvfs2-1/src/kernel/linux-2.6/file.c
diff -u pvfs2-1/src/kernel/linux-2.6/file.c:1.112
pvfs2-1/src/kernel/linux-2.6/file.c:1.113
--- pvfs2-1/src/kernel/linux-2.6/file.c:1.112 Wed Jan 18 12:41:29 2006
+++ pvfs2-1/src/kernel/linux-2.6/file.c Tue Mar 21 14:58:06 2006
@@ -415,7 +415,11 @@
(unsigned long) *offset, (unsigned long) file->f_pos);
if (total_count)
{
+#ifdef HAVE_TOUCH_ATIME
+ touch_atime(file->f_vfsmnt, file->f_dentry);
+#else
update_atime(inode);
+#endif
}
return total_count;
}
@@ -1038,7 +1042,11 @@
}
if (total_count)
{
+#ifdef HAVE_TOUCH_ATIME
+ touch_atime(file->f_vfsmnt, file->f_dentry);
+#else
update_atime(inode);
+#endif
}
return total_count;
}
@@ -1138,8 +1146,13 @@
if ((x->rw == PVFS_IO_WRITE) && error > 0)
{
struct inode *inode = iocb->ki_filp->f_mapping->host;
+ struct file *filp = iocb->ki_filp;
/* update atime if need be */
+#ifdef HAVE_TOUCH_ATIME
+ touch_atime(filp->f_vfsmnt, filp->f_dentry);
+#else
update_atime(inode);
+#endif
}
/*
* Now we can happily free up the op,
@@ -1823,7 +1836,11 @@
(int) buffer_index);
if (error > 0)
{
+#ifdef HAVE_TOUCH_ATIME
+ touch_atime(filp->f_vfsmnt, filp->f_dentry);
+#else
update_atime(inode);
+#endif
}
/* new_op is freed by the client-daemon */
goto out_error;
@@ -1939,7 +1956,12 @@
pvfs2_print("pvfs2_file_release: called on %s\n",
file->f_dentry->d_name.name);
+#ifdef HAVE_TOUCH_ATIME
+ touch_atime(file->f_vfsmnt, file->f_dentry);
+#else
update_atime(inode);
+#endif
+
if (S_ISDIR(inode->i_mode))
{
return dcache_dir_close(inode, file);
_______________________________________________
Pvfs2-users mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users