xref: /haiku/src/add-ons/kernel/file_systems/netfs/client/RootVolume.h (revision 5a1d355fdf2747f80f8c46e2539f844a0b813346)
1 // RootVolume.h
2 
3 #ifndef NET_FS_ROOT_VOLUME_H
4 #define NET_FS_ROOT_VOLUME_H
5 
6 #include <fsproto.h>
7 
8 #include "ServerManager.h"
9 #include "VirtualVolume.h"
10 
11 class ServerVolume;
12 class VirtualNode;
13 
14 class RootVolume : public VirtualVolume, private ServerManager::Listener {
15 public:
16 								RootVolume(VolumeManager* volumeManager);
17 								~RootVolume();
18 
19 			status_t			Init();
20 			void				Uninit();
21 
22 	virtual	void				PrepareToUnmount();
23 
24 			// FS
25 			status_t			Mount(const char* device, uint32 flags,
26 									const char* parameters, int32 len);
27 	virtual	status_t			Unmount();
28 	virtual	status_t			Sync();
29 	virtual	status_t			ReadFSStat(fs_info* info);
30 	virtual	status_t			WriteFSStat(struct fs_info* info, int32 mask);
31 
32 			// files
33 	virtual	status_t			IOCtl(Node* node, void* cookie, int cmd,
34 									void* buffer, size_t bufferSize);
35 
36 private:
37 	virtual	void				ServerAdded(ExtendedServerInfo* serverInfo);
38 	virtual	void				ServerUpdated(ExtendedServerInfo* oldInfo,
39 									ExtendedServerInfo* newInfo);
40 	virtual	void				ServerRemoved(ExtendedServerInfo* serverInfo);
41 
42 
43 			ServerVolume*		_GetServerVolume(const char* name);
44 			ServerVolume*		_GetServerVolume(const NetAddress& address);
45 
46 protected:
47 			ServerManager*		fServerManager;
48 };
49 
50 #endif	// NET_FS_ROOT_VOLUME_H
51