xref: /haiku/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.h (revision 1e36cfc2721ef13a187c6f7354dc9cbc485e89d3)
1 // KernelRequestHandler.h
2 
3 #ifndef USERLAND_FS_KERNEL_REQUEST_HANDLER_H
4 #define USERLAND_FS_KERNEL_REQUEST_HANDLER_H
5 
6 #include <fs_interface.h>
7 
8 #include "RequestHandler.h"
9 
10 namespace UserlandFSUtil {
11 
12 class GetVNodeRemovedRequest;
13 class GetVNodeRequest;
14 class NewVNodeRequest;
15 class NotifyListenerRequest;
16 class NotifyQueryRequest;
17 class NotifySelectEventRequest;
18 class PublishVNodeRequest;
19 class PutVNodeRequest;
20 class RemoveVNodeRequest;
21 class UnremoveVNodeRequest;
22 
23 }
24 
25 using UserlandFSUtil::GetVNodeRemovedRequest;
26 using UserlandFSUtil::GetVNodeRequest;
27 using UserlandFSUtil::NewVNodeRequest;
28 using UserlandFSUtil::NotifyListenerRequest;
29 using UserlandFSUtil::NotifyQueryRequest;
30 using UserlandFSUtil::NotifySelectEventRequest;
31 using UserlandFSUtil::PublishVNodeRequest;
32 using UserlandFSUtil::PutVNodeRequest;
33 using UserlandFSUtil::RemoveVNodeRequest;
34 using UserlandFSUtil::UnremoveVNodeRequest;
35 
36 class Volume;
37 
38 class KernelRequestHandler : public RequestHandler {
39 public:
40 								KernelRequestHandler(Volume* volume,
41 									uint32 expectedReply);
42 								KernelRequestHandler(FileSystem* fileSystem,
43 									uint32 expectedReply);
44 	virtual						~KernelRequestHandler();
45 
46 	virtual	status_t			HandleRequest(Request* request);
47 
48 private:
49 			// notifications
50 			status_t			_HandleRequest(NotifyListenerRequest* request);
51 			status_t			_HandleRequest(
52 									NotifySelectEventRequest* request);
53 			status_t			_HandleRequest(NotifyQueryRequest* request);
54 			// vnodes
55 			status_t			_HandleRequest(GetVNodeRequest* request);
56 			status_t			_HandleRequest(PutVNodeRequest* request);
57 			status_t			_HandleRequest(NewVNodeRequest* request);
58 			status_t			_HandleRequest(PublishVNodeRequest* request);
59 			status_t			_HandleRequest(RemoveVNodeRequest* request);
60 			status_t			_HandleRequest(UnremoveVNodeRequest* request);
61 			status_t			_HandleRequest(GetVNodeRemovedRequest* request);
62 
63 			status_t			_GetVolume(mount_id id, Volume** volume);
64 
65 private:
66 			FileSystem*			fFileSystem;
67 			Volume*				fVolume;
68 			uint32				fExpectedReply;
69 };
70 
71 #endif	// USERLAND_FS_KERNEL_REQUEST_HANDLER_H
72