btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / src / add-ons / kernel / file_systems / nfs4 / NFS4Inode.h
blob4aff6886c9859dea3c1febb47c58f5b61155fa5c
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 NFS4INODE_H
9 #define NFS4INODE_H
12 #include <sys/stat.h>
14 #include <SupportDefs.h>
16 #include "Cookie.h"
17 #include "FileInfo.h"
18 #include "FileSystem.h"
19 #include "NFS4Object.h"
20 #include "ReplyInterpreter.h"
23 class NFS4Inode : public NFS4Object {
24 public:
25 status_t GetChangeInfo(uint64* change, bool attrDir = false);
26 status_t ReadLink(void* buffer, size_t* length);
28 protected:
29 status_t Access(uint32* allowed);
31 status_t CommitWrites();
33 status_t LookUp(const char* name, uint64* change, uint64* fileID,
34 FileHandle* handle, bool parent = false);
36 status_t Link(Inode* dir, const char* name,
37 ChangeInfo* changeInfo);
39 static status_t RenameNode(Inode* from, Inode* to, const char* fromName,
40 const char* toName, ChangeInfo* fromChange,
41 ChangeInfo* toChange, uint64* fileID,
42 bool attribute = false);
44 status_t GetStat(AttrValue** values, uint32* count,
45 OpenAttrCookie* attr = NULL);
46 status_t WriteStat(OpenState* state, AttrValue* attrs,
47 uint32 attrCount);
49 status_t CreateFile(const char* name, int mode, int perms,
50 OpenState* state, ChangeInfo* changeInfo,
51 uint64* fileID, FileHandle* handle,
52 OpenDelegationData* delegation);
53 status_t OpenFile(OpenState* state, int mode,
54 OpenDelegationData* delegation);
56 status_t OpenAttr(OpenState* state, const char* name, int mode,
57 OpenDelegationData* delegation, bool create);
59 status_t ReadFile(OpenStateCookie* cookie, OpenState* state,
60 uint64 position, uint32* length, void* buffer,
61 bool* eof);
62 status_t WriteFile(OpenStateCookie* cookie, OpenState* state,
63 uint64 position, uint32* length,
64 const void* buffer, bool commit = false);
66 status_t CreateObject(const char* name, const char* path,
67 int mode, FileType type, ChangeInfo* changeInfo,
68 uint64* fileID, FileHandle* handle,
69 bool parent = false);
70 status_t RemoveObject(const char* name, FileType type,
71 ChangeInfo* changeInfo, uint64* fileID);
73 status_t ReadDirOnce(DirEntry** dirents, uint32* count,
74 OpenDirCookie* cookie, bool* eof, uint64* change,
75 uint64* dirCookie, uint64* dirCookieVerf,
76 bool attribute);
78 status_t OpenAttrDir(FileHandle* handle);
80 status_t TestLock(OpenFileCookie* cookie, LockType* type,
81 uint64* position, uint64* length, bool& conflict);
82 status_t AcquireLock(OpenFileCookie* cookie, LockInfo* lockInfo,
83 bool wait);
84 status_t ReleaseLock(OpenFileCookie* cookie, LockInfo* lockInfo);
88 #endif // NFS4INODE_H