diff options
author | Samuel Just <sam.just@inktank.com> | 2013-02-15 10:45:47 -0800 |
---|---|---|
committer | Samuel Just <sam.just@inktank.com> | 2013-02-20 13:29:20 -0800 |
commit | ebdf66dfbfb8e2509e8fe9aebe5cb3e3da929769 (patch) | |
tree | 213b0c7442c54a97beb1afec2b9ad60b35fa34c2 /src/osd/OSD.h | |
parent | 7af32997978caaa3c4538334c5fa26df1698b3f5 (diff) | |
download | ceph-ebdf66dfbfb8e2509e8fe9aebe5cb3e3da929769.tar.gz |
Watch/Notify: rework watch/notify
Signed-off-by: Samuel Just <sam.just@inktank.com>
Diffstat (limited to 'src/osd/OSD.h')
-rw-r--r-- | src/osd/OSD.h | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 1837195d339..25e1eee13ad 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -48,6 +48,7 @@ using namespace std; #include <ext/hash_set> using namespace __gnu_cxx; +#include "Watch.h" #include "common/shared_cache.hpp" #include "common/simple_cache.hpp" #include "common/sharedptr_registry.hpp" @@ -295,7 +296,11 @@ public: // -- Watch -- Mutex watch_lock; SafeTimer watch_timer; - Watch *watch; + uint64_t next_notif_id; + uint64_t get_next_id(epoch_t cur_epoch) { + Mutex::Locker l(watch_lock); + return (((uint64_t)cur_epoch) << 32) | ((uint64_t)(next_notif_id++)); + } // -- Backfill Request Scheduling -- Mutex backfill_request_lock; @@ -526,7 +531,7 @@ public: int64_t auid; epoch_t last_sent_epoch; Connection *con; - std::map<void *, pg_t> watches; + WatchConState wstate; Session() : auid(-1), last_sent_epoch(0), con(0) {} }; @@ -1468,17 +1473,6 @@ public: int init_op_flags(OpRequestRef op); - - void put_object_context(void *_obc, pg_t pgid); - void complete_notify(void *notif, void *obc); - void ack_notification(entity_name_t& peer_addr, void *notif, void *obc, - ReplicatedPG *pg); - void handle_notify_timeout(void *notif); - void disconnect_session_watches(Session *session); - void handle_watch_timeout(void *obc, - ReplicatedPG *pg, - entity_name_t entity, - utime_t expire); OSDService service; friend class OSDService; }; |