151184Sbostic /* 251184Sbostic * Copyright (c) 1982, 1986, 1989 Regents of the University of California. 351184Sbostic * All rights reserved. 451184Sbostic * 551184Sbostic * %sccs.include.redist.c% 651184Sbostic * 7*51215Sbostic * @(#)lfs_bio.c 5.2 (Berkeley) 10/02/91 851184Sbostic */ 951184Sbostic 10*51215Sbostic #ifdef LOGFS 1151184Sbostic #include "param.h" 1251184Sbostic #include "proc.h" 1351184Sbostic #include "buf.h" 1451184Sbostic #include "vnode.h" 1551184Sbostic #include "specdev.h" 1651184Sbostic #include "mount.h" 1751184Sbostic #include "trace.h" 1851184Sbostic #include "resourcevar.h" 1951184Sbostic #include "lfs.h" 2051184Sbostic 2151184Sbostic /* 22*51215Sbostic * LFS version of bawrite, bdwrite, bwrite. Set the delayed write flag and 23*51215Sbostic * use reassignbuf to move the buffer from the clean list to the dirty one, 24*51215Sbostic * then unlock the buffer. 2551184Sbostic */ 2651184Sbostic lfs_bwrite(bp) 2751184Sbostic register BUF *bp; 2851184Sbostic { 29*51215Sbostic #ifdef DO_ACCOUNTING 30*51215Sbostic Not included as this gets called from lots of places where the 31*51215Sbostic current proc structure is probably wrong. Ignore for now. 3251184Sbostic curproc->p_stats->p_ru.ru_oublock++; /* XXX: no one paid yet */ 33*51215Sbostic #endif 34*51215Sbostic bp->b_flags &= ~(B_READ | B_DONE | B_ERROR); 35*51215Sbostic bp->b_flags |= B_WRITE | B_DELWRI; 36*51215Sbostic reassignbuf(bp, bp->b_vp); /* XXX: do this inline? */ 3751184Sbostic brelse(bp); 3851184Sbostic } 39*51215Sbostic #endif /* LOGFS */ 40