Document faultstate.lookup_still_valid more than none.

Requested by:	alfred
This commit is contained in:
green 2002-03-14 02:10:14 +00:00
parent ed97e4d42e
commit 9116fd1a97

View File

@ -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 @@ RetryFault:;
/*
* 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 @@ RetryFault:;
* 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 @@ RetryFault:;
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)) {