1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-01 08:27:59 +00:00

Expand LOCKMGR() compat macro.

This commit is contained in:
John Baldwin 2001-11-27 00:08:04 +00:00
parent cfaffc10b5
commit b2ba87cec3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=86929
6 changed files with 17 additions and 15 deletions

View File

@ -391,7 +391,6 @@ MALLOC_DECLARE(M_HPFSNO);
#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))
#define LOCKMGR(a, b, c, d) lockmgr((a), (b), (c), (d))
extern vop_t ** hpfs_vnodeop_p;

View File

@ -113,7 +113,8 @@ hpfs_hphashget(dev, ino)
mtx_lock(&hpfs_hphash_mtx);
LIST_FOREACH(hp, HPNOHASH(dev, ino), h_hash) {
if (ino == hp->h_no && dev == hp->h_dev) {
LOCKMGR(&hp->h_intlock, LK_EXCLUSIVE | LK_INTERLOCK, &hpfs_hphash_slock, NULL);
lockmgr(&hp->h_intlock, LK_EXCLUSIVE | LK_INTERLOCK,
&hpfs_hphash_slock, NULL);
return (hp);
}
}

View File

@ -78,8 +78,8 @@ int hpfs_breadstruct (struct hpfsmount *, lsn_t, u_int, u_int32_t,
hpfs_breadstruct(hpmp, lsn, D_BSIZE, D_MAGIC, bpp)
#if 0
#define hpfs_hplock(hp, p) LOCKMGR(&(hp)->h_intlock, LK_EXCLUSIVE, (p))
#define hpfs_hpunlock(hp, p) LOCKMGR(&(hp)->h_intlock, LK_RELEASE, (p))
#define hpfs_hplock(hp, p) lockmgr(&(hp)->h_intlock, LK_EXCLUSIVE, (p), NULL)
#define hpfs_hpunlock(hp, p) lockmgr(&(hp)->h_intlock, LK_RELEASE, (p), NULL)
#endif
int hpfs_hpbmap (struct hpfsnode *, daddr_t, daddr_t *, int *);

View File

@ -536,11 +536,11 @@ hpfs_vget(
vput(vp);
return (0);
}
} while(LOCKMGR(&hpfs_hphash_lock,LK_EXCLUSIVE|LK_SLEEPFAIL,NULL,NULL));
} while(lockmgr(&hpfs_hphash_lock,LK_EXCLUSIVE|LK_SLEEPFAIL,NULL,NULL));
hpfs_hphashins(hp);
LOCKMGR(&hpfs_hphash_lock, LK_RELEASE, NULL, NULL);
lockmgr(&hpfs_hphash_lock, LK_RELEASE, NULL, NULL);
error = bread(hpmp->hpm_devvp, ino, FNODESIZE, NOCRED, &bp);
if (error) {

View File

@ -293,7 +293,6 @@ MALLOC_DECLARE(M_NTFSNTHASH);
#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))
#define LOCKMGR(a, b, c) lockmgr((a), (b), (c), NULL)
#if defined(NTFS_DEBUG)
#define dprintf(a) printf a

View File

@ -355,7 +355,8 @@ ntfs_ntget(ip)
mtx_lock(&ip->i_interlock);
ip->i_usecount++;
LOCKMGR(&ip->i_lock, LK_EXCLUSIVE | LK_INTERLOCK, &ip->i_interlock);
lockmgr(&ip->i_lock, LK_EXCLUSIVE | LK_INTERLOCK, &ip->i_interlock,
NULL);
return 0;
}
@ -385,7 +386,8 @@ ntfs_ntlookup(
*ipp = ip;
return (0);
}
} while (LOCKMGR(&ntfs_hashlock, LK_EXCLUSIVE | LK_SLEEPFAIL, NULL));
} while (lockmgr(&ntfs_hashlock, LK_EXCLUSIVE | LK_SLEEPFAIL, NULL,
NULL));
MALLOC(ip, struct ntnode *, sizeof(struct ntnode), M_NTFSNTNODE,
M_WAITOK | M_ZERO);
@ -407,7 +409,7 @@ ntfs_ntlookup(
ntfs_nthashins(ip);
LOCKMGR(&ntfs_hashlock, LK_RELEASE, NULL);
lockmgr(&ntfs_hashlock, LK_RELEASE, NULL, NULL);
*ipp = ip;
@ -443,7 +445,8 @@ ntfs_ntput(ip)
#endif
if (ip->i_usecount > 0) {
LOCKMGR(&ip->i_lock, LK_RELEASE|LK_INTERLOCK, &ip->i_interlock);
lockmgr(&ip->i_lock, LK_RELEASE|LK_INTERLOCK, &ip->i_interlock,
NULL);
return;
}
@ -1928,7 +1931,7 @@ ntfs_toupper_use(mp, ntmp)
struct vnode *vp;
/* get exclusive access */
LOCKMGR(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL);
lockmgr(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL, NULL);
/* only read the translation data from a file if it hasn't been
* read already */
@ -1951,7 +1954,7 @@ ntfs_toupper_use(mp, ntmp)
out:
ntfs_toupper_usecount++;
LOCKMGR(&ntfs_toupper_lock, LK_RELEASE, NULL);
lockmgr(&ntfs_toupper_lock, LK_RELEASE, NULL, NULL);
return (error);
}
@ -1963,7 +1966,7 @@ void
ntfs_toupper_unuse()
{
/* get exclusive access */
LOCKMGR(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL);
lockmgr(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL, NULL);
ntfs_toupper_usecount--;
if (ntfs_toupper_usecount == 0) {
@ -1978,7 +1981,7 @@ ntfs_toupper_unuse()
#endif
/* release the lock */
LOCKMGR(&ntfs_toupper_lock, LK_RELEASE, NULL);
lockmgr(&ntfs_toupper_lock, LK_RELEASE, NULL, NULL);
}
int