o vn_extattr_set() will now call appropriate vn_start_write() and

vn_finished_write() if IO_NODELOCKED is not set.

Obtained from:	TrustedBSD Project
This commit is contained in:
Robert Watson 2000-09-05 03:15:02 +00:00
parent b4d0de586d
commit e81c5f4307
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=65463

View File

@ -923,6 +923,7 @@ vn_extattr_set(struct vnode *vp, int ioflg, const char *attrname, int buflen,
{
struct uio auio;
struct iovec iov;
struct mount *mp;
int error;
iov.iov_len = buflen;
@ -936,14 +937,19 @@ vn_extattr_set(struct vnode *vp, int ioflg, const char *attrname, int buflen,
auio.uio_offset = 0;
auio.uio_resid = buflen;
if ((ioflg & IO_NODELOCKED) == 0)
if ((ioflg & IO_NODELOCKED) == 0) {
if ((error = vn_start_write(vp, &mp, V_WAIT)) != 0)
return (error);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
}
/* authorize attribute setting as kernel */
error = VOP_SETEXTATTR(vp, attrname, &auio, NULL, p);
if ((ioflg & IO_NODELOCKED) == 0)
if ((ioflg & IO_NODELOCKED) == 0) {
vn_finished_write(mp);
VOP_UNLOCK(vp, 0, p);
}
return (error);
}