diff options
author | Pedro Martelletto <pedro@cvs.openbsd.org> | 2007-05-26 20:26:52 +0000 |
---|---|---|
committer | Pedro Martelletto <pedro@cvs.openbsd.org> | 2007-05-26 20:26:52 +0000 |
commit | 196f5066228d908cbac060396a1aba557efe1ef3 (patch) | |
tree | 5c48aa4f82af6d902afe35afb642c3d4225a1a07 /sys/ufs/ext2fs | |
parent | 6e18a0b85a66c596fb041fbf27229487f6661bbf (diff) |
Dynamic buffer cache. Initial diff from mickey@, okay art@ beck@ toby@
deraadt@ dlg@.
Diffstat (limited to 'sys/ufs/ext2fs')
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_inode.c | 6 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_readwrite.c | 5 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_subr.c | 7 |
3 files changed, 7 insertions, 11 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_inode.c b/sys/ufs/ext2fs/ext2fs_inode.c index 7a1240593e3..a7bb5073f3f 100644 --- a/sys/ufs/ext2fs/ext2fs_inode.c +++ b/sys/ufs/ext2fs/ext2fs_inode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_inode.c,v 1.34 2007/04/11 16:08:50 thib Exp $ */ +/* $OpenBSD: ext2fs_inode.c,v 1.35 2007/05/26 20:26:51 pedro Exp $ */ /* $NetBSD: ext2fs_inode.c,v 1.24 2001/06/19 12:59:18 wiz Exp $ */ /* @@ -315,8 +315,8 @@ ext2fs_truncate(struct inode *oip, off_t length, int flags, struct ucred *cred) size = fs->e2fs_bsize; uvm_vnp_setsize(ovp, length); uvm_vnp_uncache(ovp); - bzero((char *)bp->b_data + offset, (u_int)(size - offset)); - allocbuf(bp, size); + bzero(bp->b_data + offset, (u_int)(size - offset)); + bp->b_bcount = size; if (aflags & B_SYNC) bwrite(bp); else diff --git a/sys/ufs/ext2fs/ext2fs_readwrite.c b/sys/ufs/ext2fs/ext2fs_readwrite.c index b5562f212f3..32cf35d33a9 100644 --- a/sys/ufs/ext2fs/ext2fs_readwrite.c +++ b/sys/ufs/ext2fs/ext2fs_readwrite.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_readwrite.c,v 1.18 2006/10/16 11:27:53 pedro Exp $ */ +/* $OpenBSD: ext2fs_readwrite.c,v 1.19 2007/05/26 20:26:51 pedro Exp $ */ /* $NetBSD: ext2fs_readwrite.c,v 1.16 2001/02/27 04:37:47 chs Exp $ */ /*- @@ -119,9 +119,6 @@ ext2fs_read(v) if (lblktosize(fs, nextlbn) >= ext2fs_size(ip)) error = bread(vp, lbn, size, NOCRED, &bp); - else if (doclusterread) - error = cluster_read(vp, &ip->i_ci, - ext2fs_size(ip), lbn, size, NOCRED, &bp); else if (lbn - 1 == ip->i_ci.ci_lastr) { int nextsize = fs->e2fs_bsize; error = breadn(vp, lbn, diff --git a/sys/ufs/ext2fs/ext2fs_subr.c b/sys/ufs/ext2fs/ext2fs_subr.c index 0feda64e1c0..ed057d42bc1 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.14 2006/07/18 22:44:33 pedro Exp $ */ +/* $OpenBSD: ext2fs_subr.c,v 1.15 2007/05/26 20:26:51 pedro Exp $ */ /* $NetBSD: ext2fs_subr.c,v 1.1 1997/06/11 09:34:03 bouyer Exp $ */ /* @@ -107,14 +107,13 @@ ext2fs_checkoverlap(bp, ip) struct buf *bp; struct inode *ip; { - struct buf *ebp, *ep; + struct buf *ep; ufs1_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++) { + LIST_FOREACH(ep, &bufhead, b_list) { if (ep == bp || (ep->b_flags & B_INVAL) || ep->b_vp == NULLVP) continue; |