summaryrefslogtreecommitdiffstats
path: root/sys/fs/ntfs
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2008-01-08 23:48:31 +0000
committerattilio <attilio@FreeBSD.org>2008-01-08 23:48:31 +0000
commit9e182da1916d63733010443cc5d45688fe47c3e7 (patch)
tree8b4bc5a73ee6f8eec360e2bca8b5a48ec5a6bea6 /sys/fs/ntfs
parent1975c095433557ab04b0b28101fb49a9320af637 (diff)
downloadFreeBSD-src-9e182da1916d63733010443cc5d45688fe47c3e7.zip
FreeBSD-src-9e182da1916d63733010443cc5d45688fe47c3e7.tar.gz
Remove explicit calling of lockmgr() with the NULL argument.
Now, lockmgr() function can only be called passing curthread and the KASSERT() is upgraded according with this. In order to support on-the-fly owner switching, the new function lockmgr_disown() has been introduced and gets used in BUF_KERNPROC(). KPI, so, results changed and FreeBSD version will be bumped soon. Differently from previous code, we assume idle thread cannot try to acquire the lockmgr as it cannot sleep, so loose the relative check[1] in BUF_KERNPROC(). Tested by: kris [1] kib asked for a KASSERT in the lockmgr_disown() about this condition, but after thinking at it, as this is a well known general rule, I found it not really necessary.
Diffstat (limited to 'sys/fs/ntfs')
-rw-r--r--sys/fs/ntfs/ntfs_subr.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/fs/ntfs/ntfs_subr.c b/sys/fs/ntfs/ntfs_subr.c
index 972cfb0..330252f 100644
--- a/sys/fs/ntfs/ntfs_subr.c
+++ b/sys/fs/ntfs/ntfs_subr.c
@@ -359,7 +359,7 @@ ntfs_ntget(ip)
mtx_lock(&ip->i_interlock);
ip->i_usecount++;
lockmgr(&ip->i_lock, LK_EXCLUSIVE | LK_INTERLOCK, &ip->i_interlock,
- NULL);
+ curthread);
return 0;
}
@@ -391,7 +391,7 @@ ntfs_ntlookup(
return (0);
}
} while (lockmgr(&ntfs_hashlock, LK_EXCLUSIVE | LK_SLEEPFAIL, NULL,
- NULL));
+ curthread));
MALLOC(ip, struct ntnode *, sizeof(struct ntnode), M_NTFSNTNODE,
M_WAITOK | M_ZERO);
@@ -413,7 +413,7 @@ ntfs_ntlookup(
ntfs_nthashins(ip);
- lockmgr(&ntfs_hashlock, LK_RELEASE, NULL, NULL);
+ lockmgr(&ntfs_hashlock, LK_RELEASE, NULL, curthread);
*ipp = ip;
@@ -450,7 +450,7 @@ ntfs_ntput(ip)
if (ip->i_usecount > 0) {
lockmgr(&ip->i_lock, LK_RELEASE|LK_INTERLOCK, &ip->i_interlock,
- NULL);
+ curthread);
return;
}
@@ -1982,7 +1982,7 @@ ntfs_toupper_use(mp, ntmp)
struct vnode *vp;
/* get exclusive access */
- lockmgr(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL, NULL);
+ lockmgr(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL, curthread);
/* only read the translation data from a file if it hasn't been
* read already */
@@ -2005,7 +2005,7 @@ ntfs_toupper_use(mp, ntmp)
out:
ntfs_toupper_usecount++;
- lockmgr(&ntfs_toupper_lock, LK_RELEASE, NULL, NULL);
+ lockmgr(&ntfs_toupper_lock, LK_RELEASE, NULL, curthread);
return (error);
}
@@ -2017,7 +2017,7 @@ void
ntfs_toupper_unuse()
{
/* get exclusive access */
- lockmgr(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL, NULL);
+ lockmgr(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL, curthread);
ntfs_toupper_usecount--;
if (ntfs_toupper_usecount == 0) {
@@ -2032,7 +2032,7 @@ ntfs_toupper_unuse()
#endif
/* release the lock */
- lockmgr(&ntfs_toupper_lock, LK_RELEASE, NULL, NULL);
+ lockmgr(&ntfs_toupper_lock, LK_RELEASE, NULL, curthread);
}
int
OpenPOWER on IntegriCloud