1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-30 08:19:09 +00:00

Minor code optimisation.

Avoid locking the global CUSE lock when the polling flags are zero.

MFC after:	1 week
This commit is contained in:
Hans Petter Selasky 2017-05-31 21:05:24 +00:00
parent 6166fdcebc
commit 9a83b0971e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=319355

View File

@ -1507,8 +1507,8 @@ cuse_client_kqfilter_poll(struct cdev *dev, struct cuse_client *pcc)
/* get the latest polling state from the server */
temp = cuse_client_poll(dev, POLLIN | POLLOUT, NULL);
cuse_lock();
if (temp & (POLLIN | POLLOUT)) {
cuse_lock();
if (temp & POLLIN)
pcc->cflags |= CUSE_CLI_KNOTE_NEED_READ;
if (temp & POLLOUT)
@ -1516,8 +1516,8 @@ cuse_client_kqfilter_poll(struct cdev *dev, struct cuse_client *pcc)
/* make sure the "knote" gets woken up */
cuse_server_wakeup_locked(pcc->server);
cuse_unlock();
}
cuse_unlock();
}
}