vfs_cache.c (102870) | vfs_cache.c (109623) |
---|---|
1/* 2 * Copyright (c) 1989, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Poul-Henning Kamp of the FreeBSD Project. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)vfs_cache.c 8.5 (Berkeley) 3/22/95 | 1/* 2 * Copyright (c) 1989, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Poul-Henning Kamp of the FreeBSD Project. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)vfs_cache.c 8.5 (Berkeley) 3/22/95 |
37 * $FreeBSD: head/sys/kern/vfs_cache.c 102870 2002-09-02 22:40:30Z iedowse $ | 37 * $FreeBSD: head/sys/kern/vfs_cache.c 109623 2003-01-21 08:56:16Z alfred $ |
38 */ 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/kernel.h> 43#include <sys/lock.h> 44#include <sys/mutex.h> 45#include <sys/sysctl.h> --- 362 unchanged lines hidden (view full) --- 408 dvp->v_dd = dvp; 409 dvp->v_ddid = 0; 410 } 411 return; 412 } 413 } 414 415 ncp = (struct namecache *) | 38 */ 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/kernel.h> 43#include <sys/lock.h> 44#include <sys/mutex.h> 45#include <sys/sysctl.h> --- 362 unchanged lines hidden (view full) --- 408 dvp->v_dd = dvp; 409 dvp->v_ddid = 0; 410 } 411 return; 412 } 413 } 414 415 ncp = (struct namecache *) |
416 malloc(sizeof *ncp + cnp->cn_namelen, M_VFSCACHE, M_WAITOK); | 416 malloc(sizeof *ncp + cnp->cn_namelen, M_VFSCACHE, 0); |
417 bzero((char *)ncp, sizeof *ncp); 418 numcache++; 419 if (!vp) { 420 numneg++; 421 ncp->nc_flag = cnp->cn_flags & ISWHITEOUT ? NCF_WHITE : 0; 422 } else if (vp->v_type == VDIR) { 423 vp->v_dd = dvp; 424 vp->v_ddid = dvp->v_id; --- 299 unchanged lines hidden (view full) --- 724 numcwdcalls++; 725 if (disablecwd) 726 return (ENODEV); 727 if (buflen < 2) 728 return (EINVAL); 729 if (buflen > MAXPATHLEN) 730 buflen = MAXPATHLEN; 731 error = 0; | 417 bzero((char *)ncp, sizeof *ncp); 418 numcache++; 419 if (!vp) { 420 numneg++; 421 ncp->nc_flag = cnp->cn_flags & ISWHITEOUT ? NCF_WHITE : 0; 422 } else if (vp->v_type == VDIR) { 423 vp->v_dd = dvp; 424 vp->v_ddid = dvp->v_id; --- 299 unchanged lines hidden (view full) --- 724 numcwdcalls++; 725 if (disablecwd) 726 return (ENODEV); 727 if (buflen < 2) 728 return (EINVAL); 729 if (buflen > MAXPATHLEN) 730 buflen = MAXPATHLEN; 731 error = 0; |
732 tmpbuf = bp = malloc(buflen, M_TEMP, M_WAITOK); | 732 tmpbuf = bp = malloc(buflen, M_TEMP, 0); |
733 bp += buflen - 1; 734 *bp = '\0'; 735 fdp = td->td_proc->p_fd; 736 slash_prefixed = 0; 737 FILEDESC_LOCK(fdp); 738 mp_fixme("No vnode locking done!"); 739 for (vp = fdp->fd_cdir; vp != fdp->fd_rdir && vp != rootvnode;) { 740 if (vp->v_vflag & VV_ROOT) { --- 94 unchanged lines hidden (view full) --- 835 struct namecache *ncp; 836 struct vnode *vp; 837 838 numfullpathcalls++; 839 if (disablefullpath) 840 return (ENODEV); 841 if (vn == NULL) 842 return (EINVAL); | 733 bp += buflen - 1; 734 *bp = '\0'; 735 fdp = td->td_proc->p_fd; 736 slash_prefixed = 0; 737 FILEDESC_LOCK(fdp); 738 mp_fixme("No vnode locking done!"); 739 for (vp = fdp->fd_cdir; vp != fdp->fd_rdir && vp != rootvnode;) { 740 if (vp->v_vflag & VV_ROOT) { --- 94 unchanged lines hidden (view full) --- 835 struct namecache *ncp; 836 struct vnode *vp; 837 838 numfullpathcalls++; 839 if (disablefullpath) 840 return (ENODEV); 841 if (vn == NULL) 842 return (EINVAL); |
843 buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); | 843 buf = malloc(MAXPATHLEN, M_TEMP, 0); |
844 bp = buf + MAXPATHLEN - 1; 845 *bp = '\0'; 846 fdp = td->td_proc->p_fd; 847 slash_prefixed = 0; 848 FILEDESC_LOCK(fdp); 849 for (vp = vn; vp != fdp->fd_rdir && vp != rootvnode;) { 850 ASSERT_VOP_LOCKED(vp, "vn_fullpath"); 851 if (vp->v_vflag & VV_ROOT) { --- 61 unchanged lines hidden --- | 844 bp = buf + MAXPATHLEN - 1; 845 *bp = '\0'; 846 fdp = td->td_proc->p_fd; 847 slash_prefixed = 0; 848 FILEDESC_LOCK(fdp); 849 for (vp = vn; vp != fdp->fd_rdir && vp != rootvnode;) { 850 ASSERT_VOP_LOCKED(vp, "vn_fullpath"); 851 if (vp->v_vflag & VV_ROOT) { --- 61 unchanged lines hidden --- |