From owner-svn-src-head@FreeBSD.ORG Thu May 21 01:14:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34D0810656A7; Thu, 21 May 2009 01:14:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FE1C8FC4C; Thu, 21 May 2009 01:14:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4L1ECHH049830; Thu, 21 May 2009 01:14:12 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4L1ECwk049828; Thu, 21 May 2009 01:14:12 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200905210114.n4L1ECwk049828@svn.freebsd.org> From: Rick Macklem Date: Thu, 21 May 2009 01:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192501 - head/sys/nlm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 01:14:30 -0000 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. */