Use atomic operations on runningbufspace.

PR:		kern/84318
Submitted by:	ade
MFC after:	3 days
This commit is contained in:
Suleiman Souhlal 2005-08-08 22:44:10 +00:00
parent 3155122ec2
commit 4f12e0acb0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=148875

View File

@ -65,6 +65,8 @@ __FBSDID("$FreeBSD$");
#include <sys/conf.h>
#include <sys/sf_buf.h>
#include <machine/atomic.h>
#include <vm/vm.h>
#include <vm/vm_object.h>
#include <vm/vm_page.h>
@ -546,7 +548,7 @@ vnode_pager_input_smlfs(object, m)
bp->b_bcount = bsize;
bp->b_bufsize = bsize;
bp->b_runningbufspace = bp->b_bufsize;
runningbufspace += bp->b_runningbufspace;
atomic_add_int(&runningbufspace, bp->b_runningbufspace);
/* do the input */
bp->b_iooffset = dbtob(bp->b_blkno);
@ -898,7 +900,7 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage)
bp->b_bcount = size;
bp->b_bufsize = size;
bp->b_runningbufspace = bp->b_bufsize;
runningbufspace += bp->b_runningbufspace;
atomic_add_int(&runningbufspace, bp->b_runningbufspace);
cnt.v_vnodein++;
cnt.v_vnodepgsin += count;