svn commit: r274850 - projects/sendfile/sys/vm

Gleb Smirnoff glebius at FreeBSD.org
Sat Nov 22 13:06:48 UTC 2014


Author: glebius
Date: Sat Nov 22 13:06:47 2014
New Revision: 274850
URL: https://svnweb.freebsd.org/changeset/base/274850

Log:
  Iodone callback should receive UNIX error code.
  
  Noticed by:	kib

Modified:
  projects/sendfile/sys/vm/swap_pager.c

Modified: projects/sendfile/sys/vm/swap_pager.c
==============================================================================
--- projects/sendfile/sys/vm/swap_pager.c	Sat Nov 22 12:48:09 2014	(r274849)
+++ projects/sendfile/sys/vm/swap_pager.c	Sat Nov 22 13:06:47 2014	(r274850)
@@ -1269,11 +1269,24 @@ static int
 swap_pager_getpages_async(vm_object_t object, vm_page_t *m, int count,
     int reqpage, pgo_getpages_iodone_t *iodone, void *arg)
 {
-	int r;
+	int r, error;
 
 	r = swap_pager_getpages(object, m, count, reqpage);
 	VM_OBJECT_WUNLOCK(object);
-	(iodone)(arg, m, count, r);
+	switch (r) {
+	case VM_PAGER_OK:
+		error = 0;
+		break;
+	case VM_PAGER_ERROR:
+		error = EIO;
+		break;
+	case VM_PAGER_FAIL:
+		error = EINVAL;
+		break;
+	default:
+		error = EDOOFUS;
+	}
+	(iodone)(arg, m, count, error);
 	VM_OBJECT_WLOCK(object);
 
 	return (r);


More information about the svn-src-projects mailing list