nfs4: Add support for O_NONBLOCK mode
This commit is contained in:
@@ -1285,14 +1285,20 @@ Inode::_HandleErrors(uint32 nfs4Error, RPC::Server* serv,
|
|||||||
|
|
||||||
// server needs more time, we need to wait
|
// server needs more time, we need to wait
|
||||||
case NFS4ERR_DELAY:
|
case NFS4ERR_DELAY:
|
||||||
snooze_etc(5 * 1000000, B_SYSTEM_TIMEBASE, B_RELATIVE_TIMEOUT);
|
if (cookie == NULL || (cookie->fMode & O_NONBLOCK) == 0) {
|
||||||
return true;
|
snooze_etc(5 * 1000000, B_SYSTEM_TIMEBASE, B_RELATIVE_TIMEOUT);
|
||||||
|
return true;
|
||||||
|
} else
|
||||||
|
return false;
|
||||||
|
|
||||||
// server is in grace period, we need to wait
|
// server is in grace period, we need to wait
|
||||||
case NFS4ERR_GRACE:
|
case NFS4ERR_GRACE:
|
||||||
snooze_etc(fFilesystem->NFSServer()->LeaseTime() / 3,
|
if (cookie == NULL || (cookie->fMode & O_NONBLOCK) == 0) {
|
||||||
B_SYSTEM_TIMEBASE, B_RELATIVE_TIMEOUT);
|
snooze_etc(fFilesystem->NFSServer()->LeaseTime() / 3,
|
||||||
return true;
|
B_SYSTEM_TIMEBASE, B_RELATIVE_TIMEOUT);
|
||||||
|
return true;
|
||||||
|
} else
|
||||||
|
return false;
|
||||||
|
|
||||||
// server has rebooted, reclaim share and try again
|
// server has rebooted, reclaim share and try again
|
||||||
case NFS4ERR_STALE_CLIENTID:
|
case NFS4ERR_STALE_CLIENTID:
|
||||||
|
|||||||
@@ -674,6 +674,10 @@ ReplyInterpreter::_NFS4ErrorToHaiku(uint32 x)
|
|||||||
case NFS4ERR_INVAL: return B_BAD_VALUE;
|
case NFS4ERR_INVAL: return B_BAD_VALUE;
|
||||||
case NFS4ERR_FBIG: return B_FILE_TOO_LARGE;
|
case NFS4ERR_FBIG: return B_FILE_TOO_LARGE;
|
||||||
// ...
|
// ...
|
||||||
|
case NFS4ERR_DELAY:
|
||||||
|
case NFS4ERR_GRACE:
|
||||||
|
return B_WOULD_BLOCK;
|
||||||
|
// ...
|
||||||
default: return B_ERROR;
|
default: return B_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user