From 71602f6ec938338cb011c4d438f7bb2da4b125a0 Mon Sep 17 00:00:00 2001 From: yamt Date: Fri, 7 Nov 2003 14:52:27 +0000 Subject: [PATCH] fix spec vnode aliasing. --- sys/ufs/lfs/lfs_extern.h | 4 ++-- sys/ufs/lfs/lfs_syscalls.c | 6 +++--- sys/ufs/lfs/lfs_vfsops.c | 11 +++++++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/sys/ufs/lfs/lfs_extern.h b/sys/ufs/lfs/lfs_extern.h index daafed6e1f6d..ac190f5e897a 100644 --- a/sys/ufs/lfs/lfs_extern.h +++ b/sys/ufs/lfs/lfs_extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_extern.h,v 1.55 2003/09/29 15:12:08 yamt Exp $ */ +/* $NetBSD: lfs_extern.h,v 1.56 2003/11/07 14:52:27 yamt Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc. @@ -212,7 +212,7 @@ int lfs_vget(struct mount *, ino_t, struct vnode **); int lfs_fhtovp(struct mount *, struct fid *, struct vnode **); int lfs_vptofh(struct vnode *, struct fid *); int lfs_sysctl(int *, u_int, void *, size_t *, void *, size_t, struct proc *); -void lfs_vinit(struct mount *mp, struct vnode *); +void lfs_vinit(struct mount *mp, struct vnode **); /* lfs_vnops.c */ void lfs_mark_vnode(struct vnode *); diff --git a/sys/ufs/lfs/lfs_syscalls.c b/sys/ufs/lfs/lfs_syscalls.c index 07603c386b6b..02fb24e8b94b 100644 --- a/sys/ufs/lfs/lfs_syscalls.c +++ b/sys/ufs/lfs/lfs_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_syscalls.c,v 1.98 2003/09/10 11:09:11 yamt Exp $ */ +/* $NetBSD: lfs_syscalls.c,v 1.99 2003/11/07 14:52:27 yamt Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: lfs_syscalls.c,v 1.98 2003/09/10 11:09:11 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lfs_syscalls.c,v 1.99 2003/11/07 14:52:27 yamt Exp $"); #ifndef LFS # define LFS /* for prototypes in syscallargs.h */ @@ -1158,7 +1158,7 @@ lfs_fastvget(struct mount *mp, ino_t ino, daddr_t daddr, struct vnode **vpp, str *ip->i_din.ffs1_din = *dip; brelse(bp); } - lfs_vinit(mp, vp); + lfs_vinit(mp, &vp); *vpp = vp; diff --git a/sys/ufs/lfs/lfs_vfsops.c b/sys/ufs/lfs/lfs_vfsops.c index 019e487102ef..4b451e58c814 100644 --- a/sys/ufs/lfs/lfs_vfsops.c +++ b/sys/ufs/lfs/lfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_vfsops.c,v 1.138 2003/11/07 14:50:18 yamt Exp $ */ +/* $NetBSD: lfs_vfsops.c,v 1.139 2003/11/07 14:52:28 yamt Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.138 2003/11/07 14:50:18 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.139 2003/11/07 14:52:28 yamt Exp $"); #if defined(_KERNEL_OPT) #include "opt_quota.h" @@ -1669,7 +1669,7 @@ lfs_vget(struct mount *mp, ino_t ino, struct vnode **vpp) ip->i_ffs1_atimensec = ts.tv_nsec; } - lfs_vinit(mp, vp); + lfs_vinit(mp, &vp); *vpp = vp; @@ -2054,8 +2054,9 @@ lfs_gop_write(struct vnode *vp, struct vm_page **pgs, int npages, int flags) * used by lfs_vget and lfs_fastvget. */ void -lfs_vinit(struct mount *mp, struct vnode *vp) +lfs_vinit(struct mount *mp, struct vnode **vpp) { + struct vnode *vp = *vpp; struct inode *ip = VTOI(vp); struct ufsmount *ump = VFSTOUFS(mp); int i; @@ -2119,4 +2120,6 @@ inconsistent: VREF(ip->i_devvp); genfs_node_init(vp, &lfs_genfsops); uvm_vnp_setsize(vp, ip->i_size); + + *vpp = vp; }