summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2000-09-05 03:15:02 +0000
committerrwatson <rwatson@FreeBSD.org>2000-09-05 03:15:02 +0000
commit81eb6ee3cf8a30f5669bbf89538ad5605f839c63 (patch)
tree250bb53d660e739b5f16821299eb64ebd0c2cbd5 /sys/kern
parent15609dd6ef8f14fb916c25aed72373c6009461de (diff)
downloadFreeBSD-src-81eb6ee3cf8a30f5669bbf89538ad5605f839c63.zip
FreeBSD-src-81eb6ee3cf8a30f5669bbf89538ad5605f839c63.tar.gz
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
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_vnops.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 3f9a8b1..d45fc78 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -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);
}
OpenPOWER on IntegriCloud