From owner-svn-src-user@FreeBSD.ORG  Tue Jan  5 23:09:34 2010
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5F478106566B;
	Tue,  5 Jan 2010 23:09:34 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4ED278FC14;
	Tue,  5 Jan 2010 23:09:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05N9YhU041396;
	Tue, 5 Jan 2010 23:09:34 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05N9Yo6041394;
	Tue, 5 Jan 2010 23:09:34 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <201001052309.o05N9Yo6041394@svn.freebsd.org>
From: Kip Macy <kmacy@FreeBSD.org>
Date: Tue, 5 Jan 2010 23:09:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r201623 - user/kmacy/releng_8_rump/lib/libunet
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
	src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
	<mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
	<mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Jan 2010 23:09:34 -0000

Author: kmacy
Date: Tue Jan  5 23:09:34 2010
New Revision: 201623
URL: http://svn.freebsd.org/changeset/base/201623

Log:
  shim sx locks

Modified:
  user/kmacy/releng_8_rump/lib/libunet/unet_lock.c

Modified: user/kmacy/releng_8_rump/lib/libunet/unet_lock.c
==============================================================================
--- user/kmacy/releng_8_rump/lib/libunet/unet_lock.c	Tue Jan  5 23:03:59 2010	(r201622)
+++ user/kmacy/releng_8_rump/lib/libunet/unet_lock.c	Tue Jan  5 23:09:34 2010	(r201623)
@@ -277,19 +277,29 @@ _rm_runlock(struct rmlock *rm,  struct r
 }
 
 
+struct lock_class lock_class_sx = {
+	.lc_name = "sx",
+	.lc_flags = LC_SLEEPLOCK | LC_SLEEPABLE | LC_RECURSABLE | LC_UPGRADABLE,
+#ifdef DDB
+	.lc_ddb_show = db_show_sx,
+#endif
+#ifdef KDTRACE_HOOKS
+	.lc_owner = owner_sx,
+#endif
+};
 
 void
 sx_init_flags(struct sx *sx, const char *description, int opts)
 {
 
-	panic("");
+	rw_init_flags((struct rwlock *)sx, description, opts);
 }
 
 void
 sx_destroy(struct sx *sx)
 {
 
-	panic("");
+	rw_destroy((struct rwlock *)sx);
 }
 
 int
@@ -297,7 +307,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t 
     const char *file, int line)
 {
 	
-	panic("");
+	_rw_wlock((struct rwlock *)sx, file, line);
 	return (0);
 }
 
@@ -305,7 +315,7 @@ int
 _sx_slock_hard(struct sx *sx, int opts, const char *file, int line)
 {
 	
-	panic("");
+	_rw_rlock((struct rwlock *)sx, file, line);
 	return (0);
 }
 
@@ -314,21 +324,20 @@ _sx_xunlock_hard(struct sx *sx, uintptr_
     line)
 {
 	
-	panic("");
+	_rw_wunlock((struct rwlock *)sx, file, line);
 }
 
 void
 _sx_sunlock_hard(struct sx *sx, const char *file, int line)
 {
 	
-	panic("");
+	_rw_runlock((struct rwlock *)sx, file, line);
 }
 
 int
 _sx_try_xlock(struct sx *sx, const char *file, int line)
 {
-	
-	panic("");
-	return (0);
+
+	return (_rw_try_wlock((struct rwlock *)sx, file, line));
 }