PERFORCE change 117829 for review

Robert Watson rwatson at FreeBSD.org
Tue Apr 10 11:47:46 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=117829

Change 117829 by rwatson at rwatson_cinnamon_afs on 2007/04/10 11:47:36

	Integrate additional changes from Arla vendor branch, 2007/04/07
	CVS export.

Affected files ...

.. //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs.h#2 integrate
.. //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs_blocks_locl.h#2 integrate
.. //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs_dev.h#2 integrate
.. //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs_fs.h#2 integrate
.. //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs_locl.h#3 integrate
.. //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs_msg_locl.h#2 integrate
.. //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs_node.h#2 integrate
.. //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs_vfsops-bsd.h#3 integrate

Differences ...

==== //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs.h#2 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  */
 
-/* $Id: nnpfs.h,v 1.10 2006/10/31 12:40:08 tol Exp $ */
+/* $Id: nnpfs.h,v 1.12 2007/03/28 12:05:46 tol Exp $ */
 
 #ifndef _bsd_nnpfs_h
 #define _bsd_nnpfs_h 1
@@ -83,7 +83,6 @@
 #define CHANNEL_CLOSING 0x10
     struct mount *mp;
     struct nnpfs_node *root;
-    int fd;
     struct nnpfs_nodelist_head nodehead;
     struct nh_node_list freehead;
     /* char device */
@@ -108,11 +107,15 @@
      * This is sort of a substitute for GIANT, and we should split it
      * up. The node lists are good candidates for a separate lock.
      */
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__FreeBSD__)
     struct {
 	int recurse;
 	nnpfs_mutex_t lock;
+#if defined(__APPLE__)
 	thread_t locker;
+#else
+	d_thread_t *locker;
+#endif
     } lock;
 #else
   nnpfs_mutex_t dev_lock;

==== //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs_blocks_locl.h#2 (text+ko) ====

@@ -31,7 +31,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-/* $Id: nnpfs_blocks_locl.h,v 1.2 2006/10/24 16:33:13 tol Exp $ */
+/* $Id: nnpfs_blocks_locl.h,v 1.3 2007/01/24 17:05:31 tol Exp $ */
 
 typedef struct nnpfs_cache_handle {
     /* use bitmasks. not good when one needs one 'handle' per block */
@@ -115,4 +115,4 @@
 		 struct vnode **vp);
 
 void
-nnpfs_block_close(struct vnode *, int);
+nnpfs_block_close(struct nnpfs_node *node, struct vnode *vp, int rw);

==== //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs_dev.h#2 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  */
 
-/* $Id: nnpfs_dev.h,v 1.25 2006/10/24 16:33:15 tol Exp $ */
+/* $Id: nnpfs_dev.h,v 1.26 2007/03/28 12:05:47 tol Exp $ */
 
 #ifndef _nnpfs_dev_h
 #define _nnpfs_dev_h
@@ -96,24 +96,26 @@
 #endif
 
 int
-nnpfs_message_send(int fd, struct nnpfs_message_header * message, u_int size);
+nnpfs_message_send(struct nnpfs *chan, struct nnpfs_message_header * message, u_int size);
 
 int
