mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-16 23:57:54 +01:00
Replace usage of buf->b_actf by queue.3 and buf->b_act
This commit is contained in:
parent
c5c15c162f
commit
b96b6bb1e6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=15140
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)mfs_vfsops.c 8.4 (Berkeley) 4/16/94
|
||||
* $Id: mfs_vfsops.c,v 1.19 1995/12/14 20:16:15 bde Exp $
|
||||
* $Id: mfs_vfsops.c,v 1.20 1995/12/17 21:09:59 phk Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -296,7 +296,8 @@ mfs_mount(mp, path, data, ndp, p)
|
||||
mfsp->mfs_size = mfs_rootsize;
|
||||
mfsp->mfs_vnode = rootvp;
|
||||
mfsp->mfs_pid = p->p_pid;
|
||||
mfsp->mfs_buflist = (struct buf *)0;
|
||||
mfsp->mfs_active = 1;
|
||||
TAILQ_INIT(&mfsp->buf_queue);
|
||||
|
||||
/*
|
||||
* Attempt mount
|
||||
@ -379,7 +380,8 @@ mfs_mount(mp, path, data, ndp, p)
|
||||
mfsp->mfs_size = args.size;
|
||||
mfsp->mfs_vnode = devvp;
|
||||
mfsp->mfs_pid = p->p_pid;
|
||||
mfsp->mfs_buflist = (struct buf *)0;
|
||||
mfsp->mfs_active = 1;
|
||||
TAILQ_INIT(&mfsp->buf_queue);
|
||||
|
||||
/*
|
||||
* Since this is a new mount, we want the names for
|
||||
@ -402,7 +404,7 @@ mfs_mount(mp, path, data, ndp, p)
|
||||
bzero( mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
|
||||
|
||||
if (err = ffs_mountfs(devvp, mp, p)) {
|
||||
mfsp->mfs_buflist = (struct buf *)-1;
|
||||
mfsp->mfs_active = 0;
|
||||
goto error_2;
|
||||
}
|
||||
|
||||
@ -453,9 +455,9 @@ mfs_start(mp, flags, p)
|
||||
register int gotsig = 0;
|
||||
|
||||
base = mfsp->mfs_baseoff;
|
||||
while (mfsp->mfs_buflist != (struct buf *)(-1)) {
|
||||
while (bp = mfsp->mfs_buflist) {
|
||||
mfsp->mfs_buflist = bp->b_actf;
|
||||
while (mfsp->mfs_active) {
|
||||
while (bp = TAILQ_FIRST(&mfsp->buf_queue)) {
|
||||
TAILQ_REMOVE(&mfsp->buf_queue, bp, b_act);
|
||||
mfs_doio(bp, base);
|
||||
wakeup((caddr_t)bp);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)mfs_vnops.c 8.3 (Berkeley) 9/21/93
|
||||
* $Id: mfs_vnops.c,v 1.12 1995/11/09 08:14:29 bde Exp $
|
||||
* $Id: mfs_vnops.c,v 1.13 1995/12/17 21:10:01 phk Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -193,8 +193,7 @@ mfs_strategy(ap)
|
||||
} else if (mfsp->mfs_pid == p->p_pid) {
|
||||
mfs_doio(bp, mfsp->mfs_baseoff);
|
||||
} else {
|
||||
bp->b_actf = mfsp->mfs_buflist;
|
||||
mfsp->mfs_buflist = bp;
|
||||
TAILQ_INSERT_TAIL(&mfsp->buf_queue, bp, b_act);
|
||||
wakeup((caddr_t)vp);
|
||||
}
|
||||
return (0);
|
||||
@ -265,8 +264,8 @@ mfs_close(ap)
|
||||
/*
|
||||
* Finish any pending I/O requests.
|
||||
*/
|
||||
while (bp = mfsp->mfs_buflist) {
|
||||
mfsp->mfs_buflist = bp->b_actf;
|
||||
while (bp = TAILQ_FIRST(&mfsp->buf_queue)) {
|
||||
TAILQ_REMOVE(&mfsp->buf_queue, bp, b_act)
|
||||
mfs_doio(bp, mfsp->mfs_baseoff);
|
||||
wakeup((caddr_t)bp);
|
||||
}
|
||||
@ -283,12 +282,12 @@ mfs_close(ap)
|
||||
*/
|
||||
if (vp->v_usecount > 1)
|
||||
printf("mfs_close: ref count %d > 1\n", vp->v_usecount);
|
||||
if (vp->v_usecount > 1 || mfsp->mfs_buflist)
|
||||
if (vp->v_usecount > 1 || !TAILQ_EMPTY(&mfsp->buf_queue))
|
||||
panic("mfs_close");
|
||||
/*
|
||||
* Send a request to the filesystem server to exit.
|
||||
*/
|
||||
mfsp->mfs_buflist = (struct buf *)(-1);
|
||||
mfsp->mfs_active = 0;
|
||||
wakeup((caddr_t)vp);
|
||||
return (0);
|
||||
}
|
||||
@ -305,9 +304,9 @@ mfs_inactive(ap)
|
||||
{
|
||||
register struct mfsnode *mfsp = VTOMFS(ap->a_vp);
|
||||
|
||||
if (mfsp->mfs_buflist && mfsp->mfs_buflist != (struct buf *)(-1))
|
||||
panic("mfs_inactive: not inactive (mfs_buflist %x)",
|
||||
mfsp->mfs_buflist);
|
||||
if (!TAILQ_EMPTY(&mfsp->buf_queue))
|
||||
panic("mfs_inactive: not inactive (next buffer %p)",
|
||||
TAILQ_FIRST(&mfsp->buf_queue));
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)mfsnode.h 8.2 (Berkeley) 8/11/93
|
||||
* $Id: mfsnode.h,v 1.2 1994/08/02 07:54:46 davidg Exp $
|
||||
* $Id: mfsnode.h,v 1.3 1994/08/21 07:16:12 paul Exp $
|
||||
*/
|
||||
|
||||
#ifndef _UFS_MFS_MFSNODE_H_
|
||||
@ -46,7 +46,8 @@ struct mfsnode {
|
||||
caddr_t mfs_baseoff; /* base of file system in memory */
|
||||
long mfs_size; /* size of memory file system */
|
||||
pid_t mfs_pid; /* supporting process pid */
|
||||
struct buf *mfs_buflist; /* list of I/O requests */
|
||||
struct buf_queue_head buf_queue; /* list of I/O requests */
|
||||
int mfs_active;
|
||||
long mfs_spare[4];
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user