Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys * sprinkle KASSERT(solocked(so)); in all pr_stat() funct...



details:   https://anonhg.NetBSD.org/src/rev/5b1b4a14006a
branches:  trunk
changeset: 797161:5b1b4a14006a
user:      rtr <rtr%NetBSD.org@localhost>
date:      Mon Jul 07 17:13:56 2014 +0000

description:
* sprinkle KASSERT(solocked(so)); in all pr_stat() functions.
* fix remaining inconsistent struct socket parameter names.

diffstat:

 sys/kern/uipc_usrreq.c              |  6 ++++--
 sys/net/link_proto.c                |  6 ++++--
 sys/net/rtsock.c                    |  6 ++++--
 sys/netatalk/ddp_usrreq.c           |  6 ++++--
 sys/netbt/hci_socket.c              |  8 +++++---
 sys/netbt/l2cap_socket.c            |  8 +++++---
 sys/netbt/rfcomm_socket.c           |  8 +++++---
 sys/netbt/sco_socket.c              |  8 +++++---
 sys/netinet/raw_ip.c                |  6 ++++--
 sys/netinet/tcp_usrreq.c            |  6 ++++--
 sys/netinet/udp_usrreq.c            |  6 ++++--
 sys/netinet6/raw_ip6.c              |  6 ++++--
 sys/netinet6/udp6_usrreq.c          |  6 ++++--
 sys/netipsec/keysock.c              |  6 ++++--
 sys/netmpls/mpls_proto.c            |  6 ++++--
 sys/netnatm/natm.c                  |  6 ++++--
 sys/rump/net/lib/libsockin/sockin.c |  6 ++++--
 17 files changed, 72 insertions(+), 38 deletions(-)

diffs (truncated from 495 to 300 lines):

diff -r e458186a94f9 -r 5b1b4a14006a sys/kern/uipc_usrreq.c
--- a/sys/kern/uipc_usrreq.c    Mon Jul 07 15:22:07 2014 +0000
+++ b/sys/kern/uipc_usrreq.c    Mon Jul 07 17:13:56 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_usrreq.c,v 1.156 2014/07/06 03:33:33 rtr Exp $    */
+/*     $NetBSD: uipc_usrreq.c,v 1.157 2014/07/07 17:13:56 rtr Exp $    */
 
 /*-
  * Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.156 2014/07/06 03:33:33 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.157 2014/07/07 17:13:56 rtr Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -854,6 +854,8 @@
        struct unpcb *unp;
        struct socket *so2;
 
+       KASSERT(solocked(so));
+
        unp = sotounpcb(so);
        if (unp == NULL)
                return EINVAL;
diff -r e458186a94f9 -r 5b1b4a14006a sys/net/link_proto.c
--- a/sys/net/link_proto.c      Mon Jul 07 15:22:07 2014 +0000
+++ b/sys/net/link_proto.c      Mon Jul 07 17:13:56 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: link_proto.c,v 1.13 2014/07/06 16:06:19 rtr Exp $      */
+/*     $NetBSD: link_proto.c,v 1.14 2014/07/07 17:13:56 rtr Exp $      */
 
 /*-
  * Copyright (c) 1982, 1986, 1993
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: link_proto.c,v 1.13 2014/07/06 16:06:19 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: link_proto.c,v 1.14 2014/07/07 17:13:56 rtr Exp $");
 
 #include <sys/param.h>
 #include <sys/socket.h>
@@ -242,6 +242,8 @@
 static int
 link_stat(struct socket *so, struct stat *ub)
 {
+       KASSERT(solocked(so));
+
        return EOPNOTSUPP;
 }
 
diff -r e458186a94f9 -r 5b1b4a14006a sys/net/rtsock.c
--- a/sys/net/rtsock.c  Mon Jul 07 15:22:07 2014 +0000
+++ b/sys/net/rtsock.c  Mon Jul 07 17:13:56 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtsock.c,v 1.152 2014/07/07 15:13:21 rtr Exp $ */
+/*     $NetBSD: rtsock.c,v 1.153 2014/07/07 17:13:56 rtr Exp $ */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.152 2014/07/07 15:13:21 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.153 2014/07/07 17:13:56 rtr Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -233,6 +233,8 @@
 static int
 COMPATNAME(route_stat)(struct socket *so, struct stat *ub)
 {
+       KASSERT(solocked(so));
+
        return 0;
 }
 
