[Ocfs2-commits] zab commits r2145 - in trunk: . fs/ocfs2/cluster
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri Apr 15 16:12:27 CDT 2005
Author: zab
Signed-off-by: manish
Date: 2005-04-15 16:12:26 -0500 (Fri, 15 Apr 2005)
New Revision: 2145
Modified:
trunk/Config.make.in
trunk/configure.in
trunk/fs/ocfs2/cluster/Makefile
trunk/fs/ocfs2/cluster/tcp.c
Log:
o add some autoconf to detect and use old idr_get_new() semantics
Signed-off-by: manish
Modified: trunk/Config.make.in
===================================================================
--- trunk/Config.make.in 2005-04-15 05:06:55 UTC (rev 2144)
+++ trunk/Config.make.in 2005-04-15 21:12:26 UTC (rev 2145)
@@ -66,6 +66,7 @@
MISSING_SOCK_CREATE_LITE = @MISSING_SOCK_CREATE_LITE@
JOURNAL_ACCESS_WITH_CREDITS = @JOURNAL_ACCESS_WITH_CREDITS@
BACKING_DEV_CAPABILITIES = @BACKING_DEV_CAPABILITIES@
+IDR_GET_NEW_RETURNS_ID = @IDR_GET_NEW_RETURNS_ID@
COMPAT_SAFE_WRITE = @COMPAT_SAFE_WRITE@
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2005-04-15 05:06:55 UTC (rev 2144)
+++ trunk/configure.in 2005-04-15 21:12:26 UTC (rev 2145)
@@ -315,6 +315,11 @@
BACKING_DEV_CAPABILITIES=yes, , [\<BDI_CAP_NO_WRITEBACK\>])
AC_SUBST(BACKING_DEV_CAPABILITIES)
+IDR_GET_NEW_RETURNS_ID=
+OCFS2_CHECK_KERNEL([for old idr_get_new() semantics], idr.h,
+ IDR_GET_NEW_RETURNS_ID=yes, , [int idr_get_new(struct idr \*idp, void \*ptr);])
+AC_SUBST(IDR_GET_NEW_RETURNS_ID)
+
# 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/cluster/Makefile
===================================================================
--- trunk/fs/ocfs2/cluster/Makefile 2005-04-15 05:06:55 UTC (rev 2144)
+++ trunk/fs/ocfs2/cluster/Makefile 2005-04-15 21:12:26 UTC (rev 2145)
@@ -16,6 +16,10 @@
EXTRA_CFLAGS += -DMISSING_SOCK_CREATE_LITE
endif
+ifdef IDR_GET_NEW_RETURNS_ID
+EXTRA_CFLAGS += -DIDR_GET_NEW_RETURNS_ID
+endif
+
# this is going to get exciting if configfs is merged
EXTRA_CFLAGS += -I$(OUR_TOPDIR)/fs/configfs/
Modified: trunk/fs/ocfs2/cluster/tcp.c
===================================================================
--- trunk/fs/ocfs2/cluster/tcp.c 2005-04-15 05:06:55 UTC (rev 2144)
+++ trunk/fs/ocfs2/cluster/tcp.c 2005-04-15 21:12:26 UTC (rev 2145)
@@ -721,7 +721,16 @@
break;
}
spin_lock_bh(&node->nd_lock);
+#ifndef IDR_GET_NEW_RETURNS_ID
ret = idr_get_new(&node->nd_status_idr, nsw, &nsw->ns_id);
+#else
+ /* old semantics */
+ nsw->ns_id = idr_get_new(&node->nd_status_idr, nsw);
+ if (nsw->ns_id < 0)
+ ret = -EAGAIN;
+ else
+ ret = 0;
+#endif
if (ret == 0)
list_add_tail(&nsw->ns_node_item,
&node->nd_status_list);
More information about the Ocfs2-commits
mailing list