[Ocfs2-commits] mfasheh commits r1892 - in trunk: . fs/ocfs2/dlm
kapi-compat/include
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Thu Feb 17 20:03:38 CST 2005
Author: mfasheh
Date: 2005-02-17 20:03:36 -0600 (Thu, 17 Feb 2005)
New Revision: 1892
Added:
trunk/kapi-compat/include/kref_init.h
trunk/kapi-compat/include/kref_put.h
Modified:
trunk/configure.in
trunk/fs/ocfs2/dlm/dlmmod.c
Log:
* some of the promised compat glue for kref stuff. this needs testing,
and the configure.in part simply won't work on suse (along with some
other tests). a fix for that particular problem is forthcoming.
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2005-02-18 00:13:17 UTC (rev 1891)
+++ trunk/configure.in 2005-02-18 02:03:36 UTC (rev 1892)
@@ -310,6 +310,17 @@
AC_MSG_RESULT(no)
fi
+#this check will break for 2.4 kernels...
+AC_MSG_CHECKING([for kref_init with release callback])
+grep "kref_init.*release" "$KERNELINC/linux/kref.h"
+if grep "kref_init.*release" "$KERNELINC/linux/kref.h" >/dev/null 2>&1 ; then
+ KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS kref_put.h"
+ AC_MSG_RESULT(yes)
+else
+ KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS kref_init.h"
+ AC_MSG_RESULT(no)
+fi
+
# using -include has two advantages:
# the source doesn't need to know to include compat headers
# the compat header file names don't go through the search path
Modified: trunk/fs/ocfs2/dlm/dlmmod.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmmod.c 2005-02-18 00:13:17 UTC (rev 1891)
+++ trunk/fs/ocfs2/dlm/dlmmod.c 2005-02-18 02:03:36 UTC (rev 1892)
@@ -497,7 +497,7 @@
BUG_ON(!dlm);
spin_lock(&dlm_domain_lock);
- kref_put(&dlm->dlm_refs);
+ kref_put(&dlm->dlm_refs, dlm_ctxt_release);
spin_unlock(&dlm_domain_lock);
}
Added: trunk/kapi-compat/include/kref_init.h
===================================================================
--- trunk/kapi-compat/include/kref_init.h 2005-02-18 00:13:17 UTC (rev 1891)
+++ trunk/kapi-compat/include/kref_init.h 2005-02-18 02:03:36 UTC (rev 1892)
@@ -0,0 +1,7 @@
+#ifndef KAPI_KREF_INIT_H
+#define KAPI_KREF_INIT_H
+
+/* kernel folks 1, universe 0 */
+#define kref_init(kref_obj, release_func) kref_init(kref_obj)
+
+#endif /* KAPI_KREF_INIT_H */
Added: trunk/kapi-compat/include/kref_put.h
===================================================================
--- trunk/kapi-compat/include/kref_put.h 2005-02-18 00:13:17 UTC (rev 1891)
+++ trunk/kapi-compat/include/kref_put.h 2005-02-18 02:03:36 UTC (rev 1892)
@@ -0,0 +1,6 @@
+#ifndef KAPI_KREF_PUT_H
+#define KAPI_KREF_PUT_H
+
+#define kref_put(kref_obj, release_func) kref_put(kref_obj)
+
+#endif /* KAPI_KREF_PUT_H */
More information about the Ocfs2-commits
mailing list