Create a vnode object when the file is opened. Trust that we did so.

This commit is contained in:
Poul-Henning Kamp 2005-01-24 23:04:33 +00:00
parent b3a4d73ebe
commit f74b3b1f6c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=140778
2 changed files with 2 additions and 14 deletions

View File

@ -332,20 +332,6 @@ ufs_extattr_enable_with_open(struct ufsmount *ump, struct vnode *vp,
return (error);
}
/*
* XXX: Note, should VOP_CLOSE() if VOP_CREATEVOBJECT() fails, but due
* to a similar piece of code in vn_open(), we don't.
*/
if (vn_canvmio(vp) == TRUE)
if ((error = VOP_CREATEVOBJECT(vp, td->td_ucred, td)) != 0) {
/*
* XXX: bug replicated from vn_open(): should
* VOP_CLOSE() here.
*/
VOP_UNLOCK(vp, 0, td);
return (error);
}
vp->v_writecount++;
vref(vp);

View File

@ -253,6 +253,8 @@ ufs_open(struct vop_open_args *ap)
if ((VTOI(vp)->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);
return (0);
}