1.1 --- a/libfsserver/include/fsserver/file_paging.h Sat Sep 04 23:23:32 2021 +0200
1.2 +++ b/libfsserver/include/fsserver/file_paging.h Wed Sep 08 01:18:00 2021 +0200
1.3 @@ -24,8 +24,8 @@
1.4 #include <map>
1.5 #include <mutex>
1.6
1.7 +#include <fsserver/file_notification.h>
1.8 #include <fsserver/file_opening.h>
1.9 -#include <fsserver/notification.h>
1.10 #include <fsserver/page_mapper.h>
1.11 #include <fsserver/pager.h>
1.12 #include <fsserver/pages.h>
1.13 @@ -37,15 +37,21 @@
1.14 typedef std::map<fileid_t, PageMapper *> FileMapping;
1.15 typedef std::pair<fileid_t, PageMapper *> FileMappingEntry;
1.16
1.17 +/* Mapping type from file identifiers to notification managers. */
1.18 +
1.19 +typedef std::map<fileid_t, FileNotification *> FileNotifiers;
1.20 +typedef std::map<fileid_t, FileNotification *> FileNotifierEntry;
1.21 +
1.22
1.23
1.24 /* A registry of mappers for accessors. */
1.25
1.26 -class FilePaging : public NotificationSupport
1.27 +class FilePaging
1.28 {
1.29 protected:
1.30 Pages *_pages;
1.31 FileMapping _mappers;
1.32 + FileNotifiers _notifiers;
1.33 std::mutex _lock;
1.34
1.35 /* Mapper registry access. */
1.36 @@ -60,18 +66,26 @@
1.37
1.38 map_flags_t get_flags(flags_t flags);
1.39
1.40 + long get_mapper(FileOpening *opening, const char *path, flags_t flags, fileid_t fileid, PageMapper **mapper);
1.41 +
1.42 + /* Notification manager access. */
1.43 +
1.44 + FileNotification *get_notifier(fileid_t fileid);
1.45 +
1.46 + void remove(fileid_t fileid, FileNotification *notifier);
1.47 +
1.48 public:
1.49 explicit FilePaging(Pages *pages);
1.50
1.51 /* Pager initialisation methods. */
1.52
1.53 - long get_mapper(FileOpening *opening, const char *path, flags_t flags, fileid_t fileid, PageMapper **mapper);
1.54 -
1.55 long get_pager(FileOpening *opening, const char *path, flags_t flags, fileid_t fileid, Pager **pager);
1.56
1.57 /* Methods for the pager. */
1.58
1.59 void detach_pager(fileid_t fileid, PageMapper *mapper);
1.60 +
1.61 + FileNotification *notifier(fileid_t fileid);
1.62 };
1.63
1.64 // vim: tabstop=4 expandtab shiftwidth=4