Date: Sun, 16 Aug 2020 18:21:21 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364277 - head/sys/kern Message-ID: <202008161821.07GILLBt075425@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Sun Aug 16 18:21:21 2020 New Revision: 364277 URL: https://svnweb.freebsd.org/changeset/base/364277 Log: vfs: use namei_zone for getcwd allocations instead of malloc. Note that this should probably be wrapped with a dedicated API and other vn_getcwd callers did not get converted. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Aug 16 18:12:21 2020 (r364276) +++ head/sys/kern/vfs_cache.c Sun Aug 16 18:21:21 2020 (r364277) @@ -2427,11 +2427,11 @@ sys___getcwd(struct thread *td, struct __getcwd_args * if (buflen > MAXPATHLEN) buflen = MAXPATHLEN; - buf = malloc(buflen, M_TEMP, M_WAITOK); + buf = uma_zalloc(namei_zone, M_WAITOK); error = vn_getcwd(td, buf, &retbuf, &buflen); if (error == 0) error = copyout(retbuf, uap->buf, buflen); - free(buf, M_TEMP); + uma_zfree(namei_zone, buf); return (error); } @@ -2982,8 +2982,6 @@ DB_SHOW_COMMAND(vpath, db_show_vpath) } #endif - -extern uma_zone_t namei_zone; static bool __read_frequently cache_fast_lookup = true; SYSCTL_BOOL(_vfs, OID_AUTO, cache_fast_lookup, CTLFLAG_RW,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008161821.07GILLBt075425>