diff options
author | green <green@FreeBSD.org> | 2002-03-14 02:10:14 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 2002-03-14 02:10:14 +0000 |
commit | 9116fd1a97d7097f33fba5ba97f802e1215dbffd (patch) | |
tree | a09b473d11751036400f734bd6433d8799594a50 /sys/vm | |
parent | ed97e4d42ecb8860cb1a67e0d692253cf4580429 (diff) | |
download | FreeBSD-src-9116fd1a97d7097f33fba5ba97f802e1215dbffd.zip FreeBSD-src-9116fd1a97d7097f33fba5ba97f802e1215dbffd.tar.gz |
Document faultstate.lookup_still_valid more than none.
Requested by: alfred
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_fault.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index cf2ab8dd..02a7f46 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -111,7 +111,11 @@ struct faultstate { vm_pindex_t first_pindex; vm_map_t map; vm_map_entry_t entry; - int lookup_still_valid; + enum { + LSV_FALSE, /* the lookup's lock has been dropped */ + LSV_TRUE, /* the lookup's lock is still valid */ + LSV_UPGRADED /* the lookup's lock is now exclusive */ + } lookup_still_valid; struct vnode *vp; }; @@ -126,11 +130,11 @@ release_page(struct faultstate *fs) static __inline void unlock_map(struct faultstate *fs) { - if (fs->lookup_still_valid) { - if (fs->lookup_still_valid == 2) + if (fs->lookup_still_valid != LSV_FALSE) { + if (fs->lookup_still_valid == LSV_UPGRADED) vm_map_lock_downgrade(fs->map); vm_map_lookup_done(fs->map, fs->entry); - fs->lookup_still_valid = FALSE; + fs->lookup_still_valid = LSV_FALSE; } } @@ -284,7 +288,7 @@ RetryFault:; fs.first_pindex, fs.first_pindex + 1); } - fs.lookup_still_valid = 1; + fs.lookup_still_valid = LSV_TRUE; if (wired) fault_type = prot; @@ -658,11 +662,11 @@ readrest: /* * grab the lock if we need to */ - (fs.lookup_still_valid || + (fs.lookup_still_valid != LSV_FALSE || vm_map_try_lock(fs.map) == 0) ) { - if (fs.lookup_still_valid == 0) - fs.lookup_still_valid = 2; + if (fs.lookup_still_valid == LSV_FALSE) + fs.lookup_still_valid = LSV_UPGRADED; /* * get rid of the unnecessary page */ @@ -717,7 +721,7 @@ readrest: * We must verify that the maps have not changed since our last * lookup. */ - if (!fs.lookup_still_valid && + if (fs.lookup_still_valid == LSV_FALSE && (fs.map->timestamp != map_generation)) { vm_object_t retry_object; vm_pindex_t retry_pindex; @@ -766,7 +770,7 @@ readrest: unlock_and_deallocate(&fs); return (result); } - fs.lookup_still_valid = 1; + fs.lookup_still_valid = LSV_TRUE; if ((retry_object != fs.first_object) || (retry_pindex != fs.first_pindex)) { |