-nnpfs_message_rpc(int fd, struct nnpfs_message_header * message, u_int size,
+nnpfs_message_rpc(struct nnpfs *nnpfsp,
+		  struct nnpfs_message_header *message, u_int size,
 		  d_thread_t *proc);
 
 int
-nnpfs_message_rpc_async(int fd, struct nnpfs_message_header * message, u_int size,
+nnpfs_message_rpc_async(struct nnpfs *nnpfsp,
+			struct nnpfs_message_header *message, u_int size,
 			d_thread_t *proc);
 
 int
-nnpfs_message_receive(int fd,
+nnpfs_message_receive(struct nnpfs *nnpfsp,
 		    struct nnpfs_message_header *message,
 		    u_int size,
 		    d_thread_t *p);
 
 int
-nnpfs_message_wakeup(int fd,
+nnpfs_message_wakeup(struct nnpfs *chan,
 		   struct nnpfs_message_wakeup *message,
 		   u_int size,
 		   d_thread_t *p);

==== //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs_fs.h#2 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  */
 
-/* $Id: nnpfs_fs.h,v 1.30 2006/10/24 16:33:16 tol Exp $ */
+/* $Id: nnpfs_fs.h,v 1.33 2007/03/14 16:44:30 tol Exp $ */
 
 #ifndef _nnpfs_h
 #define _nnpfs_h
@@ -61,12 +61,19 @@
 
 #define NNPFS_FROM_XNODE(xp) NNPFS_FROM_VNODE(XNODE_TO_VNODE(xp))
 
+#ifdef __FreeBSD__
+extern struct vop_vector nnpfs_vnodeops;
+#else
 extern struct vnodeops nnpfs_vnodeops;
+extern vop_t **nnpfs_vnodeop_p;
+#endif
 
 int nnpfs_new_node(struct nnpfs *, struct nnpfs_msg_node *, char *,
 		   struct nnpfs_node **, d_thread_t *, int);
 void nnpfs_free_node(struct nnpfs *nnpfsp, struct nnpfs_node *node);
 int nnpfs_free_all_nodes(struct nnpfs *, int, int);
+void nnpfs_release_cachevn(struct nnpfs_node *node);
+void nnpfs_release_data(struct nnpfs_node *node);
 
 int nnpfs_dnlc_enter(struct vnode *, nnpfs_componentname *, struct vnode *);
 int nnpfs_dnlc_enter_name(struct vnode *, char *, struct vnode *);

==== //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs_locl.h#3 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  */
 
-/* $Id: nnpfs_locl.h,v 1.110 2007/01/08 13:09:37 tol Exp $ */
+/* $Id: nnpfs_locl.h,v 1.113 2007/03/06 16:01:56 tol Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -77,6 +77,9 @@
 #ifdef HAVE_SYS_STATVFS_H
 #include <sys/statvfs.h>
 #endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
 #include <sys/vnode.h>
 #ifdef __APPLE__
 #include <sys/vnode_if.h>
@@ -157,6 +160,11 @@
 #include <sys/kauth.h>
 #endif
 
+#ifdef __FreeBSD__
+#include <sys/bio.h>
+#include <sys/buf.h>
+#endif
+
 #if defined(__FreeBSD__)
 #define nnpfs_assert(x) \
 do { if(!(x)) panic("nnpfs_assert(" #x ") failed"); } while(0);
@@ -205,8 +213,16 @@
 #define nnpfs_tsleep(chan, pri, msg)	\
 	tsleep((chan), (pri), (msg), 0)
 
+#if defined(__FreeBSD__)
+#define nnpfs_msleep(chan, mtx, pri, msg)		\
+	msleep((chan), (mtx), (pri), (msg), 0)
+#elif defined(__NetBSD__)
+#define nnpfs_msleep(chan, mtx, pri, msg)		\
+	ltsleep((chan), (pri), (msg), 0, (mtx)) /* XXX */
+#else
 #define nnpfs_msleep(chan, mtx, pri, msg)		\
 	tsleep((chan), (pri), (msg), 0) /* XXX */
+#endif
 
 #endif /* !__APPLE__ */
 
@@ -239,16 +255,10 @@
 
 
 #if defined(__FreeBSD_version) || defined(__DragonFly__)
-#if __FreeBSD_version < 400000
+#if __FreeBSD_version < 600006
 # error This version is unsupported
-#elif __FreeBSD_version < 440001 || (__FreeBSD_version >= 500000 && __FreeBSD_version < 500023)
-typedef struct proc d_thread_t;
-#elif __FreeBSD_version == 500023
-#   define HAVE_FREEBSD_THREAD
-typedef struct thread d_thread_t;
-#elif __FreeBSD_version >= 500024 || defined(__DragonFly__)
-#   define HAVE_FREEBSD_THREAD
 #endif
+#define HAVE_FREEBSD_THREAD
 typedef d_thread_t syscall_d_thread_t;
 #define syscall_thread_to_thread(x) (x)
 #else /* !__FreeBSD_version || __DragonFly__ */
@@ -461,6 +471,12 @@
 #define NNPFS_LOCKLEAF 0
 #endif
 
+#ifdef MPSAFE
+#define NNPFS_MPSAFE MPSAFE
+#else
+#define NNPFS_MPSAFE 0
+#endif
+
 #if defined(HAVE_SYS_MUTEX_H) && !defined(OpenBSD)
 #define nnpfs_interlock_lock(interlock) mtx_lock(interlock);
 #define nnpfs_interlock_unlock(interlock) mtx_unlock(interlock);

==== //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs_msg_locl.h#2 (text+ko) ====

@@ -31,67 +31,67 @@
  * SUCH DAMAGE.
  */
 
-/* $Id: nnpfs_msg_locl.h,v 1.9 2006/10/24 16:33:18 tol Exp $ */
+/* $Id: nnpfs_msg_locl.h,v 1.10 2007/03/28 12:05:47 tol Exp $ */
 
 #ifndef _nnpfs_msg_locl_h
 #define _nnpfs_msg_locl_h
 
 int
-nnpfs_message_installroot(int fd,
+nnpfs_message_installroot(struct nnpfs *nnpfsp,
 			  struct nnpfs_message_installroot * message,
 			  u_int size,
 			  d_thread_t *p);
 
 int
-nnpfs_message_installnode(int fd,
+nnpfs_message_installnode(struct nnpfs *nnpfsp,
 			  struct nnpfs_message_installnode * message,
 			  u_int size,
 			  d_thread_t *p);
 
 int
-nnpfs_message_installattr(int fd,
+nnpfs_message_installattr(struct nnpfs *nnpfsp,
 			  struct nnpfs_message_installattr * message,
 			  u_int size,
 			  d_thread_t *p);
 
 int
-nnpfs_message_installdata(int fd,
+nnpfs_message_installdata(struct nnpfs *nnpfsp,
 			  struct nnpfs_message_installdata * message,
 			  u_int size,
 			  d_thread_t *p);
 
 int
-nnpfs_message_invalidnode(int fd,
+nnpfs_message_invalidnode(struct nnpfs *nnpfsp,
 			  struct nnpfs_message_invalidnode * message,
 			  u_int size,
 			  d_thread_t *p);
 
 int
-nnpfs_message_updatefid(int fd,
+nnpfs_message_updatefid(struct nnpfs *nnpfsp,
 			struct nnpfs_message_updatefid * message,
 			u_int size,
 			d_thread_t *p);
 
 int
-nnpfs_message_gc(int fd,
+nnpfs_message_gc(struct nnpfs *nnpfsp,
 		 struct nnpfs_message_gc *message,
 		 u_int size,
 		 d_thread_t *p);
 
 int
-nnpfs_message_version(int fd,
+nnpfs_message_version(struct nnpfs *nnpfsp,
 		      struct nnpfs_message_version *message,
 		      u_int size,
 		      d_thread_t *p);
 
 int
-nnpfs_message_delete_node(int fd,
+nnpfs_message_delete_node(struct nnpfs *nnpfsp,
 			  struct nnpfs_message_delete_node *message,
 			  u_int size,
 			  d_thread_t *p);
 
 int
-nnpfs_message_installquota(int fd,
+nnpfs_message_installquota(struct nnpfs *nnpfsp,
 			   struct nnpfs_message_installquota *message,
 			   u_int size,
 			   d_thread_t *p);

==== //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs_node.h#2 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  */
 
-/* 	$Id: nnpfs_node.h,v 1.45 2006/10/24 16:33:19 tol Exp $	 */
+/* 	$Id: nnpfs_node.h,v 1.47 2007/03/06 16:01:56 tol Exp $	 */
 
 #ifndef _nnpfs_xnode_h
 #define _nnpfs_xnode_h
@@ -113,8 +113,13 @@
 
 #else
 
+#if defined(__FreeBSD__) && __FreeBSD_version >= 600000
+#define nnpfs_vrecycle(vp, foo, bar) vrecycle(vp, bar)
+#else
+#define nnpfs_vrecycle(vp, foo, bar) vrecycle(vp, foo, bar)
+#endif
+
 #define nnpfs_vrele(vp) vrele(vp)
-#define nnpfs_vrecycle(vp, foo, bar) vrecycle(vp, foo, bar)
 #define nnpfs_vput(vp) vput(vp)
 #define nnpfs_vref(vp) VREF(vp)
 #define nnpfs_vletgo(vn) nnpfs_vrele(vn)
@@ -193,6 +198,7 @@
     struct vnode *vn;
     uint32_t index;
     struct nnpfs_cache_handle data;
+    struct vnode *cache_vn;
     struct nnpfs_vfs_vattr attr;
     uint64_t daemon_length;
 #ifdef __APPLE__
@@ -206,11 +212,15 @@
     nnpfs_pag_t id[NNPFS_MAXRIGHTS];
     nnpfs_rights rights[NNPFS_MAXRIGHTS];
     nnpfs_rights anonrights;
+
+#ifndef __FreeBSD__
 #if (defined(HAVE_KERNEL_LOCKMGR) || defined(HAVE_KERNEL_DEBUGLOCKMGR)) && !defined(__APPLE__)
     nnpfs_vnode_lock lock;
 #else
     int vnlocks;
 #endif
+#endif /* !__FreeBSD__ */
+
 #ifdef HAVE_KERNEL_LF_ADVLOCK
 #ifdef __DragonFly__
     struct   lockf lockf;
@@ -274,8 +284,12 @@
 
 
 #ifndef HAVE_VOP_T
+#if defined(__FreeBSD_version) && __FreeBSD_version > 600006
+typedef struct vop_vector vop_t;
+#else
 typedef int vop_t (void *);
 #endif
+#endif
 
 #ifdef LK_INTERLOCK
 #define HAVE_LK_INTERLOCK

==== //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs_vfsops-bsd.h#3 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  */
 
-/* $Id: nnpfs_vfsops-bsd.h,v 1.24 2006/09/01 14:37:28 tol Exp $ */
+/* $Id: nnpfs_vfsops-bsd.h,v 1.25 2007/03/06 16:01:56 tol Exp $ */
 
 #ifndef _nnpfs_vfsops_bsd_h
 #define _nnpfs_vfsops_bsd_h
@@ -87,7 +87,7 @@
 int
 nnpfs_statfs(struct mount *mp, nnpfs_statvfs *sbp, d_thread_t *p);
 
-#ifdef __DragonFly__
+#if defined(__DragonFly__) || (defined(__FreeBSD_version) && __FreeBSD_version > 600006)
 int
 nnpfs_sync(struct mount *mp, int waitfor, d_thread_t *p);
 #else


More information about the p4-projects mailing list