diff options
-rw-r--r-- | ufs/pager.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/ufs/pager.c b/ufs/pager.c index f403df64..35bf1d22 100644 --- a/ufs/pager.c +++ b/ufs/pager.c @@ -358,16 +358,18 @@ pager_report_extent (struct user_pager_info *pager, void pager_clear_user_data (struct user_pager_info *upi) { - assert (upi->type == FILE_DATA); - spin_lock (&node2pagelock); - upi->np->dn->fileinfo = 0; - spin_unlock (&node2pagelock); - diskfs_nrele_light (upi->np); - spin_lock (&pagerlistlock); - *upi->prevp = upi->next; - if (upi->next) - upi->next->prevp = upi->prevp; - spin_unlock (&pagerlistlock); + if (upi->type == FILE_DATA) + { + spin_lock (&node2pagelock); + upi->np->dn->fileinfo = 0; + spin_unlock (&node2pagelock); + diskfs_nrele_light (upi->np); + spin_lock (&pagerlistlock); + *upi->prevp = upi->next; + if (upi->next) + upi->next->prevp = upi->prevp; + spin_unlock (&pagerlistlock); + } free (upi); } |