-/* $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 $ */
/*-
/* 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);
-/* $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 $ */
/*
}
#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.
*/
-/* $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 $ */
/*
/* 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);
-/* $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 $ */
/*
}
}
-#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
*