diff options
-rw-r--r-- | sys/fs/nwfs/nwfs_io.c | 6 | ||||
-rw-r--r-- | sys/fs/smbfs/smbfs_io.c | 9 |
2 files changed, 6 insertions, 9 deletions
diff --git a/sys/fs/nwfs/nwfs_io.c b/sys/fs/nwfs/nwfs_io.c index a64b844..d0ab8e5 100644 --- a/sys/fs/nwfs/nwfs_io.c +++ b/sys/fs/nwfs/nwfs_io.c @@ -440,8 +440,7 @@ nwfs_getpages(ap) relpbuf(bp, &nwfs_pbuf_freecnt); - if (error) - VM_OBJECT_LOCK(object); + VM_OBJECT_LOCK(object); if (error && (uio.uio_resid == count)) { printf("nwfs_getpages: error %d\n",error); vm_page_lock_queues(); @@ -497,8 +496,7 @@ nwfs_getpages(ap) } } vm_page_unlock_queues(); - if (error) - VM_OBJECT_UNLOCK(object); + VM_OBJECT_UNLOCK(object); return 0; #endif /* NWFS_RWCACHE */ } diff --git a/sys/fs/smbfs/smbfs_io.c b/sys/fs/smbfs/smbfs_io.c index eed3789..99f7c7d 100644 --- a/sys/fs/smbfs/smbfs_io.c +++ b/sys/fs/smbfs/smbfs_io.c @@ -453,10 +453,10 @@ smbfs_getpages(ap) */ m = pages[reqpage]; + VM_OBJECT_LOCK(object); if (m->valid != 0) { /* handled by vm_fault now */ /* vm_page_zero_invalid(m, TRUE); */ - VM_OBJECT_LOCK(object); vm_page_lock_queues(); for (i = 0; i < npages; ++i) { if (i != reqpage) @@ -466,6 +466,7 @@ smbfs_getpages(ap) VM_OBJECT_UNLOCK(object); return 0; } + VM_OBJECT_UNLOCK(object); smb_makescred(&scred, td, cred); @@ -491,8 +492,7 @@ smbfs_getpages(ap) relpbuf(bp, &smbfs_pbuf_freecnt); - if (error) - VM_OBJECT_LOCK(object); + VM_OBJECT_LOCK(object); if (error && (uio.uio_resid == count)) { printf("smbfs_getpages: error %d\n",error); vm_page_lock_queues(); @@ -563,8 +563,7 @@ smbfs_getpages(ap) } } vm_page_unlock_queues(); - if (error) - VM_OBJECT_UNLOCK(object); + VM_OBJECT_UNLOCK(object); return 0; #endif /* SMBFS_RWGENERIC */ } |