mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
Remove extra branching from r267232.
MFC after: 2 weeks
This commit is contained in:
parent
cb01313fba
commit
3345d73ca8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=267239
@ -995,18 +995,14 @@ void
|
||||
getnewvnode_reserve(u_int count)
|
||||
{
|
||||
struct thread *td;
|
||||
long num;
|
||||
|
||||
td = curthread;
|
||||
/* First try to be quick and racy. */
|
||||
if (numvnodes + count <= desiredvnodes) {
|
||||
num = atomic_fetchadd_long(&numvnodes, count);
|
||||
if (num + count <= desiredvnodes) {
|
||||
td->td_vp_reserv += count;
|
||||
return;
|
||||
} else
|
||||
atomic_subtract_long(&numvnodes, count);
|
||||
}
|
||||
if (atomic_fetchadd_long(&numvnodes, count) + count <= desiredvnodes) {
|
||||
td->td_vp_reserv += count;
|
||||
return;
|
||||
} else
|
||||
atomic_subtract_long(&numvnodes, count);
|
||||
|
||||
mtx_lock(&vnode_free_list_mtx);
|
||||
while (count > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user