xref: /csrg-svn/sys/ufs/lfs/lfs_bio.c (revision 51215)
1 /*
2  * Copyright (c) 1982, 1986, 1989 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)lfs_bio.c	5.2 (Berkeley) 10/02/91
8  */
9 
10 #ifdef LOGFS
11 #include "param.h"
12 #include "proc.h"
13 #include "buf.h"
14 #include "vnode.h"
15 #include "specdev.h"
16 #include "mount.h"
17 #include "trace.h"
18 #include "resourcevar.h"
19 #include "lfs.h"
20 
21 /*
22  * LFS version of bawrite, bdwrite, bwrite.  Set the delayed write flag and
23  * use reassignbuf to move the buffer from the clean list to the dirty one,
24  * then unlock the buffer.
25  */
26 lfs_bwrite(bp)
27 	register BUF *bp;
28 {
29 #ifdef DO_ACCOUNTING
30 	Not included as this gets called from lots of places where the
31 	current proc structure is probably wrong.  Ignore for now.
32 	curproc->p_stats->p_ru.ru_oublock++;	/* XXX: no one paid yet */
33 #endif
34 	bp->b_flags &= ~(B_READ | B_DONE | B_ERROR);
35 	bp->b_flags |= B_WRITE | B_DELWRI;
36 	reassignbuf(bp, bp->b_vp);		/* XXX: do this inline? */
37 	brelse(bp);
38 }
39 #endif /* LOGFS */
40