diff options
author | Michael I. Bushnell <mib@gnu.org> | 1994-01-18 21:32:02 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1994-01-18 21:32:02 +0000 |
commit | dd7366426e073a6fba8d20b5aedc66da22acb20d (patch) | |
tree | 63e90f0a25a9daa69e011f1091c16cb9a3ca08d4 | |
parent | b472c8ac9ca04a16512fc00fa7802ea4e9b026ba (diff) |
Formerly mark-error.c.~3~
-rw-r--r-- | libpager/mark-error.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/libpager/mark-error.c b/libpager/mark-error.c index 513ab5d9..0cb6c5ca 100644 --- a/libpager/mark-error.c +++ b/libpager/mark-error.c @@ -16,6 +16,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +int page_errors[] = {KERN_SUCCESS, ENOSPC, EIO, EDQUOT}; + /* Some error has happened indicating that the page cannot be written. (Usually this is ENOSPC or EDQOUT.) On the next pagein which requests write access, return the error to the kernel. (This is @@ -105,25 +107,8 @@ pager_get_error (struct pager *p, mutex_lock (&p->p_interlock); pagemap_resize (p, addr); - switch (PM_ERROR (addr / __vm_page_size)) - { - case PAGE_NOERR: - err = 0; - break; - - case PAGE_ENOSPC: - err = ENOSPC; - break; - - default: - case PAGE_EIO: - err = EIO; - break; - - case PAGE_EDQUOT: - err = EDQUOT; - break; - } + err = page_errors[PM_ERROR(addr/__vm_page_size)]; + mutex_unlock (&p->p_interlock); return err; } |