BPicture: Fix archive constructor.
[haiku.git] / src / add-ons / kernel / file_systems / nfs4 / OpenState.h
blobf81052890371c3552c5406d4bf358fe7aca84314
1 /*
2 * Copyright 2012 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Paweł Dziepak, pdziepak@quarnos.org
7 */
8 #ifndef OPENSTATE_H
9 #define OPENSTATE_H
12 #include <lock.h>
13 #include <SupportDefs.h>
14 #include <util/KernelReferenceable.h>
16 #include "Cookie.h"
17 #include "NFS4Object.h"
20 struct OpenState : public NFS4Object, public KernelReferenceable,
21 public DoublyLinkedListLinkImpl<OpenState> {
22 OpenState();
23 ~OpenState();
25 uint64 fClientID;
27 int fMode;
28 mutex fLock;
30 uint32 fStateID[3];
31 uint32 fStateSeq;
33 bool fOpened;
34 Delegation* fDelegation;
36 LockInfo* fLocks;
37 mutex fLocksLock;
39 LockOwner* fLockOwners;
40 mutex fOwnerLock;
42 LockOwner* GetLockOwner(uint32 owner);
44 void AddLock(LockInfo* lock);
45 void RemoveLock(LockInfo* lock, LockInfo* prev);
46 void DeleteLock(LockInfo* lock);
48 status_t Reclaim(uint64 newClientID);
50 status_t Close();
52 private:
53 status_t _ReclaimOpen(uint64 newClientID);
54 status_t _ReclaimLocks(uint64 newClientID);
55 status_t _ReleaseLockOwner(LockOwner* owner);
59 #endif // OPENSTATE_H