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