nfs4: Let ReplyInterpreter provide original NFS4 error codes

This commit is contained in:
Pawel Dziepak
2012-06-29 02:14:47 +02:00
parent f2da914d39
commit 462a54ced8
2 changed files with 12 additions and 1 deletions
@@ -46,6 +46,7 @@ DirEntry::~DirEntry()
ReplyInterpreter::ReplyInterpreter(RPC::Reply* reply) ReplyInterpreter::ReplyInterpreter(RPC::Reply* reply)
: :
fNFS4Error(NFS4_OK),
fReply(reply) fReply(reply)
{ {
if (reply != NULL) if (reply != NULL)
@@ -62,7 +63,7 @@ ReplyInterpreter::~ReplyInterpreter()
void void
ReplyInterpreter::_ParseHeader() ReplyInterpreter::_ParseHeader()
{ {
fReply->Stream().GetUInt(); fNFS4Error = fReply->Stream().GetUInt();
fReply->Stream().GetOpaque(NULL); fReply->Stream().GetOpaque(NULL);
fReply->Stream().GetUInt(); fReply->Stream().GetUInt();
} }
@@ -45,6 +45,8 @@ public:
inline status_t SetTo(RPC::Reply* reply); inline status_t SetTo(RPC::Reply* reply);
inline void Reset(); inline void Reset();
inline uint32 NFS4Error();
status_t Access(uint32* supported, uint32* allowed); status_t Access(uint32* supported, uint32* allowed);
status_t Close(); status_t Close();
status_t GetAttr(AttrValue** attrs, uint32* count); status_t GetAttr(AttrValue** attrs, uint32* count);
@@ -72,6 +74,7 @@ private:
static status_t _NFS4ErrorToHaiku(uint32 x); static status_t _NFS4ErrorToHaiku(uint32 x);
uint32 fNFS4Error;
RPC::Reply* fReply; RPC::Reply* fReply;
}; };
@@ -99,6 +102,13 @@ ReplyInterpreter::Reset()
} }
inline uint32
ReplyInterpreter::NFS4Error()
{
return fNFS4Error;
}
inline status_t inline status_t
ReplyInterpreter::LookUp() ReplyInterpreter::LookUp()
{ {