From owner-svn-src-head@freebsd.org Thu Dec 29 16:35:51 2016 Return-Path: Delivered-To: svn-src-head@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 22769C95746; Thu, 29 Dec 2016 16:35:51 +0000 (UTC) (envelope-from mjg@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 CE1381933; Thu, 29 Dec 2016 16:35:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBTGZo14091754; Thu, 29 Dec 2016 16:35:50 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBTGZo4W091753; Thu, 29 Dec 2016 16:35:50 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612291635.uBTGZo4W091753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 29 Dec 2016 16:35:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310779 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 16:35:51 -0000 Author: mjg Date: Thu Dec 29 16:35:49 2016 New Revision: 310779 URL: https://svnweb.freebsd.org/changeset/base/310779 Log: cache: sprinkle __predict_false Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Dec 29 15:09:34 2016 (r310778) +++ head/sys/kern/vfs_cache.c Thu Dec 29 16:35:49 2016 (r310779) @@ -1104,7 +1104,7 @@ cache_lookup(struct vnode *dvp, struct v uint32_t hash; int error, ltype; - if (!doingcache) { + if (__predict_false(!doingcache)) { cnp->cn_flags &= ~MAKEENTRY; return (0); } @@ -1544,13 +1544,13 @@ cache_enter_time(struct vnode *dvp, stru VNASSERT(dvp == NULL || (dvp->v_iflag & VI_DOOMED) == 0, dvp, ("cache_enter: Doomed vnode used as src")); - if (!doingcache) + if (__predict_false(!doingcache)) return; /* * Avoid blowout in namecache entries. */ - if (numcache >= desiredvnodes * ncsizefactor) + if (__predict_false(numcache >= desiredvnodes * ncsizefactor)) return; cache_celockstate_init(&cel); @@ -2054,9 +2054,9 @@ kern___getcwd(struct thread *td, char *b struct vnode *cdir, *rdir; int error; - if (disablecwd) + if (__predict_false(disablecwd)) return (ENODEV); - if (buflen < 2) + if (__predict_false(buflen < 2)) return (EINVAL); if (buflen > path_max) buflen = path_max; @@ -2107,9 +2107,9 @@ vn_fullpath(struct thread *td, struct vn struct vnode *rdir; int error; - if (disablefullpath) + if (__predict_false(disablefullpath)) return (ENODEV); - if (vn == NULL) + if (__predict_false(vn == NULL)) return (EINVAL); buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); @@ -2141,9 +2141,9 @@ vn_fullpath_global(struct thread *td, st char *buf; int error; - if (disablefullpath) + if (__predict_false(disablefullpath)) return (ENODEV); - if (vn == NULL) + if (__predict_false(vn == NULL)) return (EINVAL); buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); error = vn_fullpath1(td, vn, rootvnode, buf, retbuf, MAXPATHLEN); @@ -2407,7 +2407,7 @@ vn_path_to_global_path(struct thread *td ASSERT_VOP_ELOCKED(vp, __func__); /* Return ENODEV if sysctl debug.disablefullpath==1 */ - if (disablefullpath) + if (__predict_false(disablefullpath)) return (ENODEV); /* Construct global filesystem path from vp. */