nfs4: Remove several superfluous 'else'

This commit is contained in:
Pawel Dziepak
2012-07-04 17:09:22 +02:00
parent 209c46eec4
commit b664395b9e
3 changed files with 22 additions and 32 deletions
+5 -10
View File
@@ -73,8 +73,7 @@ IdMap::_GetValue(const char* buffer, int32 code)
if (result != B_OK) {
if (_Repair() != B_OK)
return 0;
else
continue;
continue;
}
int32 code;
@@ -83,8 +82,7 @@ IdMap::_GetValue(const char* buffer, int32 code)
if (result < B_OK) {
if (_Repair() != B_OK)
return 0;
else
continue;
continue;
}
if (code != MsgReply)
@@ -105,16 +103,14 @@ IdMap::_GetBuffer(T value, int32 code)
if (result != B_OK) {
if (_Repair() != B_OK)
return NULL;
else
continue;
continue;
}
ssize_t size = port_buffer_size(fReplyPort);
if (size < B_OK) {
if (_Repair() != B_OK)
return NULL;
else
continue;
continue;
}
int32 code;
@@ -128,8 +124,7 @@ IdMap::_GetBuffer(T value, int32 code)
if (_Repair() != B_OK)
return 0;
else
continue;
continue;
}
if (code != MsgReply) {
+13 -18
View File
@@ -718,14 +718,12 @@ Inode::_CheckLockType(short ltype, uint32 mode)
case F_RDLCK:
if ((mode & O_RDONLY) == 0 && (mode & O_RDWR) == 0)
return EBADF;
else
return B_OK;
return B_OK;
case F_WRLCK:
if ((mode & O_WRONLY) == 0 && (mode & O_RDWR) == 0)
return EBADF;
else
return B_OK;
return B_OK;
default:
return B_BAD_VALUE;
@@ -981,14 +979,13 @@ Inode::_HandleErrors(uint32 nfs4Error, RPC::Server* serv,
} else if ((cookie->fMode & O_NONBLOCK) == 0) {
status_t result = acquire_sem_etc(cookie->fSnoozeCancel, 1,
B_RELATIVE_TIMEOUT, sSecToBigTime(5));
if (result == B_TIMED_OUT)
return true;
else {
if (result != B_TIMED_OUT) {
release_sem(cookie->fSnoozeCancel);
return false;
}
} else
return false;
return true;
}
return false;
// server is in grace period, we need to wait
case NFS4ERR_GRACE:
@@ -1000,14 +997,13 @@ Inode::_HandleErrors(uint32 nfs4Error, RPC::Server* serv,
} else if ((cookie->fMode & O_NONBLOCK) == 0) {
status_t result = acquire_sem_etc(cookie->fSnoozeCancel, 1,
B_RELATIVE_TIMEOUT, sSecToBigTime(leaseTime) / 3);
if (result == B_TIMED_OUT)
return true;
else {
if (result != B_TIMED_OUT) {
release_sem(cookie->fSnoozeCancel);
return false;
}
} else
return false;
return true;
}
return false;
// server has rebooted, reclaim share and try again
case NFS4ERR_STALE_CLIENTID:
@@ -1019,8 +1015,7 @@ Inode::_HandleErrors(uint32 nfs4Error, RPC::Server* serv,
case NFS4ERR_FHEXPIRED:
if (fInfo.UpdateFileHandles(fFilesystem) == B_OK)
return true;
else
return false;
return false;
// filesystem has been moved
case NFS4ERR_LEASE_MOVED:
@@ -1033,8 +1028,8 @@ Inode::_HandleErrors(uint32 nfs4Error, RPC::Server* serv,
if (cookie != NULL) {
fFilesystem->NFSServer()->ClientId(cookie->fClientId, true);
return true;
} else
return false;
}
return false;
default:
return false;
@@ -175,8 +175,8 @@ Inode::Create(const char* name, int mode, int perms, OpenFileCookie* cookie,
if (confirm)
return _ConfirmOpen(fh, cookie);
else
return B_OK;
return B_OK;
}
@@ -271,8 +271,8 @@ Inode::Open(int mode, OpenFileCookie* cookie)
if (confirm)
return _ConfirmOpen(fInfo.fHandle, cookie);
else
return B_OK;
return B_OK;
}