diff -r e458186a94f9 -r 5b1b4a14006a sys/netatalk/ddp_usrreq.c
--- a/sys/netatalk/ddp_usrreq.c Mon Jul 07 15:22:07 2014 +0000
+++ b/sys/netatalk/ddp_usrreq.c Mon Jul 07 17:13:56 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ddp_usrreq.c,v 1.50 2014/07/07 15:13:21 rtr Exp $       */
+/*     $NetBSD: ddp_usrreq.c,v 1.51 2014/07/07 17:13:56 rtr Exp $       */
 
 /*
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ddp_usrreq.c,v 1.50 2014/07/07 15:13:21 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ddp_usrreq.c,v 1.51 2014/07/07 17:13:56 rtr Exp $");
 
 #include "opt_mbuftrace.h"
 
@@ -481,6 +481,8 @@
 static int
 ddp_stat(struct socket *so, struct stat *ub)
 {
+       KASSERT(solocked(so));
+
        /* stat: don't bother with a blocksize. */
        return 0;
 }
diff -r e458186a94f9 -r 5b1b4a14006a sys/netbt/hci_socket.c
--- a/sys/netbt/hci_socket.c    Mon Jul 07 15:22:07 2014 +0000
+++ b/sys/netbt/hci_socket.c    Mon Jul 07 17:13:56 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hci_socket.c,v 1.29 2014/07/07 15:13:21 rtr Exp $      */
+/*     $NetBSD: hci_socket.c,v 1.30 2014/07/07 17:13:56 rtr Exp $      */
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hci_socket.c,v 1.29 2014/07/07 15:13:21 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hci_socket.c,v 1.30 2014/07/07 17:13:56 rtr Exp $");
 
 /* load symbolic names */
 #ifdef BLUETOOTH_DEBUG
@@ -484,7 +484,7 @@
 }
 
 static int
-hci_ioctl(struct socket *up, u_long cmd, void *nam, struct ifnet *ifp)
+hci_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
 {
        int err;
        mutex_enter(bt_lock);
@@ -496,6 +496,8 @@
 static int
 hci_stat(struct socket *so, struct stat *ub)
 {
+       KASSERT(solocked(so));
+
        return 0;
 }
 
diff -r e458186a94f9 -r 5b1b4a14006a sys/netbt/l2cap_socket.c
--- a/sys/netbt/l2cap_socket.c  Mon Jul 07 15:22:07 2014 +0000
+++ b/sys/netbt/l2cap_socket.c  Mon Jul 07 17:13:56 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: l2cap_socket.c,v 1.20 2014/07/07 15:13:21 rtr Exp $    */
+/*     $NetBSD: l2cap_socket.c,v 1.21 2014/07/07 17:13:56 rtr Exp $    */
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: l2cap_socket.c,v 1.20 2014/07/07 15:13:21 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: l2cap_socket.c,v 1.21 2014/07/07 17:13:56 rtr Exp $");
 
 /* load symbolic names */
 #ifdef BLUETOOTH_DEBUG
@@ -117,7 +117,7 @@
 }
 
 static int
-l2cap_ioctl(struct socket *up, u_long cmd, void *nam, struct ifnet *ifp)
+l2cap_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
 {
        return EPASSTHROUGH;
 }
@@ -125,6 +125,8 @@
 static int
 l2cap_stat(struct socket *so, struct stat *ub)
 {
+       KASSERT(solocked(so));
+
        return 0;
 }
 
