arla 0.13

Assar Westerlund assar at sics.se
Mon Oct 5 23:05:31 CEST 1998


Jim Nance <jim at sailboat.acs.uncwil.edu> writes:
> I made this patch for xfs_follow_link() because a paramater got added
> the the linux follow_link function around 2.1.123.  I am not really familiar
> with the arla code, but this looks like the modification that was made
> to the ext2 code, so I am assuming its correct.

Thanks for your patch.  I autoconf-ed so that it should work on other
versions of 2.1 as well.  Could you please try this and tell me it it
works for you?  (You'll need to run `autoreconf' after having applied
the patch and re-run configure.)

/assar


Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/arla/configure.in,v
retrieving revision 1.172
diff -u -w -u -w -r1.172 configure.in
--- configure.in	1998/10/05 01:24:44	1.172
+++ configure.in	1998/10/05 21:03:50
@@ -1083,6 +1083,19 @@
   AC_DEFINE(HAVE_READ_SUPER_FOUR_ARGS)
 fi
 
+AC_CACHE_CHECK(if follow_link takes the follow argument,
+ac_cv_func_follow_link_three_args,
+AC_TRY_COMPILE_KERNEL([#include <linux/fs.h>],
+[struct inode_operations xfs_operations;
+xfs_operations.follow_link(NULL, NULL, 0);
+],
+ac_cv_func_follow_link_three_args=yes,
+ac_cv_func_follow_link_three_args=no))
+
+if test "$ac_cv_func_follow_link_three_args" = "yes"; then
+  AC_DEFINE(HAVE_FOLLOW_LINK_THREE_ARGS)
+fi
+
 dnl
 dnl Find out if have have proc.p_sigmask
 dnl
Index: acconfig.h
===================================================================
RCS file: /usr/local/cvsroot/arla/acconfig.h,v
retrieving revision 1.47
diff -u -w -u -w -r1.47 acconfig.h
--- acconfig.h	1998/10/04 01:41:19	1.47
+++ acconfig.h	1998/10/05 21:04:30
@@ -278,6 +278,9 @@
 /* Define this if the read_super superoperation takes the dir_d argument */
 #undef HAVE_READ_SUPER_FOUR_ARGS
 
+/* Define this if the follow_link inode-operation takes the follow argument */
+#undef HAVE_FOLLOW_LINK_THREE_ARGS
+
 /*
  * Defining this enables lots of useful (and used) extensions on
  * glibc-based systems such as Linux
Index: xfs/linux/xfs_inodeops.c
===================================================================
RCS file: /usr/local/cvsroot/arla/xfs/linux/xfs_inodeops.c,v
retrieving revision 1.56
diff -u -w -u -w -r1.56 xfs_inodeops.c
--- xfs_inodeops.c	1998/10/02 04:41:37	1.56
+++ xfs_inodeops.c	1998/10/05 21:04:59
@@ -149,6 +149,9 @@
 static int
 xfs_follow_link(struct inode * dir, struct inode * inode,
 		int flag, int mode, struct inode ** res_inode);
+#elif defined(HAVE_FOLLOW_LINK_THREE_ARGS)
+static struct dentry *
+xfs_follow_link(struct dentry *, struct dentry *, unsigned int);
 #else
 static struct dentry *
 xfs_follow_link(struct dentry *, struct dentry *);
@@ -1707,11 +1710,22 @@
     return error;
 }
 #else
+#if HAVE_FOLLOW_LINK_THREE_ARGS
+static struct dentry *
+xfs_follow_link(struct dentry *dentry,
+		struct dentry *base,
+		unsigned int follow)
+#else
 static struct dentry *
 xfs_follow_link(struct dentry *dentry, struct dentry *base)
+#endif
 {
     char *buffer;
     int error;
+#ifndef HAVE_FOLLOW_LINK_THREE_ARGS
+    int follow = 1;
+#endif
+
     XFSDEB(XDEBVNOPS, ("xfs_follow_link "));
     xfs_print_path(dentry);
     XFSDEB(XDEBVNOPS, ("base: "));
@@ -1734,7 +1748,7 @@
     if (error <= MAXPATHLEN)
 	buffer[error]='\0';
     XFSDEB(XDEBVNOPS, ("xfs_follow_link linkname: %s\n", buffer));
-    base = lookup_dentry(buffer, base, 1);
+    base = lookup_dentry(buffer, base, follow);
     xfs_free(buffer);
     return base;
 }





More information about the Arla-drinkers mailing list