nfs4: Remove several superfluous 'else'
This commit is contained in:
@@ -73,7 +73,6 @@ IdMap::_GetValue(const char* buffer, int32 code)
|
||||
if (result != B_OK) {
|
||||
if (_Repair() != B_OK)
|
||||
return 0;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -83,7 +82,6 @@ IdMap::_GetValue(const char* buffer, int32 code)
|
||||
if (result < B_OK) {
|
||||
if (_Repair() != B_OK)
|
||||
return 0;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -105,7 +103,6 @@ IdMap::_GetBuffer(T value, int32 code)
|
||||
if (result != B_OK) {
|
||||
if (_Repair() != B_OK)
|
||||
return NULL;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -113,7 +110,6 @@ IdMap::_GetBuffer(T value, int32 code)
|
||||
if (size < B_OK) {
|
||||
if (_Repair() != B_OK)
|
||||
return NULL;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -128,7 +124,6 @@ IdMap::_GetBuffer(T value, int32 code)
|
||||
|
||||
if (_Repair() != B_OK)
|
||||
return 0;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -718,13 +718,11 @@ Inode::_CheckLockType(short ltype, uint32 mode)
|
||||
case F_RDLCK:
|
||||
if ((mode & O_RDONLY) == 0 && (mode & O_RDWR) == 0)
|
||||
return EBADF;
|
||||
else
|
||||
return B_OK;
|
||||
|
||||
case F_WRLCK:
|
||||
if ((mode & O_WRONLY) == 0 && (mode & O_RDWR) == 0)
|
||||
return EBADF;
|
||||
else
|
||||
return B_OK;
|
||||
|
||||
default:
|
||||
@@ -981,13 +979,12 @@ 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 true;
|
||||
}
|
||||
return false;
|
||||
|
||||
// server is in grace period, we need to wait
|
||||
@@ -1000,13 +997,12 @@ 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 true;
|
||||
}
|
||||
return false;
|
||||
|
||||
// server has rebooted, reclaim share and try again
|
||||
@@ -1019,7 +1015,6 @@ Inode::_HandleErrors(uint32 nfs4Error, RPC::Server* serv,
|
||||
case NFS4ERR_FHEXPIRED:
|
||||
if (fInfo.UpdateFileHandles(fFilesystem) == B_OK)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
// filesystem has been moved
|
||||
@@ -1033,7 +1028,7 @@ Inode::_HandleErrors(uint32 nfs4Error, RPC::Server* serv,
|
||||
if (cookie != NULL) {
|
||||
fFilesystem->NFSServer()->ClientId(cookie->fClientId, true);
|
||||
return true;
|
||||
} else
|
||||
}
|
||||
return false;
|
||||
|
||||
default:
|
||||
|
||||
@@ -175,7 +175,7 @@ Inode::Create(const char* name, int mode, int perms, OpenFileCookie* cookie,
|
||||
|
||||
if (confirm)
|
||||
return _ConfirmOpen(fh, cookie);
|
||||
else
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ Inode::Open(int mode, OpenFileCookie* cookie)
|
||||
|
||||
if (confirm)
|
||||
return _ConfirmOpen(fInfo.fHandle, cookie);
|
||||
else
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user