PATCH: Arla CVS Current on OpenBSD 4.3

Bo Brantén bosse at acc.umu.se
Thu Oct 30 18:34:15 CET 2008


I updated the patch with a few "OpenBSD >= 200805" so that it still 
compiles on older versions of OpenBSD in adition to 4.3.

diff -uprN arla-cvs/nnpfs/bsd/nnpfs/nnpfs_node.h arla-cvs-new/nnpfs/bsd/nnpfs/nnpfs_node.h
--- arla-cvs/nnpfs/bsd/nnpfs/nnpfs_node.h	2007-03-06 17:01:56.000000000 +0100
+++ arla-cvs-new/nnpfs/bsd/nnpfs/nnpfs_node.h	2008-10-30 20:11:43.000000000 +0100
@@ -113,7 +113,7 @@ typedef struct lock nnpfs_vnode_lock;

  #else

-#if defined(__FreeBSD__) && __FreeBSD_version >= 600000
+#if (defined(__FreeBSD__) && __FreeBSD_version >= 600000 || defined(__OpenBSD__) && OpenBSD >= 200805)
  #define nnpfs_vrecycle(vp, foo, bar) vrecycle(vp, bar)
  #else
  #define nnpfs_vrecycle(vp, foo, bar) vrecycle(vp, foo, bar)
diff -uprN arla-cvs/nnpfs/bsd/nnpfs/nnpfs_vfsops-bsd.h arla-cvs-new/nnpfs/bsd/nnpfs/nnpfs_vfsops-bsd.h
--- arla-cvs/nnpfs/bsd/nnpfs/nnpfs_vfsops-bsd.h	2008-02-26 22:59:18.000000000 +0100
+++ arla-cvs-new/nnpfs/bsd/nnpfs/nnpfs_vfsops-bsd.h	2008-10-30 20:13:19.000000000 +0100
@@ -79,7 +79,7 @@ int
  nnpfs_root(struct mount *mp, struct vnode **vpp);

  int
-#ifdef HAVE_VFS_QUOTACTL_CADDR
+#if (defined(HAVE_VFS_QUOTACTL_CADDR) || defined (__OpenBSD__) && OpenBSD >= 200805)
  nnpfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg, d_thread_t *p);
  #else
  nnpfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg, d_thread_t *p);
diff -uprN arla-cvs/nnpfs/bsd/nnpfs_blocks.c arla-cvs-new/nnpfs/bsd/nnpfs_blocks.c
--- arla-cvs/nnpfs/bsd/nnpfs_blocks.c	2008-02-27 23:16:21.000000000 +0100
+++ arla-cvs-new/nnpfs/bsd/nnpfs_blocks.c	2008-10-23 18:44:04.000000000 +0200
@@ -469,8 +469,8 @@ open_file(struct vnode *cachedir, char *

  #ifdef __FreeBSD__
  	    (void)vn_start_write(cachedir, &mp, V_WAIT); /* V_NOWAIT? */
-#endif
  	    VOP_LEASE(cachedir, p, cred, LEASE_WRITE);
+#endif
  	    error = VOP_CREATE(cachedir, vpp, &nd.ni_cnd, &vat);

  #ifdef __FreeBSD__
diff -uprN arla-cvs/nnpfs/bsd/nnpfs_vfsops-bsd.c arla-cvs-new/nnpfs/bsd/nnpfs_vfsops-bsd.c
--- arla-cvs/nnpfs/bsd/nnpfs_vfsops-bsd.c	2008-02-26 22:59:11.000000000 +0100
+++ arla-cvs-new/nnpfs/bsd/nnpfs_vfsops-bsd.c	2008-10-30 20:14:39.000000000 +0100
@@ -84,7 +84,7 @@ nnpfs_root(struct mount *mp, struct vnod
  }

  int
-#ifdef HAVE_VFS_QUOTACTL_CADDR
+#if (defined(HAVE_VFS_QUOTACTL_CADDR) || defined (__OpenBSD__) && OpenBSD >= 200805)
  nnpfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg, d_thread_t *p)
  #else
  nnpfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg, d_thread_t *p)
diff -uprN arla-cvs/nnpfs/bsd/nnpfs_vnodeops-bsd.c arla-cvs-new/nnpfs/bsd/nnpfs_vnodeops-bsd.c
--- arla-cvs/nnpfs/bsd/nnpfs_vnodeops-bsd.c	2008-02-27 23:14:34.000000000 +0100
+++ arla-cvs-new/nnpfs/bsd/nnpfs_vnodeops-bsd.c	2008-10-30 20:20:43.000000000 +0100
@@ -902,8 +902,12 @@ nnpfs_lock(struct vop_lock_args * ap)
      ret = lockmgr(l, flags, &vp->v_interlock, NNPFS_AP_PROC(ap));
  #endif
  #else
+#if (defined(__OpenBSD__) && OpenBSD >= 200805)
+    ret = lockmgr(l, flags, NULL);
+#else
      ret = lockmgr(l, flags, &vp->v_interlock);
  #endif
+#endif
  #else
      ret = debuglockmgr(l, flags, &vp->v_interlock, NNPFS_AP_PROC(ap),
  		       "nnpfs_lock", ap->a_vp->filename, ap->a_vp->line);
@@ -948,8 +952,12 @@ nnpfs_unlock(struct vop_unlock_args * ap
      ret = lockmgr (l, flags | LK_RELEASE, &vp->v_interlock, NNPFS_AP_PROC(ap));
  #endif
  #else
+#if (defined(__OpenBSD__) && OpenBSD >= 200805)
+    ret = lockmgr (l, flags | LK_RELEASE, NULL);
+#else
      ret = lockmgr (l, flags | LK_RELEASE, &vp->v_interlock);
  #endif
+#endif
  #else
      ret = debuglockmgr (l, flags | LK_RELEASE, &vp->v_interlock, NNPFS_AP_PROC(ap),
  			"nnpfs_lock", ap->a_vp->filename, ap->a_vp->line);
diff -uprN arla-cvs/nnpfs/bsd/nnpfs_vnodeops-common.c arla-cvs-new/nnpfs/bsd/nnpfs_vnodeops-common.c
--- arla-cvs/nnpfs/bsd/nnpfs_vnodeops-common.c	2008-02-26 22:59:13.000000000 +0100
+++ arla-cvs-new/nnpfs/bsd/nnpfs_vnodeops-common.c	2008-10-23 19:54:31.000000000 +0200
@@ -1440,9 +1440,7 @@ nnpfs_readlink_common(struct vnode *vp,
      int error = 0;
      nnpfs_cred cred;
      struct nnpfs *nnpfsp = NNPFS_FROM_VNODE(vp);
-#ifdef HAVE_THREE_ARGUMENT_VOP_UNLOCK
      d_thread_t *proc = nnpfs_vfs_context_proc(ctx);
-#endif

      NNPFSDEB(XDEBVNOPS, ("nnpfs_readlink\n"));



More information about the Arla-drinkers mailing list