Commit 016063c8 authored by Max Kellermann's avatar Max Kellermann

lib/nfs/FileReader: move code to CancelOrClose()

parent 38f19981
......@@ -56,8 +56,18 @@ NfsFileReader::Close()
return;
}
/* this cancels State::MOUNT */
connection->RemoveLease(*this);
CancelOrClose();
}
void
NfsFileReader::CancelOrClose()
{
assert(state != State::INITIAL &&
state != State::DEFER);
if (state == State::IDLE)
/* no async operation in progress: can close
immediately */
......
......@@ -76,6 +76,12 @@ protected:
virtual void OnNfsFileError(Error &&error) = 0;
private:
/**
* Cancel the current operation, if any. The NfsLease must be
* unregistered already.
*/
void CancelOrClose();
void OpenCallback(nfsfh *_fh);
void StatCallback(const struct stat *st);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment