1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00

GC compat macros HASHINIT, VOP__LOCK, VOP__UNLOCK, VGET, and VN_LOCK.

This commit is contained in:
John Baldwin 2001-11-27 00:18:33 +00:00
parent b2ba87cec3
commit c5c6ef2c27
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=86930
8 changed files with 25 additions and 38 deletions

View File

@ -386,12 +386,6 @@ MALLOC_DECLARE(M_HPFSNO);
#define HPTOV(h) ((struct vnode *)((h)->h_vp))
#define FID(f) (*((lsn_t *)(f)->fid_data))
#define HASHINIT(a, b, c, d) hashinit((a), (b), (d))
#define VOP__LOCK(a, b, c) VOP_LOCK((a), (b), (c))
#define VOP__UNLOCK(a, b, c) VOP_UNLOCK((a), (b), (c))
#define VGET(a, b, c) vget((a), (b), (c))
#define VN_LOCK(a, b, c) vn_lock((a), (b), (c))
extern vop_t ** hpfs_vnodeop_p;
/* Hash routines, too small to be separate header */

View File

@ -65,8 +65,7 @@ hpfs_hphashinit()
{
lockinit (&hpfs_hphash_lock, PINOD, "hpfs_hphashlock", 0, 0);
hpfs_hphashtbl = HASHINIT(desiredvnodes, M_HPFSHASH, M_WAITOK,
&hpfs_hphash);
hpfs_hphashtbl = hashinit(desiredvnodes, M_HPFSHASH, &hpfs_hphash);
mtx_init(&hpfs_hphash_mtx, "hpfs hphash", MTX_DEF);
}

View File

@ -238,16 +238,16 @@ hpfs_mountfs(devvp, mp, argsp, p)
if (ncount > 1 && devvp != rootvp)
return (EBUSY);
VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, p);
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
error = vinvalbuf(devvp, V_SAVE, p->td_proc->p_ucred, p, 0, 0);
VOP__UNLOCK(devvp, 0, p);
VOP_UNLOCK(devvp, 0, p);
if (error)
return (error);
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, p);
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p);
VOP__UNLOCK(devvp, 0, p);
VOP_UNLOCK(devvp, 0, p);
if (error)
return (error);
@ -524,7 +524,7 @@ hpfs_vget(
hp->h_devvp = hpmp->hpm_devvp;
VREF(hp->h_devvp);
error = VN_LOCK(vp, LK_EXCLUSIVE, p);
error = vn_lock(vp, LK_EXCLUSIVE, p);
if (error) {
vput(vp);
return (error);

View File

@ -616,12 +616,12 @@ hpfs_inactive(ap)
vprint("hpfs_inactive: pushing active", vp);
if (hp->h_flag & H_INVAL) {
VOP__UNLOCK(vp,0,ap->a_td);
VOP_UNLOCK(vp,0,ap->a_td);
vrecycle(vp, NULL, ap->a_td);
return (0);
}
VOP__UNLOCK(vp,0,ap->a_td);
VOP_UNLOCK(vp,0,ap->a_td);
return (0);
}
@ -1104,17 +1104,17 @@ hpfs_lookup(ap)
dprintf(("hpfs_lookup(0x%x,...): .. faked (0x%x)\n",
dhp->h_no, dhp->h_fn.fn_parent));
VOP__UNLOCK(dvp,0,cnp->cn_thread);
VOP_UNLOCK(dvp,0,cnp->cn_thread);
error = VFS_VGET(hpmp->hpm_mp,
dhp->h_fn.fn_parent, ap->a_vpp);
if(error) {
VOP__LOCK(dvp, 0, cnp->cn_thread);
VOP_LOCK(dvp, 0, cnp->cn_thread);
return(error);
}
if( lockparent && (flags & ISLASTCN) &&
(error = VOP__LOCK(dvp, 0, cnp->cn_thread)) ) {
(error = VOP_LOCK(dvp, 0, cnp->cn_thread)) ) {
vput( *(ap->a_vpp) );
return (error);
}
@ -1130,7 +1130,7 @@ hpfs_lookup(ap)
if ((error == ENOENT) && (flags & ISLASTCN) &&
(nameiop == CREATE || nameiop == RENAME)) {
if(!lockparent)
VOP__UNLOCK(dvp, 0, cnp->cn_thread);
VOP_UNLOCK(dvp, 0, cnp->cn_thread);
cnp->cn_flags |= SAVENAME;
return (EJUSTRETURN);
}
@ -1176,7 +1176,7 @@ hpfs_lookup(ap)
brelse(bp);
if(!lockparent || !(flags & ISLASTCN))
VOP__UNLOCK(dvp, 0, cnp->cn_thread);
VOP_UNLOCK(dvp, 0, cnp->cn_thread);
if ((flags & MAKEENTRY) &&
(!(flags & ISLASTCN) ||
(nameiop != DELETE && nameiop != CREATE)))

View File

@ -289,11 +289,6 @@ MALLOC_DECLARE(M_NTFSDIR);
MALLOC_DECLARE(M_NTFSNTHASH);
#endif
#define HASHINIT(a, b, c, d) hashinit((a), (b), (d))
#define VOP__UNLOCK(a, b, c) VOP_UNLOCK((a), (b), (c))
#define VGET(a, b, c) vget((a), (b), (c))
#define VN_LOCK(a, b, c) vn_lock((a), (b), (c))
#if defined(NTFS_DEBUG)
#define dprintf(a) printf a
#if NTFS_DEBUG > 1

View File

@ -67,8 +67,7 @@ void
ntfs_nthashinit()
{
lockinit(&ntfs_hashlock, PINOD, "ntfs_nthashlock", 0, 0);
ntfs_nthashtbl = HASHINIT(desiredvnodes, M_NTFSNTHASH, M_WAITOK,
&ntfs_nthash);
ntfs_nthashtbl = hashinit(desiredvnodes, M_NTFSNTHASH, &ntfs_nthash);
mtx_init(&ntfs_nthash_mtx, "ntfs nthash", MTX_DEF);
}

View File

@ -293,16 +293,16 @@ ntfs_mountfs(devvp, mp, argsp, td)
ncount -= 1;
if (ncount > 1 && devvp != rootvp)
return (EBUSY);
VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, td);
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
error = vinvalbuf(devvp, V_SAVE, td->td_proc->p_ucred, td, 0, 0);
VOP__UNLOCK(devvp, 0, td);
VOP_UNLOCK(devvp, 0, td);
if (error)
return (error);
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, td);
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, td);
VOP__UNLOCK(devvp, 0, td);
VOP_UNLOCK(devvp, 0, td);
if (error)
return (error);
@ -727,7 +727,7 @@ ntfs_vgetex(
}
if (FTOV(fp)) {
VGET(FTOV(fp), lkflags, td);
vget(FTOV(fp), lkflags, td);
*vpp = FTOV(fp);
ntfs_ntput(ip);
return (0);
@ -752,7 +752,7 @@ ntfs_vgetex(
ntfs_ntput(ip);
if (lkflags & LK_TYPE_MASK) {
error = VN_LOCK(vp, lkflags, td);
error = vn_lock(vp, lkflags, td);
if (error) {
vput(vp);
return (error);

View File

@ -185,7 +185,7 @@ ntfs_inactive(ap)
if (ntfs_prtactive && vp->v_usecount != 0)
vprint("ntfs_inactive: pushing active", vp);
VOP__UNLOCK(vp, 0, ap->a_td);
VOP_UNLOCK(vp, 0, ap->a_td);
/* XXX since we don't support any filesystem changes
* right now, nothing more needs to be done
@ -624,7 +624,7 @@ ntfs_lookup(ap)
if(error)
return (error);
VOP__UNLOCK(dvp,0,cnp->cn_thread);
VOP_UNLOCK(dvp,0,cnp->cn_thread);
cnp->cn_flags |= PDIRUNLOCK;
dprintf(("ntfs_lookup: parentdir: %d\n",
@ -633,13 +633,13 @@ ntfs_lookup(ap)
vap->va_a_name->n_pnumber,ap->a_vpp);
ntfs_ntvattrrele(vap);
if (error) {
if (VN_LOCK(dvp,LK_EXCLUSIVE|LK_RETRY,cnp->cn_thread)==0)
if (vn_lock(dvp,LK_EXCLUSIVE|LK_RETRY,cnp->cn_thread)==0)
cnp->cn_flags &= ~PDIRUNLOCK;
return (error);
}
if (lockparent && (cnp->cn_flags & ISLASTCN)) {
error = VN_LOCK(dvp, LK_EXCLUSIVE, cnp->cn_thread);
error = vn_lock(dvp, LK_EXCLUSIVE, cnp->cn_thread);
if (error) {
vput( *(ap->a_vpp) );
return (error);
@ -657,7 +657,7 @@ ntfs_lookup(ap)
VTONT(*ap->a_vpp)->i_number));
if(!lockparent || !(cnp->cn_flags & ISLASTCN))
VOP__UNLOCK(dvp, 0, cnp->cn_thread);
VOP_UNLOCK(dvp, 0, cnp->cn_thread);
}
if (cnp->cn_flags & MAKEENTRY)