MFp4: We don't need to cover vnode_pager_setsize() with the z_map_lock.

This commit is contained in:
Pawel Jakub Dawidek 2007-05-06 01:27:54 +00:00
parent 433c2705cd
commit fab3f4465e
2 changed files with 4 additions and 2 deletions

View File

@ -770,11 +770,12 @@ zfs_write(vnode_t *vp, uio_t *uio, int ioflag, cred_t *cr, caller_context_t *ct)
* Perhaps we should use SPA_MAXBLOCKSIZE chunks?
*/
nbytes = MIN(n, max_blksz - P2PHASE(woff, max_blksz));
rw_enter(&zp->z_map_lock, RW_READER);
if (woff + nbytes > zp->z_phys->zp_size)
vnode_pager_setsize(vp, woff + nbytes);
rw_enter(&zp->z_map_lock, RW_READER);
tx_bytes = uio->uio_resid;
if (vn_has_cached_data(vp)) {
rw_exit(&zp->z_map_lock);

View File

@ -770,11 +770,12 @@ zfs_write(vnode_t *vp, uio_t *uio, int ioflag, cred_t *cr, caller_context_t *ct)
* Perhaps we should use SPA_MAXBLOCKSIZE chunks?
*/
nbytes = MIN(n, max_blksz - P2PHASE(woff, max_blksz));
rw_enter(&zp->z_map_lock, RW_READER);
if (woff + nbytes > zp->z_phys->zp_size)
vnode_pager_setsize(vp, woff + nbytes);
rw_enter(&zp->z_map_lock, RW_READER);
tx_bytes = uio->uio_resid;
if (vn_has_cached_data(vp)) {
rw_exit(&zp->z_map_lock);