From owner-svn-src-stable@freebsd.org Thu Jul 6 22:03:59 2017 Return-Path: Delivered-To: svn-src-stable@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 CCA51D93292; Thu, 6 Jul 2017 22:03:59 +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 9FCA48176C; Thu, 6 Jul 2017 22:03:59 +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 v66M3w52031687; Thu, 6 Jul 2017 22:03:58 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v66M3wGi031686; Thu, 6 Jul 2017 22:03:58 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201707062203.v66M3wGi031686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 6 Jul 2017 22:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320756 - stable/10/sys/kern X-SVN-Group: stable-10 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: stable/10/sys/kern X-SVN-Commit-Revision: 320756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jul 2017 22:03:59 -0000 Author: mjg Date: Thu Jul 6 22:03:58 2017 New Revision: 320756 URL: https://svnweb.freebsd.org/changeset/base/320756 Log: MFC r293295: cache: ansify functions and fix some style issues No functional changes. Modified: stable/10/sys/kern/vfs_cache.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_cache.c ============================================================================== --- stable/10/sys/kern/vfs_cache.c Thu Jul 6 21:47:17 2017 (r320755) +++ stable/10/sys/kern/vfs_cache.c Thu Jul 6 22:03:58 2017 (r320756) @@ -289,7 +289,7 @@ static u_long nummiss; STATNODE(CTLFLAG_RD, nummiss, & "Number of cache misses"); static u_long nummisszap; STATNODE(CTLFLAG_RD, nummisszap, &nummisszap, "Number of cache misses we do not want to cache"); -static u_long numposzaps; STATNODE(CTLFLAG_RD, numposzaps, &numposzaps, +static u_long numposzaps; STATNODE(CTLFLAG_RD, numposzaps, &numposzaps, "Number of cache hits (positive) we do not want to cache"); static u_long numposhits; STATNODE(CTLFLAG_RD, numposhits, &numposhits, "Number of cache hits (positive)"); @@ -304,8 +304,6 @@ SYSCTL_OPAQUE(_vfs_cache, OID_AUTO, nchstats, CTLFLAG_ &nchstats, sizeof(nchstats), "LU", "VFS cache effectiveness statistics"); - - static void cache_zap(struct namecache *ncp); static int vn_vptocnp_locked(struct vnode **vp, struct ucred *cred, char *buf, u_int *buflen); @@ -411,8 +409,7 @@ SYSCTL_PROC(_debug_hashstat, OID_AUTO, nchash, CTLTYPE * pointer to a vnode or if it is just a negative cache entry. */ static void -cache_zap(ncp) - struct namecache *ncp; +cache_zap(struct namecache *ncp) { struct vnode *vp; @@ -447,7 +444,7 @@ cache_zap(ncp) } numcache--; cache_free(ncp); - if (vp) + if (vp != NULL) vdrop(vp); } @@ -469,12 +466,8 @@ cache_zap(ncp) */ int -cache_lookup(dvp, vpp, cnp, tsp, ticksp) - struct vnode *dvp; - struct vnode **vpp; - struct componentname *cnp; - struct timespec *tsp; - int *ticksp; +cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, + struct timespec *tsp, int *ticksp) { struct namecache *ncp; uint32_t hash; @@ -702,12 +695,8 @@ unlock: * Add an entry to the cache. */ void -cache_enter_time(dvp, vp, cnp, tsp, dtsp) - struct vnode *dvp; - struct vnode *vp; - struct componentname *cnp; - struct timespec *tsp; - struct timespec *dtsp; +cache_enter_time(struct vnode *dvp, struct vnode *vp, struct componentname *cnp, + struct timespec *tsp, struct timespec *dtsp) { struct namecache *ncp, *n2; struct namecache_ts *n3; @@ -837,9 +826,9 @@ cache_enter_time(dvp, vp, cnp, tsp, dtsp) * has populated v_cache_dd pointer already. */ if (dvp->v_cache_dd != NULL) { - CACHE_WUNLOCK(); - cache_free(ncp); - return; + CACHE_WUNLOCK(); + cache_free(ncp); + return; } KASSERT(vp == NULL || vp->v_type == VDIR, ("wrong vnode type %p", vp)); @@ -847,7 +836,7 @@ cache_enter_time(dvp, vp, cnp, tsp, dtsp) } numcache++; - if (!vp) { + if (vp == NULL) { numneg++; if (cnp->cn_flags & ISWHITEOUT) ncp->nc_flag |= NCF_WHITE; @@ -885,7 +874,7 @@ cache_enter_time(dvp, vp, cnp, tsp, dtsp) * "negative" cache queue, otherwise, we place it into the * destination vnode's cache entries queue. */ - if (vp) { + if (vp != NULL) { TAILQ_INSERT_HEAD(&vp->v_cache_dst, ncp, nc_dst); SDT_PROBE3(vfs, namecache, enter, done, dvp, nc_get_name(ncp), vp); @@ -976,8 +965,7 @@ cache_changesize(int newmaxvnodes) * Invalidate all entries to a particular vnode. */ void -cache_purge(vp) - struct vnode *vp; +cache_purge(struct vnode *vp) { CTR1(KTR_VFS, "cache_purge(%p)", vp); @@ -1000,8 +988,7 @@ cache_purge(vp) * Invalidate all negative entries for a particular directory vnode. */ void -cache_purge_negative(vp) - struct vnode *vp; +cache_purge_negative(struct vnode *vp) { struct namecache *cp, *ncp; @@ -1019,8 +1006,7 @@ cache_purge_negative(vp) * Flush all entries referencing a particular filesystem. */ void -cache_purgevfs(mp) - struct mount *mp; +cache_purgevfs(struct mount *mp) { struct nchashhead *ncpp; struct namecache *ncp, *nnp; @@ -1043,12 +1029,7 @@ cache_purgevfs(mp) */ int -vfs_cache_lookup(ap) - struct vop_lookup_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - } */ *ap; +vfs_cache_lookup(struct vop_lookup_args *ap) { struct vnode *dvp; int error; @@ -1089,9 +1070,7 @@ SYSCTL_INT(_debug, OID_AUTO, disablecwd, CTLFLAG_RW, & /* Implementation of the getcwd syscall. */ int -sys___getcwd(td, uap) - struct thread *td; - struct __getcwd_args *uap; +sys___getcwd(struct thread *td, struct __getcwd_args *uap) { return (kern___getcwd(td, uap->buf, UIO_USERSPACE, uap->buflen));