#endif
+/* Translate a faultcode_t as returned by some of the vm routines
+ * into a suitable errno value.
+ */
+static int
+afs_fc2errno(faultcode_t fc)
+{
+ switch (FC_CODE(fc)) {
+ case 0:
+ return 0;
+
+ case FC_OBJERR:
+ return FC_ERRNO(fc);
+
+ default:
+ return EIO;
+ }
+}
+
+
extern struct as kas; /* kernel addr space */
extern unsigned char *afs_indexFlags;
extern afs_lock_t afs_xdcache;
data = segmap_getmap(segkmap, AFSTOV(avc), pageBase);
#endif
#ifndef AFS_SUN5_ENV
- code = as_fault(&kas, data+pageOffset, tsize, F_SOFTLOCK, mode);
+ code = afs_fc2errno(as_fault(&kas, data+pageOffset, tsize,
+ F_SOFTLOCK, mode));
if (code == 0) {
AFS_UIOMOVE(data+pageOffset, tsize, arw, auio, code);
as_fault(&kas, data+pageOffset, tsize, F_SOFTUNLOCK, mode);
AFS_GUNLOCK();
}
if (!created)
- code = segmap_fault(kas.a_hat, segkmap, raddr, rsize, F_SOFTLOCK, mode);
+ code = afs_fc2errno(segmap_fault(kas.a_hat, segkmap, raddr,
+ rsize, F_SOFTLOCK, mode));
}
if (code == 0) {
AFS_UIOMOVE(data+pageOffset, tsize, arw, auio, code);