X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fclient%2FMetaSession.h;fp=src%2Fceph%2Fsrc%2Fclient%2FMetaSession.h;h=af84615fc1d825d71821923b31d0192204d4ff92;hb=812ff6ca9fcd3e629e49d4328905f33eee8ca3f5;hp=0000000000000000000000000000000000000000;hpb=15280273faafb77777eab341909a3f495cf248d9;p=stor4nfv.git diff --git a/src/ceph/src/client/MetaSession.h b/src/ceph/src/client/MetaSession.h new file mode 100644 index 0000000..af84615 --- /dev/null +++ b/src/ceph/src/client/MetaSession.h @@ -0,0 +1,68 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + +#ifndef CEPH_CLIENT_METASESSION_H +#define CEPH_CLIENT_METASESSION_H + +#include "include/types.h" +#include "include/utime.h" +#include "msg/Message.h" +#include "include/xlist.h" +#include "mds/mdstypes.h" + +struct Cap; +struct Inode; +struct CapSnap; +struct MetaRequest; +class MClientCapRelease; + +struct MetaSession { + mds_rank_t mds_num; + ConnectionRef con; + version_t seq; + uint64_t cap_gen; + utime_t cap_ttl, last_cap_renew_request; + uint64_t cap_renew_seq; + int num_caps; + entity_inst_t inst; + + enum { + STATE_NEW, + STATE_OPENING, + STATE_OPEN, + STATE_CLOSING, + STATE_CLOSED, + STATE_STALE, + } state; + + int mds_state; + bool readonly; + + list waiting_for_open; + + xlist caps; + xlist flushing_caps; + xlist requests; + xlist unsafe_requests; + std::set flushing_caps_tids; + std::set early_flushing_caps; + + MClientCapRelease *release; + + MetaSession() + : mds_num(-1), con(NULL), + seq(0), cap_gen(0), cap_renew_seq(0), num_caps(0), + state(STATE_NEW), mds_state(0), readonly(false), + release(NULL) + {} + ~MetaSession(); + + const char *get_state_name() const; + + void dump(Formatter *f) const; + + void enqueue_cap_release(inodeno_t ino, uint64_t cap_id, ceph_seq_t iseq, + ceph_seq_t mseq, epoch_t osd_barrier); +}; + +#endif