Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 May 2009 01:14:12 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r192501 - head/sys/nlm
Message-ID:  <200905210114.n4L1ECwk049828@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Thu May 21 01:14:12 2009
New Revision: 192501
URL: http://svn.freebsd.org/changeset/base/192501

Log:
  Add a function to sys/nlm/nlm_prot_impl.c that returns a unique
  lock sysid to be used for non-nlm remote locking. This is required
  for the experimental nfsv4 server, so that it can acquire byte
  range locks correctly on behalf of nfsv4 clients.
  
  Reviewed by:	dfr
  Approved by:	kib (mentor)

Modified:
  head/sys/nlm/nlm.h
  head/sys/nlm/nlm_prot_impl.c

Modified: head/sys/nlm/nlm.h
==============================================================================
--- head/sys/nlm/nlm.h	Thu May 21 01:05:21 2009	(r192500)
+++ head/sys/nlm/nlm.h	Thu May 21 01:14:12 2009	(r192501)
@@ -210,6 +210,11 @@ struct vop_reclaim_args;
 extern int nlm_advlock(struct vop_advlock_args *ap);
 extern int nlm_reclaim(struct vop_reclaim_args *ap);
 
+/*
+ * Acquire the next sysid for remote locks not handled by the NLM.
+ */
+extern uint32_t nlm_acquire_next_sysid(void);
+
 #endif
 
 #endif

Modified: head/sys/nlm/nlm_prot_impl.c
==============================================================================
--- head/sys/nlm/nlm_prot_impl.c	Thu May 21 01:05:21 2009	(r192500)
+++ head/sys/nlm/nlm_prot_impl.c	Thu May 21 01:14:12 2009	(r192501)
@@ -835,6 +835,20 @@ nlm_create_host(const char* caller_name)
 }
 
 /*
+ * Acquire the next sysid for remote locks not handled by the NLM.
+ */
+uint32_t
+nlm_acquire_next_sysid(void)
+{
+	uint32_t next_sysid;
+
+	mtx_lock(&nlm_global_lock);
+	next_sysid = nlm_next_sysid++;
+	mtx_unlock(&nlm_global_lock);
+	return (next_sysid);
+}
+
+/*
  * Return non-zero if the address parts of the two sockaddrs are the
  * same.
  */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905210114.n4L1ECwk049828>