1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-02-04 17:15:50 +00:00

Tell vnode_create_vobject() how big an object to create, rather

than having it work it out via the more expensive VOP_GETATTR

Reviewed by: phk@
This commit is contained in:
Peter Edwards 2005-01-29 14:23:09 +00:00
parent a258707313
commit e697161fa2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=140962
2 changed files with 5 additions and 6 deletions

View File

@ -206,6 +206,6 @@ ufs_fhtovp(mp, ufhp, vpp)
return (ESTALE);
}
*vpp = nvp;
vnode_create_vobject(*vpp, 0, curthread);
vnode_create_vobject(*vpp, DIP(ip, i_size), curthread);
return (0);
}

View File

@ -235,26 +235,25 @@ ufs_mknod(ap)
/*
* Open called.
*
* Nothing to do.
*/
/* ARGSUSED */
static int
ufs_open(struct vop_open_args *ap)
{
struct vnode *vp = ap->a_vp;
struct inode *ip;
if (vp->v_type == VCHR || vp->v_type == VBLK)
return (EOPNOTSUPP);
ip = VTOI(vp);
/*
* Files marked append-only must be opened for appending.
*/
if ((VTOI(vp)->i_flags & APPEND) &&
if ((ip->i_flags & APPEND) &&
(ap->a_mode & (FWRITE | O_APPEND)) == FWRITE)
return (EPERM);
/* XXX: if we have the size we should pass it for speed */
vnode_create_vobject(vp, 0, ap->a_td);
vnode_create_vobject(vp, DIP(ip, i_size), ap->a_td);
return (0);
}