xref: /haiku/src/add-ons/kernel/file_systems/netfs/server/Volume.h (revision 820dca4df6c7bf955c46e8f6521b9408f50b2900)
1 // Volume.h
2 
3 #ifndef NET_FS_VOLUME_H
4 #define NET_FS_VOLUME_H
5 
6 #include <SupportDefs.h>
7 
8 class Directory;
9 class Entry;
10 class Node;
11 
12 class Volume {
13 public:
14 								Volume(dev_t id);
15 								~Volume();
16 
17 			status_t			Init();
18 
19 			dev_t				GetID() const;
20 			Directory*			GetRootDirectory() const;
21 			ino_t				GetRootID() const;
22 
23 			bool				KnowsQuery() const;
24 
25 			status_t			AddNode(Node* node);
26 			bool				RemoveNode(Node* node);
27 			Node*				GetNode(ino_t nodeID);
28 			Node*				GetFirstNode() const;
29 
30 			status_t			AddEntry(Entry* entry);
31 			bool				RemoveEntry(Entry* entry);
32 			Entry*				GetEntry(ino_t dirID, const char* name);
33 			Entry*				GetFirstEntry() const;
34 
35 private:
36 			struct NodeMap;
37 			struct EntryKey;
38 			struct EntryMap;
39 
40 			dev_t				fID;
41 			Directory*			fRootDir;
42 			uint32				fFSFlags;
43 			NodeMap*			fNodes;
44 			EntryMap*			fEntries;
45 };
46 
47 #endif	// NET_FS_VOLUME_H
48