diff options
author | pjd <pjd@FreeBSD.org> | 2007-05-02 01:03:10 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2007-05-02 01:03:10 +0000 |
commit | de2973eb6ee310d016fd88c4fb101afa7d85b6a4 (patch) | |
tree | 5ccc38660741292d2bb9db5b42751dc3eb590b01 /sys/compat/opensolaris | |
parent | 61f69851ce83b009950cd7d7a3adca479d83dd36 (diff) | |
download | FreeBSD-src-de2973eb6ee310d016fd88c4fb101afa7d85b6a4.zip FreeBSD-src-de2973eb6ee310d016fd88c4fb101afa7d85b6a4.tar.gz |
Share-lock a vnode where possible.
Diffstat (limited to 'sys/compat/opensolaris')
-rw-r--r-- | sys/compat/opensolaris/kern/opensolaris_kobj.c | 4 | ||||
-rw-r--r-- | sys/compat/opensolaris/kern/opensolaris_vfs.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/compat/opensolaris/kern/opensolaris_kobj.c b/sys/compat/opensolaris/kern/opensolaris_kobj.c index 4db68f4..16a5800 100644 --- a/sys/compat/opensolaris/kern/opensolaris_kobj.c +++ b/sys/compat/opensolaris/kern/opensolaris_kobj.c @@ -123,7 +123,7 @@ kobj_get_filesize_vnode(struct _buf *file, uint64_t *size) struct vattr va; int error; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY, td); error = VOP_GETATTR(vp, &va, td->td_ucred, td); VOP_UNLOCK(vp, 0, td); if (error == 0) @@ -176,7 +176,7 @@ kobj_read_file_vnode(struct _buf *file, char *buf, unsigned size, unsigned off) auio.uio_resid = size; auio.uio_td = td; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY, td); error = VOP_READ(vp, &auio, IO_UNIT | IO_SYNC, td->td_ucred); VOP_UNLOCK(vp, 0, td); return (error != 0 ? -1 : size - auio.uio_resid); diff --git a/sys/compat/opensolaris/kern/opensolaris_vfs.c b/sys/compat/opensolaris/kern/opensolaris_vfs.c index ef184b4..e3325ae 100644 --- a/sys/compat/opensolaris/kern/opensolaris_vfs.c +++ b/sys/compat/opensolaris/kern/opensolaris_vfs.c @@ -187,7 +187,7 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath, /* * Allocate and initialize the filesystem. */ - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY, td); mp = vfs_mount_alloc(vp, vfsp, fspath, td); VOP_UNLOCK(vp, 0, td); |