diff options
author | Jeff Roberson <jeff@FreeBSD.org> | 2019-10-15 03:45:41 +0000 |
---|---|---|
committer | Jeff Roberson <jeff@FreeBSD.org> | 2019-10-15 03:45:41 +0000 |
commit | 0012f373e43db2341c20329163ed2d5ad3b0f341 (patch) | |
tree | 0ee773797648995271d10676de6c8aadc464785c /sys/fs/smbfs | |
parent | 205be21d997d5becfaee5918386d4087b09f98a8 (diff) | |
download | src-0012f373e43db2341c20329163ed2d5ad3b0f341.tar.gz src-0012f373e43db2341c20329163ed2d5ad3b0f341.zip |
(4/6) Protect page valid with the busy lock.
Atomics are used for page busy and valid state when the shared busy is
held. The details of the locking protocol and valid and dirty
synchronization are in the updated vm_page.h comments.
Reviewed by: kib, markj
Tested by: pho
Sponsored by: Netflix, Intel
Differential Revision: https://reviews.freebsd.org/D21594
Notes
Notes:
svn path=/head/; revision=353539
Diffstat (limited to 'sys/fs/smbfs')
-rw-r--r-- | sys/fs/smbfs/smbfs_io.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/fs/smbfs/smbfs_io.c b/sys/fs/smbfs/smbfs_io.c index fa6a14024213..ab1eb0574c1b 100644 --- a/sys/fs/smbfs/smbfs_io.c +++ b/sys/fs/smbfs/smbfs_io.c @@ -457,7 +457,7 @@ smbfs_getpages(ap) * XXXGL: is that true for SMB filesystem? */ VM_OBJECT_WLOCK(object); - if (pages[npages - 1]->valid != 0 && --npages == 0) + if (!vm_page_none_valid(pages[npages - 1]) && --npages == 0) goto out; VM_OBJECT_WUNLOCK(object); @@ -505,14 +505,14 @@ smbfs_getpages(ap) /* * Read operation filled an entire page */ - m->valid = VM_PAGE_BITS_ALL; + vm_page_valid(m); KASSERT(m->dirty == 0, ("smbfs_getpages: page %p is dirty", m)); } else if (size > toff) { /* * Read operation filled a partial page. */ - m->valid = 0; + vm_page_invalid(m); vm_page_set_valid_range(m, 0, size - toff); KASSERT(m->dirty == 0, ("smbfs_getpages: page %p is dirty", m)); |