Date: Tue, 19 Jan 2021 09:22:04 GMT From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 6d386b4c8a97 - main - cache: save a branch in cache_fplookup_next Message-ID: <202101190922.10J9M46e022923@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=6d386b4c8a970d3b080d77e2561d6073307362e4 commit 6d386b4c8a970d3b080d77e2561d6073307362e4 Author: Mateusz Guzik <mjg@FreeBSD.org> AuthorDate: 2021-01-19 09:08:24 +0000 Commit: Mateusz Guzik <mjg@FreeBSD.org> CommitDate: 2021-01-19 09:08:24 +0000 cache: save a branch in cache_fplookup_next Previously the code would branch on top find out whether it should branch on SDT probe and bumping the numposhits counter, depending on cache_fplookup_cross_mount. Arguably it should be done regardless of what said function returns. --- sys/kern/vfs_cache.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 7eb9237bf257..420a54baf3f2 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4748,16 +4748,14 @@ cache_fplookup_next(struct cache_fpl *fpl) return (cache_fpl_partial(fpl)); } + counter_u64_add(numposhits, 1); + SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, tvp); + + error = 0; if (cache_fplookup_is_mp(fpl)) { error = cache_fplookup_cross_mount(fpl); - if (__predict_false(error != 0)) { - return (error); - } } - - counter_u64_add(numposhits, 1); - SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, tvp); - return (0); + return (error); } static bool
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101190922.10J9M46e022923>