diff -r e458186a94f9 -r 5b1b4a14006a sys/netbt/rfcomm_socket.c
--- a/sys/netbt/rfcomm_socket.c Mon Jul 07 15:22:07 2014 +0000
+++ b/sys/netbt/rfcomm_socket.c Mon Jul 07 17:13:56 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rfcomm_socket.c,v 1.21 2014/07/07 15:13:21 rtr Exp $   */
+/*     $NetBSD: rfcomm_socket.c,v 1.22 2014/07/07 17:13:56 rtr Exp $   */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rfcomm_socket.c,v 1.21 2014/07/07 15:13:21 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rfcomm_socket.c,v 1.22 2014/07/07 17:13:56 rtr Exp $");
 
 /* load symbolic names */
 #ifdef BLUETOOTH_DEBUG
@@ -125,7 +125,7 @@
 }
 
 static int
-rfcomm_ioctl(struct socket *up, u_long cmd, void *nam, struct ifnet *ifp)
+rfcomm_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
 {
        return EPASSTHROUGH;
 }
@@ -133,6 +133,8 @@
 static int
 rfcomm_stat(struct socket *so, struct stat *ub)
 {
+       KASSERT(solocked(so));
+
        return 0;
 }
 
diff -r e458186a94f9 -r 5b1b4a14006a sys/netbt/sco_socket.c
--- a/sys/netbt/sco_socket.c    Mon Jul 07 15:22:07 2014 +0000
+++ b/sys/netbt/sco_socket.c    Mon Jul 07 17:13:56 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sco_socket.c,v 1.22 2014/07/07 15:13:21 rtr Exp $      */
+/*     $NetBSD: sco_socket.c,v 1.23 2014/07/07 17:13:56 rtr Exp $      */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sco_socket.c,v 1.22 2014/07/07 15:13:21 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sco_socket.c,v 1.23 2014/07/07 17:13:56 rtr Exp $");
 
 /* load symbolic names */
 #ifdef BLUETOOTH_DEBUG
@@ -108,7 +108,7 @@
 }
 
 static int
-sco_ioctl(struct socket *up, u_long cmd, void *nam, struct ifnet *ifp)
+sco_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
 {
        return EOPNOTSUPP;
 }
@@ -116,6 +116,8 @@
 static int
 sco_stat(struct socket *so, struct stat *ub)
 {
+       KASSERT(solocked(so));
+
        return 0;
 }
 
diff -r e458186a94f9 -r 5b1b4a14006a sys/netinet/raw_ip.c
--- a/sys/netinet/raw_ip.c      Mon Jul 07 15:22:07 2014 +0000
+++ b/sys/netinet/raw_ip.c      Mon Jul 07 17:13:56 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: raw_ip.c,v 1.130 2014/07/07 15:13:21 rtr Exp $ */
+/*     $NetBSD: raw_ip.c,v 1.131 2014/07/07 17:13:56 rtr Exp $ */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.130 2014/07/07 15:13:21 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.131 2014/07/07 17:13:56 rtr Exp $");
 
 #include "opt_inet.h"
 #include "opt_compat_netbsd.h"
@@ -575,6 +575,8 @@
 static int
 rip_stat(struct socket *so, struct stat *ub)
 {
+       KASSERT(solocked(so));
+
        /* stat: don't bother with a blocksize. */
        return 0;
 }
diff -r e458186a94f9 -r 5b1b4a14006a sys/netinet/tcp_usrreq.c
--- a/sys/netinet/tcp_usrreq.c  Mon Jul 07 15:22:07 2014 +0000
+++ b/sys/netinet/tcp_usrreq.c  Mon Jul 07 17:13:56 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_usrreq.c,v 1.183 2014/07/07 15:13:21 rtr Exp $     */
+/*     $NetBSD: tcp_usrreq.c,v 1.184 2014/07/07 17:13:56 rtr Exp $     */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -99,7 +99,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.183 2014/07/07 15:13:21 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.184 2014/07/07 17:13:56 rtr Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -956,6 +956,8 @@
 static int
 tcp_stat(struct socket *so, struct stat *ub)



Home | Main Index | Thread Index | Old Index