* sprinkle KASSERT(solocked(so)); in all pr_stat() functions.

* fix remaining inconsistent struct socket parameter names.
This commit is contained in:
rtr 2014-07-07 17:13:56 +00:00
parent 1e66a29cfe
commit ff90c29d04
17 changed files with 72 additions and 38 deletions

View File

@ -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 @@ unp_stat(struct socket *so, struct stat *ub)
struct unpcb *unp;
struct socket *so2;
KASSERT(solocked(so));
unp = sotounpcb(so);
if (unp == NULL)
return EINVAL;

View File

@ -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 @@ link_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
static int
link_stat(struct socket *so, struct stat *ub)
{
KASSERT(solocked(so));
return EOPNOTSUPP;
}

View File

@ -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 @@ COMPATNAME(route_ioctl)(struct socket *so, u_long cmd, void *nam,
static int
COMPATNAME(route_stat)(struct socket *so, struct stat *ub)
{
KASSERT(solocked(so));
return 0;
}

View File

@ -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 @@ ddp_ioctl(struct socket *so, u_long cmd, void *addr, struct ifnet *ifp)
static int
ddp_stat(struct socket *so, struct stat *ub)
{
KASSERT(solocked(so));
/* stat: don't bother with a blocksize. */
return 0;
}

View File

@ -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 @@ hci_detach(struct socket *so)
}
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 @@ hci_ioctl(struct socket *up, u_long cmd, void *nam, struct ifnet *ifp)
static int
hci_stat(struct socket *so, struct stat *ub)
{
KASSERT(solocked(so));
return 0;
}

View File

@ -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 @@ l2cap_detach(struct socket *so)
}
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 @@ l2cap_ioctl(struct socket *up, u_long cmd, void *nam, struct ifnet *ifp)
static int
l2cap_stat(struct socket *so, struct stat *ub)
{
KASSERT(solocked(so));
return 0;
}

View File

@ -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 @@ rfcomm_detach(struct socket *so)
}
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 @@ rfcomm_ioctl(struct socket *up, u_long cmd, void *nam, struct ifnet *ifp)
static int
rfcomm_stat(struct socket *so, struct stat *ub)
{
KASSERT(solocked(so));
return 0;
}

View File

@ -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 @@ sco_detach(struct socket *so)
}
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 @@ sco_ioctl(struct socket *up, u_long cmd, void *nam, struct ifnet *ifp)
static int
sco_stat(struct socket *so, struct stat *ub)
{
KASSERT(solocked(so));
return 0;
}

View File

@ -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 @@ rip_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
static int
rip_stat(struct socket *so, struct stat *ub)
{
KASSERT(solocked(so));
/* stat: don't bother with a blocksize. */
return 0;
}

View File

