From 307cfebb4763f3c4ca6ad5215fb00804000935ec Mon Sep 17 00:00:00 2001 From: jsg Date: Tue, 8 Oct 2024 02:58:26 +0000 Subject: [PATCH] remove unused ffs_checkoverlap() ext2fs_checkoverlap(); ok miod@ --- sys/ufs/ext2fs/ext2fs_extern.h | 5 +---- sys/ufs/ext2fs/ext2fs_subr.c | 33 +-------------------------------- sys/ufs/ffs/ffs_extern.h | 5 +---- sys/ufs/ffs/ffs_subr.c | 34 +--------------------------------- 4 files changed, 4 insertions(+), 73 deletions(-) diff --git a/sys/ufs/ext2fs/ext2fs_extern.h b/sys/ufs/ext2fs/ext2fs_extern.h index ca4003a4f40..f74dbc760d3 100644 --- a/sys/ufs/ext2fs/ext2fs_extern.h +++ b/sys/ufs/ext2fs/ext2fs_extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_extern.h,v 1.38 2020/01/20 23:21:56 claudio Exp $ */ +/* $OpenBSD: ext2fs_extern.h,v 1.39 2024/10/08 02:58:26 jsg Exp $ */ /* $NetBSD: ext2fs_extern.h,v 1.1 1997/06/11 09:33:55 bouyer Exp $ */ /*- @@ -92,9 +92,6 @@ int ext2fs_checkpath(struct inode *, struct inode *, struct ucred *); /* ext2fs_subr.c */ int ext2fs_bufatoff(struct inode *, off_t, char **, struct buf **); int ext2fs_vinit(struct mount *, struct vnode **); -#ifdef DIAGNOSTIC -void ext2fs_checkoverlap(struct buf *, struct inode *); -#endif /* ext2fs_vfsops.c */ int ext2fs_mountroot(void); diff --git a/sys/ufs/ext2fs/ext2fs_subr.c b/sys/ufs/ext2fs/ext2fs_subr.c index b03939be476..68769d8f28a 100644 --- a/sys/ufs/ext2fs/ext2fs_subr.c +++ b/sys/ufs/ext2fs/ext2fs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_subr.c,v 1.37 2021/10/20 06:35:39 semarie Exp $ */ +/* $OpenBSD: ext2fs_subr.c,v 1.38 2024/10/08 02:58:26 jsg Exp $ */ /* $NetBSD: ext2fs_subr.c,v 1.1 1997/06/11 09:34:03 bouyer Exp $ */ /* @@ -110,37 +110,6 @@ ext2fs_bufatoff(struct inode *ip, off_t offset, char **res, struct buf **bpp) } #endif -#if defined(_KERNEL) && defined(DIAGNOSTIC) -void -ext2fs_checkoverlap(struct buf *bp, struct inode *ip) -{ - struct buf *ep; - struct vnode *vp; - daddr_t start, last; - - start = bp->b_blkno; - last = start + btodb(bp->b_bcount) - 1; - LIST_FOREACH(ep, &bufhead, b_list) { - if (ep == bp || (ep->b_flags & B_INVAL) || - ep->b_vp == NULLVP) - continue; - if (VOP_BMAP(ep->b_vp, 0, &vp, NULL, 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 %lld, end %lld overlap start %lld, end %lld\n", - start, last, (long long)ep->b_blkno, - (long long)(ep->b_blkno + btodb(ep->b_bcount) - 1)); - panic("Disk buffer overlap"); - } -} -#endif /* DIAGNOSTIC */ - /* * Initialize the vnode associated with a new inode, handle aliased vnodes. */ diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index 88bf59dd7be..33329f213ec 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_extern.h,v 1.50 2024/05/13 01:15:53 jsg Exp $ */ +/* $OpenBSD: ffs_extern.h,v 1.51 2024/10/08 02:58:26 jsg Exp $ */ /* $NetBSD: ffs_extern.h,v 1.4 1996/02/09 22:22:22 christos Exp $ */ /* @@ -125,9 +125,6 @@ int ffs_truncate(struct inode *, off_t, int, struct ucred *); /* ffs_subr.c */ int ffs_bufatoff(struct inode *, off_t, char **, struct buf **); void ffs_fragacct(struct fs *, int, int32_t[], int); -#ifdef DIAGNOSTIC -void ffs_checkoverlap(struct buf *, struct inode *); -#endif int ffs_isfreeblock(struct fs *, u_char *, daddr_t); int ffs_isblock(struct fs *, u_char *, daddr_t); void ffs_clrblock(struct fs *, u_char *, daddr_t); diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index 64d353860a3..de81df8b619 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_subr.c,v 1.34 2021/10/20 06:35:39 semarie Exp $ */ +/* $OpenBSD: ffs_subr.c,v 1.35 2024/10/08 02:58:26 jsg Exp $ */ /* $NetBSD: ffs_subr.c,v 1.6 1996/03/17 02:16:23 christos Exp $ */ /* @@ -119,38 +119,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) -{ - daddr_t start, last; - struct vnode *vp; - struct buf *ep; - - start = bp->b_blkno; - last = start + btodb(bp->b_bcount) - 1; - LIST_FOREACH(ep, &bufhead, b_list) { - if (ep == bp || (ep->b_flags & B_INVAL) || - ep->b_vp == NULLVP) - continue; - if (VOP_BMAP(ep->b_vp, 0, &vp, NULL, 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); - (void)printf("\tstart %lld, end %lld overlap start %llu, " - "end %llu\n", (long long)start, (long long)last, - (long long)ep->b_blkno, - (long long)(ep->b_blkno + btodb(ep->b_bcount) - 1)); - panic("Disk buffer overlap"); - } -} -#endif /* DIAGNOSTIC */ - /* * block operations * -- 2.20.1