From owner-svn-src-stable-11@freebsd.org Sun Jun 18 18:09:32 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7496AD8AF00; Sun, 18 Jun 2017 18:09:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4110B77205; Sun, 18 Jun 2017 18:09:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5II9VuH074933; Sun, 18 Jun 2017 18:09:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5II9VSD074932; Sun, 18 Jun 2017 18:09:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201706181809.v5II9VSD074932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 18 Jun 2017 18:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320075 - stable/11/sys/fs/cuse X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jun 2017 18:09:32 -0000 Author: hselasky Date: Sun Jun 18 18:09:31 2017 New Revision: 320075 URL: https://svnweb.freebsd.org/changeset/base/320075 Log: MFC r319355: Minor code optimisation. Avoid locking the global CUSE lock when the polling flags are zero. Approved by: re (kib) Modified: stable/11/sys/fs/cuse/cuse.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/cuse/cuse.c ============================================================================== --- stable/11/sys/fs/cuse/cuse.c Sun Jun 18 17:26:54 2017 (r320074) +++ stable/11/sys/fs/cuse/cuse.c Sun Jun 18 18:09:31 2017 (r320075) @@ -1507,8 +1507,8 @@ cuse_client_kqfilter_poll(struct cdev *dev, struct cus /* 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 cus /* make sure the "knote" gets woken up */ cuse_server_wakeup_locked(pcc->server); + cuse_unlock(); } - cuse_unlock(); } }