1/*
2 * Copyright 2012 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Paweł Dziepak, pdziepak@quarnos.org
7 */
8#ifndef DELEGATION_H
9#define DELEGATION_H
10
11
12#include <lock.h>
13#include <SupportDefs.h>
14
15#include "NFS4Object.h"
16
17
18class Inode;
19
20class Delegation : public NFS4Object,
21	public DoublyLinkedListLinkImpl<Delegation> {
22public:
23						Delegation(const OpenDelegationData& data, Inode* inode,
24							uint64 clientID, bool attr = false);
25
26	status_t			GiveUp(bool truncate = false);
27
28	inline	void		SetData(const OpenDelegationData& data);
29	inline	Inode*		GetInode();
30	inline	OpenDelegation Type();
31
32protected:
33	status_t			ReturnDelegation();
34
35private:
36	uint64				fClientID;
37	OpenDelegationData	fData;
38	Inode*				fInode;
39	bool				fAttribute;
40};
41
42
43inline void
44Delegation::SetData(const OpenDelegationData& data)
45{
46	fData = data;
47}
48
49
50inline Inode*
51Delegation::GetInode()
52{
53	return fInode;
54}
55
56
57inline OpenDelegation
58Delegation::Type()
59{
60	return fData.fType;
61}
62
63
64#endif	// DELEGATION_H
65
66