summaryrefslogtreecommitdiffstats
path: root/sys/sys/buf.h
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
committerjulian <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
commit5596676e6c6c1e81e899cd0531f9b1c28a292669 (patch)
treeb1a19fcdf05759281fab0d89efb13f0fdf42102e /sys/sys/buf.h
parent83e00d4274950d2b531c24692cd123538ffbddb9 (diff)
downloadFreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.zip
FreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.tar.gz
KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
Diffstat (limited to 'sys/sys/buf.h')
-rw-r--r--sys/sys/buf.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/sys/buf.h b/sys/sys/buf.h
index 21646ad..28c22ae 100644
--- a/sys/sys/buf.h
+++ b/sys/sys/buf.h
@@ -249,7 +249,7 @@ struct buf {
extern struct mtx buftimelock; /* Interlock on setting prio and timo */
extern char *buf_wmesg; /* Default buffer lock message */
#define BUF_WMESG "bufwait"
-#include <sys/proc.h> /* XXX for curproc */
+#include <sys/proc.h> /* XXX for curthread */
#include <sys/mutex.h>
/*
@@ -273,7 +273,7 @@ BUF_LOCK(struct buf *bp, int locktype)
bp->b_lock.lk_wmesg = buf_wmesg;
bp->b_lock.lk_prio = PRIBIO + 4;
bp->b_lock.lk_timo = 0;
- ret = lockmgr(&(bp)->b_lock, locktype, &buftimelock, curproc);
+ ret = lockmgr(&(bp)->b_lock, locktype, &buftimelock, curthread);
splx(s);
return ret;
}
@@ -292,7 +292,7 @@ BUF_TIMELOCK(struct buf *bp, int locktype, char *wmesg, int catch, int timo)
bp->b_lock.lk_wmesg = wmesg;
bp->b_lock.lk_prio = (PRIBIO + 4) | catch;
bp->b_lock.lk_timo = timo;
- ret = lockmgr(&(bp)->b_lock, (locktype), &buftimelock, curproc);
+ ret = lockmgr(&(bp)->b_lock, (locktype), &buftimelock, curthread);
splx(s);
return ret;
}
@@ -307,7 +307,7 @@ BUF_UNLOCK(struct buf *bp)
int s;
s = splbio();
- lockmgr(&(bp)->b_lock, LK_RELEASE, NULL, curproc);
+ lockmgr(&(bp)->b_lock, LK_RELEASE, NULL, curthread);
splx(s);
}
@@ -332,10 +332,11 @@ static __inline void BUF_KERNPROC __P((struct buf *));
static __inline void
BUF_KERNPROC(struct buf *bp)
{
- struct proc *p = curproc;
+ struct thread *td = curthread;
- if (p != PCPU_GET(idleproc) && bp->b_lock.lk_lockholder == p->p_pid)
- p->p_locks--;
+ if ((td != PCPU_GET(idlethread))
+ && bp->b_lock.lk_lockholder == td->td_proc->p_pid)
+ td->td_locks--;
bp->b_lock.lk_lockholder = LK_KERNPROC;
}
#endif
OpenPOWER on IntegriCloud