[Ocfs2-commits] manish commits r2552 - in trunk: . fs/configfs fs/ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Aug 26 18:36:22 CDT 2005


Author: manish
Signed-off-by: zab
Signed-off-by: jlbec
Date: 2005-08-26 18:36:19 -0500 (Fri, 26 Aug 2005)
New Revision: 2552

Modified:
   trunk/Config.make.in
   trunk/configure.in
   trunk/fs/configfs/Makefile
   trunk/fs/configfs/symlink.c
   trunk/fs/ocfs2/Makefile
   trunk/fs/ocfs2/symlink.c
Log:
Changes to handle the new follow_link API introduced in 2.6.13-rc7

Signed-off-by: zab
Signed-off-by: jlbec


Modified: trunk/Config.make.in
===================================================================
--- trunk/Config.make.in	2005-08-26 19:28:42 UTC (rev 2551)
+++ trunk/Config.make.in	2005-08-26 23:36:19 UTC (rev 2552)
@@ -57,6 +57,7 @@
 INET_SK_RETURNS_INET_OPT = @INET_SK_RETURNS_INET_OPT@
 HAVE_SPARSE_ENDIAN_TYPES = @HAVE_SPARSE_ENDIAN_TYPES@
 HAVE_GENERIC_READLINK = @HAVE_GENERIC_READLINK@
+NEW_FOLLOW_LINK_API = @NEW_FOLLOW_LINK_API@
 
 OCFS_DEBUG = @OCFS_DEBUG@
 

Modified: trunk/configure.in
===================================================================
--- trunk/configure.in	2005-08-26 19:28:42 UTC (rev 2551)
+++ trunk/configure.in	2005-08-26 23:36:19 UTC (rev 2552)
@@ -258,6 +258,11 @@
   HAVE_GENERIC_READLINK=yes, , [generic_readlink(])
 AC_SUBST(HAVE_GENERIC_READLINK)
 
+NEW_FOLLOW_LINK_API=
+OCFS2_CHECK_KERNEL([for follow_link inode operation returning void *], fs.h,
+  NEW_FOLLOW_LINK_API=yes, , [void \* (\*follow_link)])
+AC_SUBST(NEW_FOLLOW_LINK_API)
+
 # 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/configfs/Makefile
===================================================================
--- trunk/fs/configfs/Makefile	2005-08-26 19:28:42 UTC (rev 2551)
+++ trunk/fs/configfs/Makefile	2005-08-26 23:36:19 UTC (rev 2552)
@@ -21,6 +21,10 @@
 EXTRA_CFLAGS += -DHAVE_GENERIC_READLINK
 endif
 
+ifdef NEW_FOLLOW_LINK_API
+EXTRA_CFLAGS += -DNEW_FOLLOW_LINK_API
+endif
+
 INSTALL_MOD_DIR := fs/configfs
 
 obj-m		:= configfs.o configfs_example.o bobtest.o

Modified: trunk/fs/configfs/symlink.c
===================================================================
--- trunk/fs/configfs/symlink.c	2005-08-26 19:28:42 UTC (rev 2551)
+++ trunk/fs/configfs/symlink.c	2005-08-26 23:36:19 UTC (rev 2552)
@@ -281,13 +281,13 @@
 
 	return error;
 }
-#else
+#elif !defined(NEW_FOLLOW_LINK_API)
 static int configfs_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
 	int error = -ENOMEM;
 	unsigned long page = get_zeroed_page(GFP_KERNEL);
 	if (page)
-		error = configfs_getlink(dentry, (char *) page);
+		error = configfs_getlink(dentry, (char *)page);
 	nd_set_link(nd, error ? ERR_PTR(error) : (char *)page);
 	return 0;
 }
@@ -298,6 +298,32 @@
 	if (!IS_ERR(page))
 		free_page((unsigned long)page);
 }
+#else
+static void *configfs_follow_link(struct dentry *dentry, struct nameidata *nd)
+{
+	int error = -ENOMEM;
+	unsigned long page = get_zeroed_page(GFP_KERNEL);
+
+	if (page) {
+		error = configfs_getlink(dentry, (char *)page);
+		if (!error) {
+			nd_set_link(nd, (char *)page);
+			return (void *)page;
+		}
+	}
+
+	nd_set_link(nd, ERR_PTR(error));
+	return NULL;
+}
+
+static void configfs_put_link(struct dentry *dentry, struct nameidata *nd,
+			      void *cookie)
+{
+	if (cookie) {
+		unsigned long page = (unsigned long)cookie;
+		free_page(page);
+	}
+}
 #endif
 
 struct inode_operations configfs_symlink_inode_operations = {

Modified: trunk/fs/ocfs2/Makefile
===================================================================
--- trunk/fs/ocfs2/Makefile	2005-08-26 19:28:42 UTC (rev 2551)
+++ trunk/fs/ocfs2/Makefile	2005-08-26 23:36:19 UTC (rev 2552)
@@ -26,6 +26,10 @@
 EXTRA_CFLAGS += -DJOURNAL_ACCESS_WITH_CREDITS
 endif
 
+ifdef NEW_FOLLOW_LINK_API
+EXTRA_CFLAGS += -DNEW_FOLLOW_LINK_API
+endif
+
 EXTRA_CFLAGS += -DOCFS2_DELETE_INODE_WORKAROUND
 EXTRA_CFLAGS += -DOCFS2_CDSL
 

Modified: trunk/fs/ocfs2/symlink.c
===================================================================
--- trunk/fs/ocfs2/symlink.c	2005-08-26 19:28:42 UTC (rev 2551)
+++ trunk/fs/ocfs2/symlink.c	2005-08-26 23:36:19 UTC (rev 2552)
@@ -377,8 +377,13 @@
 }
 #endif
 
+#ifndef NEW_FOLLOW_LINK_API
 static int ocfs2_follow_link(struct dentry *dentry,
 			     struct nameidata *nd)
+#else
+static void *ocfs2_follow_link(struct dentry *dentry,
+			       struct nameidata *nd)
+#endif
 {
 	int status;
 	char *link;
@@ -411,7 +416,11 @@
 	if (bh)
 		brelse(bh);
 
+#ifndef NEW_FOLLOW_LINK_API
 	return status;
+#else
+	return ERR_PTR(status);
+#endif
 }
 
 struct inode_operations ocfs2_symlink_inode_operations = {



More information about the Ocfs2-commits mailing list