diff options
author | attilio <attilio@FreeBSD.org> | 2013-02-20 12:03:20 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2013-02-20 12:03:20 +0000 |
commit | 15bf891afe5ecb096114725fc8e6dc1cc3ef70d6 (patch) | |
tree | 430a1525becbd2674f05fbcf81b84fccc4aa7865 /sys/cddl | |
parent | 1f1e13ca0304c5d3cab0d4c118678ec546f935bc (diff) | |
download | FreeBSD-src-15bf891afe5ecb096114725fc8e6dc1cc3ef70d6.zip FreeBSD-src-15bf891afe5ecb096114725fc8e6dc1cc3ef70d6.tar.gz |
Rename VM_OBJECT_LOCK(), VM_OBJECT_UNLOCK() and VM_OBJECT_TRYLOCK() to
their "write" versions.
Sponsored by: EMC / Isilon storage division
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index 9438266..35dceb3 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -450,7 +450,7 @@ update_pages(vnode_t *vp, int64_t start, int len, objset_t *os, uint64_t oid, ASSERT(obj != NULL); off = start & PAGEOFFSET; - VM_OBJECT_LOCK(obj); + VM_OBJECT_WLOCK(obj); for (start &= PAGEMASK; len > 0; start += PAGESIZE) { vm_page_t pp; int nbytes = imin(PAGESIZE - off, len); @@ -467,23 +467,23 @@ update_pages(vnode_t *vp, int64_t start, int len, objset_t *os, uint64_t oid, ("zfs update_pages: unbusy page in putpages case")); KASSERT(!pmap_page_is_write_mapped(pp), ("zfs update_pages: writable page in putpages case")); - VM_OBJECT_UNLOCK(obj); + VM_OBJECT_WUNLOCK(obj); va = zfs_map_page(pp, &sf); (void) dmu_write(os, oid, start, nbytes, va, tx); zfs_unmap_page(sf); - VM_OBJECT_LOCK(obj); + VM_OBJECT_WLOCK(obj); vm_page_undirty(pp); } else if ((pp = page_busy(vp, start, off, nbytes)) != NULL) { - VM_OBJECT_UNLOCK(obj); + VM_OBJECT_WUNLOCK(obj); va = zfs_map_page(pp, &sf); (void) dmu_read(os, oid, start+off, nbytes, va+off, DMU_READ_PREFETCH);; zfs_unmap_page(sf); - VM_OBJECT_LOCK(obj); + VM_OBJECT_WLOCK(obj); page_unbusy(pp); } len -= nbytes; @@ -491,7 +491,7 @@ update_pages(vnode_t *vp, int64_t start, int len, objset_t *os, uint64_t oid, } if (segflg != UIO_NOCOPY) vm_object_pip_wakeupn(obj, 0); - VM_OBJECT_UNLOCK(obj); + VM_OBJECT_WUNLOCK(obj); } /* @@ -523,7 +523,7 @@ mappedread_sf(vnode_t *vp, int nbytes, uio_t *uio) ASSERT(obj != NULL); ASSERT((uio->uio_loffset & PAGEOFFSET) == 0); - VM_OBJECT_LOCK(obj); + VM_OBJECT_WLOCK(obj); for (start = uio->uio_loffset; len > 0; start += PAGESIZE) { int bytes = MIN(PAGESIZE, len); @@ -531,14 +531,14 @@ mappedread_sf(vnode_t *vp, int nbytes, uio_t *uio) VM_ALLOC_NORMAL | VM_ALLOC_RETRY | VM_ALLOC_IGN_SBUSY); if (pp->valid == 0) { vm_page_io_start(pp); - VM_OBJECT_UNLOCK(obj); + VM_OBJECT_WUNLOCK(obj); va = zfs_map_page(pp, &sf); error = dmu_read(os, zp->z_id, start, bytes, va, DMU_READ_PREFETCH); if (bytes != PAGESIZE && error == 0) bzero(va + bytes, PAGESIZE - bytes); zfs_unmap_page(sf); - VM_OBJECT_LOCK(obj); + VM_OBJECT_WLOCK(obj); vm_page_io_finish(pp); vm_page_lock(pp); if (error) { @@ -555,7 +555,7 @@ mappedread_sf(vnode_t *vp, int nbytes, uio_t *uio) uio->uio_offset += bytes; len -= bytes; } - VM_OBJECT_UNLOCK(obj); + VM_OBJECT_WUNLOCK(obj); return (error); } @@ -587,7 +587,7 @@ mappedread(vnode_t *vp, int nbytes, uio_t *uio) start = uio->uio_loffset; off = start & PAGEOFFSET; - VM_OBJECT_LOCK(obj); + VM_OBJECT_WLOCK(obj); for (start &= PAGEMASK; len > 0; start += PAGESIZE) { vm_page_t pp; uint64_t bytes = MIN(PAGESIZE - off, len); @@ -596,23 +596,23 @@ mappedread(vnode_t *vp, int nbytes, uio_t *uio) struct sf_buf *sf; caddr_t va; - VM_OBJECT_UNLOCK(obj); + VM_OBJECT_WUNLOCK(obj); va = zfs_map_page(pp, &sf); error = uiomove(va + off, bytes, UIO_READ, uio); zfs_unmap_page(sf); - VM_OBJECT_LOCK(obj); + VM_OBJECT_WLOCK(obj); page_unhold(pp); } else { - VM_OBJECT_UNLOCK(obj); + VM_OBJECT_WUNLOCK(obj); error = dmu_read_uio(os, zp->z_id, uio, bytes); - VM_OBJECT_LOCK(obj); + VM_OBJECT_WLOCK(obj); } len -= bytes; off = 0; if (error) break; } - VM_OBJECT_UNLOCK(obj); + VM_OBJECT_WUNLOCK(obj); return (error); } @@ -5683,7 +5683,7 @@ zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int reqpage) mfirst = m[reqstart]; mlast = m[reqstart + reqsize - 1]; - VM_OBJECT_LOCK(object); + VM_OBJECT_WLOCK(object); for (i = 0; i < reqstart; i++) { vm_page_lock(m[i]); @@ -5699,7 +5699,7 @@ zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int reqpage) if (mreq->valid && reqsize == 1) { if (mreq->valid != VM_PAGE_BITS_ALL) vm_page_zero_invalid(mreq, TRUE); - VM_OBJECT_UNLOCK(object); + VM_OBJECT_WUNLOCK(object); ZFS_EXIT(zfsvfs); return (VM_PAGER_OK); } @@ -5715,7 +5715,7 @@ zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int reqpage) vm_page_unlock(m[i]); } } - VM_OBJECT_UNLOCK(object); + VM_OBJECT_WUNLOCK(object); ZFS_EXIT(zfsvfs); return (VM_PAGER_BAD); } @@ -5724,7 +5724,7 @@ zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int reqpage) if (IDX_TO_OFF(mlast->pindex) + lsize > object->un_pager.vnp.vnp_size) lsize = object->un_pager.vnp.vnp_size - IDX_TO_OFF(mlast->pindex); - VM_OBJECT_UNLOCK(object); + VM_OBJECT_WUNLOCK(object); for (i = reqstart; i < reqstart + reqsize; i++) { size = PAGE_SIZE; @@ -5740,7 +5740,7 @@ zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int reqpage) break; } - VM_OBJECT_LOCK(object); + VM_OBJECT_WLOCK(object); for (i = reqstart; i < reqstart + reqsize; i++) { if (!error) @@ -5750,7 +5750,7 @@ zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int reqpage) vm_page_readahead_finish(m[i]); } - VM_OBJECT_UNLOCK(object); + VM_OBJECT_WUNLOCK(object); ZFS_ACCESSTIME_STAMP(zfsvfs, zp); ZFS_EXIT(zfsvfs); |