@ -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 @@ tcp_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
static int
tcp_stat(struct socket *so, struct stat *ub)
{
KASSERT(solocked(so));
/* stat: don't bother with a blocksize. */
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: udp_usrreq.c,v 1.205 2014/07/07 15:13:21 rtr Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.206 2014/07/07 17:13:56 rtr Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.205 2014/07/07 15:13:21 rtr Exp $");
__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.206 2014/07/07 17:13:56 rtr Exp $");
#include "opt_inet.h"
#include "opt_compat_netbsd.h"
@ -903,6 +903,8 @@ udp_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
static int
udp_stat(struct socket *so, struct stat *ub)
{
KASSERT(solocked(so));
/* stat: don't bother with a blocksize. */
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: raw_ip6.c,v 1.124 2014/07/07 15:13:21 rtr Exp $ */
/* $NetBSD: raw_ip6.c,v 1.125 2014/07/07 17:13:56 rtr Exp $ */
/* $KAME: raw_ip6.c,v 1.82 2001/07/23 18:57:56 jinmei Exp $ */
/*
@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.124 2014/07/07 15:13:21 rtr Exp $");
__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.125 2014/07/07 17:13:56 rtr Exp $");
#include "opt_ipsec.h"
@ -653,6 +653,8 @@ rip6_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
static int
rip6_stat(struct socket *so, struct stat *ub)
{
KASSERT(solocked(so));
/* stat: don't bother with a blocksize */
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: udp6_usrreq.c,v 1.104 2014/07/07 15:13:21 rtr Exp $ */
/* $NetBSD: udp6_usrreq.c,v 1.105 2014/07/07 17:13:56 rtr Exp $ */
/* $KAME: udp6_usrreq.c,v 1.86 2001/05/27 17:33:00 itojun Exp $ */
/*
@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.104 2014/07/07 15:13:21 rtr Exp $");
__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.105 2014/07/07 17:13:56 rtr Exp $");
#include "opt_inet.h"
#include "opt_inet_csum.h"
@ -696,6 +696,8 @@ udp6_ioctl(struct socket *so, u_long cmd, void *addr6, struct ifnet *ifp)
static int
udp6_stat(struct socket *so, struct stat *ub)
{
KASSERT(solocked(so));
/* stat: don't bother with a blocksize */
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: keysock.c,v 1.32 2014/07/07 15:13:21 rtr Exp $ */
/* $NetBSD: keysock.c,v 1.33 2014/07/07 17:13:56 rtr Exp $ */
/* $FreeBSD: src/sys/netipsec/keysock.c,v 1.3.2.1 2003/01/24 05:11:36 sam Exp $ */
/* $KAME: keysock.c,v 1.25 2001/08/13 20:07:41 itojun Exp $ */
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: keysock.c,v 1.32 2014/07/07 15:13:21 rtr Exp $");
__KERNEL_RCSID(0, "$NetBSD: keysock.c,v 1.33 2014/07/07 17:13:56 rtr Exp $");
#include "opt_ipsec.h"
@ -493,6 +493,8 @@ key_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
static int
key_stat(struct socket *so, struct stat *ub)
{
KASSERT(solocked(so));
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: mpls_proto.c,v 1.12 2014/07/06 04:47:26 rtr Exp $ */
/* $NetBSD: mpls_proto.c,v 1.13 2014/07/07 17:13:56 rtr Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mpls_proto.c,v 1.12 2014/07/06 04:47:26 rtr Exp $");
__KERNEL_RCSID(0, "$NetBSD: mpls_proto.c,v 1.13 2014/07/07 17:13:56 rtr Exp $");
#include "opt_inet.h"
#include "opt_mbuftrace.h"
@ -103,6 +103,8 @@ mpls_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
static int
mpls_stat(struct socket *so, struct stat *ub)
{
KASSERT(solocked(so));
return EOPNOTSUPP;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: natm.c,v 1.34 2014/07/07 15:13:21 rtr Exp $ */
/* $NetBSD: natm.c,v 1.35 2014/07/07 17:13:56 rtr Exp $ */
/*
* Copyright (c) 1996 Charles D. Cranor and Washington University.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: natm.c,v 1.34 2014/07/07 15:13:21 rtr Exp $");
__KERNEL_RCSID(0, "$NetBSD: natm.c,v 1.35 2014/07/07 17:13:56 rtr Exp $");
#include <sys/param.h>
#include <sys/kmem.h>
@ -140,6 +140,8 @@ done:
static int
natm_stat(struct socket *so, struct stat *ub)
{
KASSERT(solocked(so));
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sockin.c,v 1.45 2014/07/07 15:13:22 rtr Exp $ */
/* $NetBSD: sockin.c,v 1.46 2014/07/07 17:13:57 rtr Exp $ */
/*
* Copyright (c) 2008, 2009 Antti Kantee. All Rights Reserved.
@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.45 2014/07/07 15:13:22 rtr Exp $");
__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.46 2014/07/07 17:13:57 rtr Exp $");
#include <sys/param.h>
#include <sys/condvar.h>
@ -462,6 +462,8 @@ sockin_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
static int
sockin_stat(struct socket *so, struct stat *ub)
{
KASSERT(solocked(so));
return 0;
}