2 * Copyright 2012 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
6 * Paweł Dziepak, pdziepak@quarnos.org
10 #include "Delegation.h"
16 Delegation::Delegation(const OpenDelegationData
& data
, Inode
* inode
,
17 uint64 clientID
, bool attribute
)
24 ASSERT(inode
!= NULL
);
29 Delegation::GiveUp(bool truncate
)
31 if (!fAttribute
&& !truncate
)
32 fInode
->SyncAndCommit(true);
41 Delegation::ReturnDelegation()
45 RPC::Server
* serv
= fFileSystem
->Server();
46 Request
request(serv
, fFileSystem
);
47 RequestBuilder
& req
= request
.Builder();
49 req
.PutFH(fInfo
.fHandle
);
50 req
.DelegReturn(fData
.fStateID
, fData
.fStateSeq
);
52 status_t result
= request
.Send();
56 ReplyInterpreter
& reply
= request
.Reply();
58 if (HandleErrors(attempt
, reply
.NFS4Error(), serv
, NULL
,
59 fInode
->GetOpenState())) {
65 return reply
.DelegReturn();