Re: towards getting netbsd 4 supported as well as 3 is

Pavel Cahyna <[email protected]>
Newsgroups gmane.comp.file-systems.arla.general
Message-ID <[email protected]>
hello,

I have applied your patch and arla compiles. Now, there was a VFS API
change in NetBSD-current in last December [1] which was pulled up to netbsd-4,
so the following patch is needed. Thanks to Chuck Silvers for review.

Without it, a DIAGNOSTIC kernel crashes soon with a panic from lockmgr.

I have used arla with this change for a long time and it seems stable.

Could please someone commit this change to an arla stable branch?

BTW what functionality is lost by removal of the filehandle functionality?
Is nnpfs supposed to be nfs-re-exportable?

Pavel

[1] http://mail-index.netbsd.org/source-changes/2006/12/09/0025.html

On Thu, May 24, 2007 at 09:37:23AM -0500, Jonathan A. Kollasch wrote:
> Hi,
> 
> for starters, here's how you get a basic arla client on netbsd-4:
> 
> in nnpfs/bsd/nnpfs_vfsops-bsd.c 
> before nnpfs_fhlookup(), make it so that it is compiled on NetBSD:
> 
> -#ifdef __APPLE__
> +#if defined(__APPLE__) || defined(__NetBSD__)
> 
> remove the HAVE_GETFH and HAVE_FHOPEN #defines in include/config.h after running configure
> 
> 
> I suppose I could learn autoconf ...
> 
> However, PAGs will not work at this point.  Converting to kauth(9) calls
> looks very doable with some work and thought.  I might start looking
> at this.
> 
> 	Jonathan Kollasch



> _______________________________________________
> Arla-drinkers mailing list
> [email protected]
> https://lists.stacken.kth.se/mailman/listinfo/arla-drinkers

_______________________________________________
Arla-drinkers mailing list
[email protected]
https://lists.stacken.kth.se/mailman/listinfo/arla-drinkers
lookup.diff (text/x-diff, 1.9 KB)
Index: nnpfs_vfsops-bsd.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/nnpfs/bsd/nnpfs_vfsops-bsd.c,v
retrieving revision 1.101
diff -u -p -r1.101 nnpfs_vfsops-bsd.c
--- nnpfs_vfsops-bsd.c	1 Sep 2006 14:37:27 -0000	1.101
+++ nnpfs_vfsops-bsd.c	16 Jun 2007 14:07:06 -0000
@@ -370,7 +370,7 @@ nnpfs_dead_putpages (struct vop_putpages
  * error otherwise.  
  */
 
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__NetBSD__)
 
 int
 nnpfs_fhlookup (d_thread_t *proc,
Index: nnpfs_vnodeops-bsd.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/nnpfs/bsd/nnpfs_vnodeops-bsd.c,v
retrieving revision 1.156
diff -u -p -r1.156 nnpfs_vnodeops-bsd.c
--- nnpfs_vnodeops-bsd.c	12 Jun 2006 19:39:59 -0000	1.156
+++ nnpfs_vnodeops-bsd.c	21 Jun 2007 22:37:42 -0000
@@ -283,8 +283,10 @@ nnpfs_lookup(struct vop_lookup_args * ap
     nnpfs_vfs_context ctx;
     int error;
 
+#if !defined(__NetBSD__) || (__NetBSD_Version__ < 499000600 && __NetBSD_Version__ >= 499000000) || __NetBSD_Version__ < 400000002
     int lockparent = (cnp->cn_flags & (LOCKPARENT | ISLASTCN))
 	== (LOCKPARENT | ISLASTCN);
+#endif
 
     NNPFSDEB(XDEBVNOPS, ("nnpfs_lookup: (%s, %ld), nameiop = %lu, flags = %lu\n",
 		       cnp->cn_nameptr,
@@ -308,6 +310,7 @@ nnpfs_lookup(struct vop_lookup_args * ap
     if (cnp->cn_nameiop != LOOKUP && cnp->cn_flags & ISLASTCN)
 	cnp->cn_flags |= SAVENAME;
 
+#if !defined(__NetBSD__) || (__NetBSD_Version__ < 499000600 && __NetBSD_Version__ >= 499000000) || __NetBSD_Version__ < 400000002
     if (error == 0 || error == EJUSTRETURN) {
 	if (ap->a_dvp == *(ap->a_vpp)) {
 	    /* if we looked up ourself, do nothing */
@@ -323,6 +326,7 @@ nnpfs_lookup(struct vop_lookup_args * ap
     } else {
 	/* in case of a error do nothing  */
     } 
+#endif
     
     NNPFSDEB(XDEBVNOPS, ("nnpfs_lookup: error = %d\n", error));
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.