151184Sbostic /* 2*51493Sbostic * Copyright (c) 1991 Regents of the University of California. 351184Sbostic * All rights reserved. 451184Sbostic * 551184Sbostic * %sccs.include.redist.c% 651184Sbostic * 7*51493Sbostic * @(#)lfs_bio.c 7.1 (Berkeley) 11/01/91 851184Sbostic */ 951184Sbostic 1051480Sbostic #include <sys/param.h> 1151480Sbostic #include <sys/proc.h> 1251480Sbostic #include <sys/buf.h> 1351480Sbostic #include <sys/resourcevar.h> 1451184Sbostic 15*51493Sbostic #include <ufs/lfs/lfs.h> 16*51493Sbostic #include <ufs/lfs/lfs_extern.h> 1751480Sbostic 1851184Sbostic /* 1951215Sbostic * LFS version of bawrite, bdwrite, bwrite. Set the delayed write flag and 2051215Sbostic * use reassignbuf to move the buffer from the clean list to the dirty one, 2151215Sbostic * then unlock the buffer. 22*51493Sbostic * 23*51493Sbostic * XXX No accounting for the cost of the write is currently done. 24*51493Sbostic * XXX This is almost certainly wrong for synchronous operations, i.e. NFS. 2551184Sbostic */ 2651480Sbostic int 2751184Sbostic lfs_bwrite(bp) 2851184Sbostic register BUF *bp; 2951184Sbostic { 3051215Sbostic bp->b_flags &= ~(B_READ | B_DONE | B_ERROR); 3151215Sbostic bp->b_flags |= B_WRITE | B_DELWRI; 3251215Sbostic reassignbuf(bp, bp->b_vp); /* XXX: do this inline? */ 3351184Sbostic brelse(bp); 3451480Sbostic return (0); 3551184Sbostic } 36