changes for making DIAGNOSTIC not change the kernel ABI:
- for structure fields that are conditionally present, make those fields always present. - for functions which are conditionally inline, make them never inline. - remove some other functions which are conditionally defined but don't actually do anything anymore. - make a lock-debugging function conditional on only LOCKDEBUG. as discussed on tech-kern some time back.
This commit is contained in:
parent
0d8bcff6f5
commit
0545b6e0cb
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: irframevar.h,v 1.14 2005/12/11 12:22:02 christos Exp $ */
|
||||
/* $NetBSD: irframevar.h,v 1.15 2005/12/27 04:06:46 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
@ -55,9 +55,7 @@ struct irframe_softc {
|
||||
char sc_open;
|
||||
struct irda_params sc_params;
|
||||
u_int sc_speedmask;
|
||||
#ifdef DIAGNOSTIC
|
||||
u_int sc_speed;
|
||||
#endif
|
||||
u_int sc_speed; /* DIAGNOSTIC only */
|
||||
};
|
||||
|
||||
#define IRDA_DEFAULT_SPEED 9600
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ehcivar.h,v 1.21 2005/11/20 14:27:25 augustss Exp $ */
|
||||
/* $NetBSD: ehcivar.h,v 1.22 2005/12/27 04:06:45 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -63,9 +63,7 @@ struct ehci_xfer {
|
||||
LIST_ENTRY(ehci_xfer) inext; /* list of active xfers */
|
||||
ehci_soft_qtd_t *sqtdstart;
|
||||
ehci_soft_qtd_t *sqtdend;
|
||||
#ifdef DIAGNOSTIC
|
||||
int isdone;
|
||||
#endif
|
||||
int isdone; /* used only when DIAGNOSTIC is defined */
|
||||
};
|
||||
#define EXFER(xfer) ((struct ehci_xfer *)(xfer))
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ohcivar.h,v 1.38 2005/12/19 15:06:51 tron Exp $ */
|
||||
/* $NetBSD: ohcivar.h,v 1.39 2005/12/27 04:06:45 chs Exp $ */
|
||||
/* $FreeBSD: src/sys/dev/usb/ohcivar.h,v 1.13 1999/11/17 22:33:41 n_hibma Exp $ */
|
||||
|
||||
/*
|
||||
@ -71,9 +71,7 @@ typedef struct ohci_soft_itd {
|
||||
LIST_ENTRY(ohci_soft_itd) hnext;
|
||||
usbd_xfer_handle xfer;
|
||||
u_int16_t flags;
|
||||
#ifdef DIAGNOSTIC
|
||||
char isdone;
|
||||
#endif
|
||||
char isdone; /* used only when DIAGNOSTIC is defined */
|
||||
} ohci_soft_itd_t;
|
||||
#define OHCI_SITD_SIZE ((sizeof (struct ohci_soft_itd) + OHCI_ITD_ALIGN - 1) / OHCI_ITD_ALIGN * OHCI_ITD_ALIGN)
|
||||
#define OHCI_SITD_CHUNK 64
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: uhcivar.h,v 1.39 2005/12/11 12:24:01 christos Exp $ */
|
||||
/* $NetBSD: uhcivar.h,v 1.40 2005/12/27 04:06:45 chs Exp $ */
|
||||
/* $FreeBSD: src/sys/dev/usb/uhcivar.h,v 1.14 1999/11/17 22:33:42 n_hibma Exp $ */
|
||||
|
||||
/*
|
||||
@ -75,9 +75,7 @@ typedef struct uhci_intr_info {
|
||||
uhci_soft_td_t *stdstart;
|
||||
uhci_soft_td_t *stdend;
|
||||
LIST_ENTRY(uhci_intr_info) list;
|
||||
#ifdef DIAGNOSTIC
|
||||
int isdone;
|
||||
#endif
|
||||
int isdone; /* used only when DIAGNOSTIC is defined */
|
||||
} uhci_intr_info_t;
|
||||
|
||||
struct uhci_xfer {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: usbdivar.h,v 1.76 2005/12/24 20:27:52 perry Exp $ */
|
||||
/* $NetBSD: usbdivar.h,v 1.77 2005/12/27 04:06:45 chs Exp $ */
|
||||
/* $FreeBSD: src/sys/dev/usb/usbdivar.h,v 1.11 1999/11/17 22:33:51 n_hibma Exp $ */
|
||||
|
||||
/*
|
||||
@ -198,13 +198,11 @@ struct usbd_xfer {
|
||||
u_int32_t timeout;
|
||||
usbd_status status;
|
||||
usbd_callback callback;
|
||||
volatile char done;
|
||||
#ifdef DIAGNOSTIC
|
||||
u_int32_t busy_free;
|
||||
#define XFER_FREE 0x46524545
|
||||
#define XFER_BUSY 0x42555359
|
||||
#define XFER_ONQU 0x4f4e5155
|
||||
#endif
|
||||
volatile u_int8_t done;
|
||||
u_int8_t busy_free; /* used for DIAGNOSTIC */
|
||||
#define XFER_FREE 0x46
|
||||
#define XFER_BUSY 0x55
|
||||
#define XFER_ONQU 0x9e
|
||||
|
||||
/* For control pipe */
|
||||
usb_device_request_t request;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: wsemul_vt100var.h,v 1.11 2005/12/11 12:24:12 christos Exp $ */
|
||||
/* $NetBSD: wsemul_vt100var.h,v 1.12 2005/12/27 04:06:46 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998
|
||||
@ -38,9 +38,7 @@ struct wsemul_vt100_emuldata {
|
||||
|
||||
long kernattr; /* attribute for kernel output */
|
||||
void *cbcookie;
|
||||
#ifdef DIAGNOSTIC
|
||||
int console;
|
||||
#endif
|
||||
int console; /* used for DIAGNOSTIC */
|
||||
|
||||
u_int state; /* processing state */
|
||||
int flags;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: union.h,v 1.13 2005/12/11 12:24:29 christos Exp $ */
|
||||
/* $NetBSD: union.h,v 1.14 2005/12/27 04:06:46 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 The Regents of the University of California.
|
||||
@ -121,9 +121,7 @@ struct union_node {
|
||||
struct vnode **un_dircache; /* cached union stack */
|
||||
off_t un_uppersz; /* size of upper object */
|
||||
off_t un_lowersz; /* size of lower object */
|
||||
#ifdef DIAGNOSTIC
|
||||
pid_t un_pid;
|
||||
#endif
|
||||
pid_t un_pid; /* DIAGNOSTIC only */
|
||||
};
|
||||
|
||||
#define UN_WANTED 0x01
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kern_lock.c,v 1.91 2005/12/24 19:12:23 perry Exp $ */
|
||||
/* $NetBSD: kern_lock.c,v 1.92 2005/12/27 04:06:46 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
|
||||
@ -76,7 +76,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.91 2005/12/24 19:12:23 perry Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.92 2005/12/27 04:06:46 chs Exp $");
|
||||
|
||||
#include "opt_multiprocessor.h"
|
||||
#include "opt_lockdebug.h"
|
||||
@ -459,7 +459,7 @@ lockstatus(struct lock *lkp)
|
||||
return (lock_type);
|
||||
}
|
||||
|
||||
#if defined(LOCKDEBUG) || defined(DIAGNOSTIC)
|
||||
#if defined(LOCKDEBUG)
|
||||
/*
|
||||
* Make sure no spin locks are held by a CPU that is about
|
||||
* to context switch.
|
||||
@ -482,7 +482,7 @@ spinlock_switchcheck(void)
|
||||
panic("spinlock_switchcheck: CPU %lu has %lu spin locks",
|
||||
(u_long) cpu_number(), cnt);
|
||||
}
|
||||
#endif /* LOCKDEBUG || DIAGNOSTIC */
|
||||
#endif /* LOCKDEBUG */
|
||||
|
||||
/*
|
||||
* Locks and IPLs (interrupt priority levels):
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kern_subr.c,v 1.122 2005/12/27 00:27:34 chs Exp $ */
|
||||
/* $NetBSD: kern_subr.c,v 1.123 2005/12/27 04:06:46 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
|
||||
@ -86,7 +86,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.122 2005/12/27 00:27:34 chs Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.123 2005/12/27 04:06:46 chs Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_md.h"
|
||||
@ -144,10 +144,8 @@ uiomove(void *buf, size_t n, struct uio *uio)
|
||||
|
||||
hold_count = KERNEL_LOCK_RELEASE_ALL();
|
||||
|
||||
#if defined(LOCKDEBUG) || defined(DIAGNOSTIC)
|
||||
spinlock_switchcheck();
|
||||
#endif
|
||||
#ifdef LOCKDEBUG
|
||||
spinlock_switchcheck();
|
||||
simple_lock_only_held(NULL, "uiomove");
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kern_synch.c,v 1.159 2005/12/26 18:45:27 perry Exp $ */
|
||||
/* $NetBSD: kern_synch.c,v 1.160 2005/12/27 04:06:46 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2004 The NetBSD Foundation, Inc.
|
||||
@ -76,7 +76,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.159 2005/12/26 18:45:27 perry Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.160 2005/12/27 04:06:46 chs Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_ktrace.h"
|
||||
@ -927,10 +927,8 @@ mi_switch(struct lwp *l, struct lwp *newl)
|
||||
|
||||
spc = &l->l_cpu->ci_schedstate;
|
||||
|
||||
#if defined(LOCKDEBUG) || defined(DIAGNOSTIC)
|
||||
spinlock_switchcheck();
|
||||
#endif
|
||||
#ifdef LOCKDEBUG
|
||||
spinlock_switchcheck();
|
||||
simple_lock_switchcheck();
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vfs_init.c,v 1.29 2005/12/11 12:24:30 christos Exp $ */
|
||||
/* $NetBSD: vfs_init.c,v 1.30 2005/12/27 04:06:46 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
@ -74,7 +74,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v 1.29 2005/12/11 12:24:30 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v 1.30 2005/12/27 04:06:46 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
@ -297,11 +297,6 @@ vfs_op_check(void)
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
|
||||
/*
|
||||
* Routines having to do with the management of the vnode table.
|
||||
*/
|
||||
struct vattr va_null;
|
||||
|
||||
/*
|
||||
* Initialize the vnode structures and initialize each file system type.
|
||||
*/
|
||||
@ -344,7 +339,6 @@ vfsinit(void)
|
||||
* Establish each file system which was statically
|
||||
* included in the kernel.
|
||||
*/
|
||||
vattr_null(&va_null);
|
||||
__link_set_foreach(vfsp, vfsops) {
|
||||
if (vfs_attach(*vfsp)) {
|
||||
printf("multiple `%s' file systems",
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vfs_subr.c,v 1.257 2005/12/23 15:31:40 yamt Exp $ */
|
||||
/* $NetBSD: vfs_subr.c,v 1.258 2005/12/27 04:06:46 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998, 2004, 2005 The NetBSD Foundation, Inc.
|
||||
@ -80,7 +80,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.257 2005/12/23 15:31:40 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.258 2005/12/27 04:06:46 chs Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_ddb.h"
|
||||
@ -1295,9 +1295,9 @@ vrele(struct vnode *vp)
|
||||
VOP_INACTIVE(vp, l);
|
||||
}
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
/*
|
||||
* Page or buffer structure gets a reference.
|
||||
* Called with v_interlock held.
|
||||
*/
|
||||
void
|
||||
vholdl(struct vnode *vp)
|
||||
@ -1328,6 +1328,7 @@ vholdl(struct vnode *vp)
|
||||
|
||||
/*
|
||||
* Page or buffer structure frees a reference.
|
||||
* Called with v_interlock held.
|
||||
*/
|
||||
void
|
||||
holdrelel(struct vnode *vp)
|
||||
@ -1379,7 +1380,6 @@ vref(struct vnode *vp)
|
||||
#endif
|
||||
simple_unlock(&vp->v_interlock);
|
||||
}
|
||||
#endif /* DIAGNOSTIC */
|
||||
|
||||
/*
|
||||
* Remove any vnodes in the vnode table belonging to mount point mp.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cpu_data.h,v 1.4 2005/12/03 17:10:46 christos Exp $ */
|
||||
/* $NetBSD: cpu_data.h,v 1.5 2005/12/27 04:06:46 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2004 The NetBSD Foundation, Inc.
|
||||
@ -69,17 +69,13 @@ struct cpu_data {
|
||||
/*
|
||||
* for LOCKDEBUG
|
||||
*/
|
||||
#if defined(DIAGNOSTIC) || defined(LOCKDEBUG)
|
||||
u_long cpu_spin_locks; /* # of spin locks held */
|
||||
u_long cpu_simple_locks; /* # of simple locks held */
|
||||
#endif /* defined(DIAGNOSTIC) || defined(LOCKDEBUG) */
|
||||
};
|
||||
|
||||
/* compat definitions */
|
||||
#define ci_schedstate ci_data.cpu_schedstate
|
||||
#if defined(DIAGNOSTIC) || defined(LOCKDEBUG)
|
||||
#define ci_spin_locks ci_data.cpu_spin_locks
|
||||
#define ci_simple_locks ci_data.cpu_simple_locks
|
||||
#endif /* defined(DIAGNOSTIC) || defined(LOCKDEBUG) */
|
||||
|
||||
#endif /* _SYS_CPU_DATA_H_ */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lock.h,v 1.61 2005/12/24 19:01:28 perry Exp $ */
|
||||
/* $NetBSD: lock.h,v 1.62 2005/12/27 04:06:46 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
|
||||
@ -305,7 +305,7 @@ void transferlockers(struct lock *, struct lock *);
|
||||
int lockstatus(struct lock *);
|
||||
void lockmgr_printinfo(volatile struct lock *);
|
||||
|
||||
#if defined(LOCKDEBUG) || defined(DIAGNOSTIC)
|
||||
#if defined(LOCKDEBUG)
|
||||
void spinlock_switchcheck(void);
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vnode.h,v 1.150 2005/12/25 14:48:59 yamt Exp $ */
|
||||
/* $NetBSD: vnode.h,v 1.151 2005/12/27 04:06:46 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -299,74 +299,14 @@ extern struct freelst vnode_hold_list; /* free vnodes referencing buffers */
|
||||
extern struct freelst vnode_free_list; /* vnode free list */
|
||||
extern struct simplelock vnode_free_list_slock;
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
#define ilstatic
|
||||
#else
|
||||
#define ilstatic static
|
||||
#endif
|
||||
|
||||
ilstatic void holdrelel(struct vnode *);
|
||||
ilstatic void vholdl(struct vnode *);
|
||||
ilstatic void vref(struct vnode *);
|
||||
void holdrelel(struct vnode *);
|
||||
void vholdl(struct vnode *);
|
||||
void vref(struct vnode *);
|
||||
|
||||
static inline void holdrele(struct vnode *) __attribute__((__unused__));
|
||||
static inline void vhold(struct vnode *) __attribute__((__unused__));
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
#define VATTR_NULL(vap) vattr_null(vap)
|
||||
#else
|
||||
#define VATTR_NULL(vap) (*(vap) = va_null) /* initialize a vattr */
|
||||
|
||||
/*
|
||||
* decrease buf or page ref
|
||||
*
|
||||
* called with v_interlock held
|
||||
*/
|
||||
static inline void
|
||||
holdrelel(struct vnode *vp)
|
||||
{
|
||||
|
||||
vp->v_holdcnt--;
|
||||
if ((vp->v_freelist.tqe_prev != (struct vnode **)0xdeadb) &&
|
||||
vp->v_holdcnt == 0 && vp->v_usecount == 0) {
|
||||
simple_lock(&vnode_free_list_slock);
|
||||
TAILQ_REMOVE(&vnode_hold_list, vp, v_freelist);
|
||||
TAILQ_INSERT_TAIL(&vnode_free_list, vp, v_freelist);
|
||||
simple_unlock(&vnode_free_list_slock);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* increase buf or page ref
|
||||
*
|
||||
* called with v_interlock held
|
||||
*/
|
||||
static inline void
|
||||
vholdl(struct vnode *vp)
|
||||
{
|
||||
|
||||
if ((vp->v_freelist.tqe_prev != (struct vnode **)0xdeadb) &&
|
||||
vp->v_holdcnt == 0 && vp->v_usecount == 0) {
|
||||
simple_lock(&vnode_free_list_slock);
|
||||
TAILQ_REMOVE(&vnode_free_list, vp, v_freelist);
|
||||
TAILQ_INSERT_TAIL(&vnode_hold_list, vp, v_freelist);
|
||||
simple_unlock(&vnode_free_list_slock);
|
||||
}
|
||||
vp->v_holdcnt++;
|
||||
}
|
||||
|
||||
/*
|
||||
* increase reference
|
||||
*/
|
||||
static inline void
|
||||
vref(struct vnode *vp)
|
||||
{
|
||||
|
||||
simple_lock(&vp->v_interlock);
|
||||
vp->v_usecount++;
|
||||
simple_unlock(&vp->v_interlock);
|
||||
}
|
||||
#endif /* DIAGNOSTIC */
|
||||
|
||||
/*
|
||||
* decrease buf or page ref
|
||||
@ -406,7 +346,6 @@ extern time_t syncdelay; /* max time to delay syncing data */
|
||||
extern time_t filedelay; /* time to delay syncing files */
|
||||
extern time_t dirdelay; /* time to delay syncing directories */
|
||||
extern time_t metadelay; /* time to delay syncing metadata */
|
||||
extern struct vattr va_null; /* predefined null vattr structure */
|
||||
|
||||
/*
|
||||
* Macro/function to check for client cache inconsistency w.r.t. leasing.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ext2fs_extern.h,v 1.31 2005/12/13 16:25:59 christos Exp $ */
|
||||
/* $NetBSD: ext2fs_extern.h,v 1.32 2005/12/27 04:06:46 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993, 1994
|
||||
@ -136,9 +136,6 @@ int ext2fs_blkatoff(struct vnode *, off_t, char **, struct buf **);
|
||||
void ext2fs_fragacct(struct m_ext2fs *, int, int32_t[], int);
|
||||
void ext2fs_itimes(struct inode *, const struct timespec *,
|
||||
const struct timespec *, const struct timespec *);
|
||||
#ifdef DIAGNOSTIC
|
||||
void ext2fs_checkoverlap(struct buf *, struct inode *);
|
||||
#endif
|
||||
|
||||
/* ext2fs_vfsops.c */
|
||||
void ext2fs_init(void);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ext2fs_subr.c,v 1.19 2005/12/11 12:25:25 christos Exp $ */
|
||||
/* $NetBSD: ext2fs_subr.c,v 1.20 2005/12/27 04:06:46 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1993
|
||||
@ -65,7 +65,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ext2fs_subr.c,v 1.19 2005/12/11 12:25:25 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ext2fs_subr.c,v 1.20 2005/12/27 04:06:46 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -137,40 +137,3 @@ ext2fs_itimes(struct inode *ip, const struct timespec *acc,
|
||||
ip->i_flag |= IN_MODIFIED;
|
||||
ip->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_UPDATE | IN_MODIFY);
|
||||
}
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
void
|
||||
ext2fs_checkoverlap(struct buf *bp, struct inode *ip)
|
||||
{
|
||||
#if 0
|
||||
struct buf *ebp, *ep;
|
||||
daddr_t start, last;
|
||||
struct vnode *vp;
|
||||
|
||||
ebp = &buf[nbuf];
|
||||
start = bp->b_blkno;
|
||||
last = start + btodb(bp->b_bcount) - 1;
|
||||
for (ep = buf; ep < ebp; ep++) {
|
||||
if (ep == bp || (ep->b_flags & B_INVAL) ||
|
||||
ep->b_vp == NULLVP)
|
||||
continue;
|
||||
if (VOP_BMAP(ep->b_vp, (daddr_t)0, &vp, (daddr_t)0, NULL))
|
||||
continue;
|
||||
if (vp != ip->i_devvp)
|
||||
continue;
|
||||
/* look for overlap */
|
||||
if (ep->b_bcount == 0 || ep->b_blkno > last ||
|
||||
ep->b_blkno + btodb(ep->b_bcount) <= start)
|
||||
continue;
|
||||
vprint("Disk overlap", vp);
|
||||
printf("\tstart %" PRId64 ", end %" PRId64 " overlap start "
|
||||
"%" PRId64 ", end %" PRId64 "\n",
|
||||
start, last, ep->b_blkno,
|
||||
ep->b_blkno + btodb(ep->b_bcount) - 1);
|
||||
panic("Disk buffer overlap");
|
||||
}
|
||||
#else
|
||||
printf("ext2fs_checkoverlap disabled due to buffer cache implementation changes\n");
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ffs_extern.h,v 1.49 2005/12/11 12:25:25 christos Exp $ */
|
||||
/* $NetBSD: ffs_extern.h,v 1.50 2005/12/27 04:06:46 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993, 1994
|
||||
@ -122,9 +122,6 @@ void ffs_load_inode(struct buf *, struct inode *, struct fs *, ino_t);
|
||||
int ffs_blkatoff(struct vnode *, off_t, char **, struct buf **);
|
||||
int ffs_freefile(struct fs *, struct vnode *, ino_t, int);
|
||||
void ffs_fragacct(struct fs *, int, int32_t[], int, int);
|
||||
#ifdef DIAGNOSTIC
|
||||
void ffs_checkoverlap(struct buf *, struct inode *);
|
||||
#endif
|
||||
int ffs_isblock(struct fs *, u_char *, int32_t);
|
||||
int ffs_isfreeblock(struct fs *, u_char *, int32_t);
|
||||
void ffs_clrblock(struct fs *, u_char *, int32_t);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ffs_subr.c,v 1.39 2005/12/11 12:25:25 christos Exp $ */
|
||||
/* $NetBSD: ffs_subr.c,v 1.40 2005/12/27 04:06:46 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1993
|
||||
@ -36,7 +36,7 @@
|
||||
#endif
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ffs_subr.c,v 1.39 2005/12/11 12:25:25 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ffs_subr.c,v 1.40 2005/12/27 04:06:46 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
@ -178,43 +178,6 @@ ffs_fragacct(struct fs *fs, int fragmap, int32_t fraglist[], int cnt,
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(_KERNEL) && defined(DIAGNOSTIC)
|
||||
void
|
||||
ffs_checkoverlap(struct buf *bp, struct inode *ip)
|
||||
{
|
||||
#if 0
|
||||
struct buf *ebp, *ep;
|
||||
daddr_t start, last;
|
||||
struct vnode *vp;
|
||||
|
||||
ebp = &buf[nbuf];
|
||||
start = bp->b_blkno;
|
||||
last = start + btodb(bp->b_bcount) - 1;
|
||||
for (ep = buf; ep < ebp; ep++) {
|
||||
if (ep == bp || (ep->b_flags & B_INVAL) ||
|
||||
ep->b_vp == NULLVP)
|
||||
continue;
|
||||
if (VOP_BMAP(ep->b_vp, (daddr_t)0, &vp, (daddr_t)0, NULL))
|
||||
continue;
|
||||
if (vp != ip->i_devvp)
|
||||
continue;
|
||||
/* look for overlap */
|
||||
if (ep->b_bcount == 0 || ep->b_blkno > last ||
|
||||
ep->b_blkno + btodb(ep->b_bcount) <= start)
|
||||
continue;
|
||||
vprint("Disk overlap", vp);
|
||||
printf("\tstart %" PRId64 ", end %" PRId64 " overlap start "
|
||||
"%" PRId64 ", end %" PRId64 "\n",
|
||||
start, last, ep->b_blkno,
|
||||
ep->b_blkno + btodb(ep->b_bcount) - 1);
|
||||
panic("Disk buffer overlap");
|
||||
}
|
||||
#else
|
||||
printf("ffs_checkoverlap disabled due to buffer cache implementation changes\n");
|
||||
#endif
|
||||
}
|
||||
#endif /* _KERNEL && DIAGNOSTIC */
|
||||
|
||||
/*
|
||||
* block operations
|
||||
*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: quota.h,v 1.20 2005/12/11 12:25:28 christos Exp $ */
|
||||
/* $NetBSD: quota.h,v 1.21 2005/12/27 04:06:46 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1993
|
||||
@ -159,15 +159,6 @@ struct dquot {
|
||||
#define FORCE 0x01 /* force usage changes independent of limits */
|
||||
#define CHOWN 0x02 /* (advisory) change initiated by chown */
|
||||
|
||||
/*
|
||||
* Macros to avoid subroutine calls to trivial functions.
|
||||
*/
|
||||
#ifdef DIAGNOSTIC
|
||||
#define DQREF(dq) dqref(dq)
|
||||
#else
|
||||
#define DQREF(dq) (dq)->dq_cnt++
|
||||
#endif
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
struct dquot;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ufs_quota.c,v 1.36 2005/12/11 12:25:28 christos Exp $ */
|
||||
/* $NetBSD: ufs_quota.c,v 1.37 2005/12/27 04:06:46 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1990, 1993, 1995
|
||||
@ -35,7 +35,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ufs_quota.c,v 1.36 2005/12/11 12:25:28 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ufs_quota.c,v 1.37 2005/12/27 04:06:46 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/kernel.h>
|
||||
@ -721,7 +721,7 @@ dqget(struct vnode *vp, u_long id, struct ufsmount *ump, int type,
|
||||
*/
|
||||
if (dq->dq_cnt == 0)
|
||||
TAILQ_REMOVE(&dqfreelist, dq, dq_freelist);
|
||||
DQREF(dq);
|
||||
dqref(dq);
|
||||
*dqp = dq;
|
||||
return (0);
|
||||
}
|
||||
@ -753,7 +753,7 @@ dqget(struct vnode *vp, u_long id, struct ufsmount *ump, int type,
|
||||
if (vp != dqvp)
|
||||
vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY);
|
||||
LIST_INSERT_HEAD(dqh, dq, dq_hash);
|
||||
DQREF(dq);
|
||||
dqref(dq);
|
||||
dq->dq_flags = DQ_LOCK;
|
||||
dq->dq_id = id;
|
||||
dq->dq_ump = ump;
|
||||
|
Loading…
Reference in New Issue
Block a user