~ubuntu-branches/ubuntu/trusty/ceph/trusty-updates

« back to all changes in this revision

Viewing changes to src/mds/MDCache.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-04-09 11:14:03 UTC
  • mfrom: (1.1.33)
  • Revision ID: package-import@ubuntu.com-20140409111403-jlql95pa8kg1nk9a
Tags: 0.79-0ubuntu1
* New upstream release (LP: #1278466):
  - d/p/modules.patch: Refreshed.
  - d/ceph.install: Install all jerasure modules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
 
132
132
  // -- discover --
133
133
  struct discover_info_t {
134
 
    tid_t tid;
 
134
    ceph_tid_t tid;
135
135
    int mds;
136
136
    inodeno_t ino;
137
137
    frag_t frag;
144
144
    discover_info_t() : tid(0), mds(-1), snap(CEPH_NOSNAP), want_base_dir(false), want_xlocked(false) {}
145
145
  };
146
146
 
147
 
  map<tid_t, discover_info_t> discovers;
148
 
  tid_t discover_last_tid;
 
147
  map<ceph_tid_t, discover_info_t> discovers;
 
148
  ceph_tid_t discover_last_tid;
149
149
 
150
150
  void _send_discover(discover_info_t& dis);
151
151
  discover_info_t& _create_discover(int mds) {
152
 
    tid_t t = ++discover_last_tid;
 
152
    ceph_tid_t t = ++discover_last_tid;
153
153
    discover_info_t& d = discovers[t];
154
154
    d.tid = t;
155
155
    d.mds = mds;
317
317
  map<int, map<dirfrag_t, vector<dirfrag_t> > > other_ambiguous_imports;  
318
318
 
319
319
  map<int, map<metareqid_t, MDSlaveUpdate*> > uncommitted_slave_updates;  // slave: for replay.
320
 
  map<CDir*, int> uncommitted_slave_rename_olddir;  // slave: preserve the non-auth dir until seeing commit.
 
320
  map<CInode*, int> uncommitted_slave_rename_olddir;  // slave: preserve the non-auth dir until seeing commit.
321
321
  map<CInode*, int> uncommitted_slave_unlink;  // slave: preserve the unlinked inode until seeing commit.
322
322
 
323
323
  // track master requests whose slaves haven't acknowledged commit
581
581
  void trim_non_auth();      // trim out trimmable non-auth items
582
582
  bool trim_non_auth_subtree(CDir *directory);
583
583
  void try_trim_non_auth_subtree(CDir *dir);
 
584
  bool can_trim_non_auth_dirfrag(CDir *dir) {
 
585
    return my_ambiguous_imports.count((dir)->dirfrag()) == 0 &&
 
586
           uncommitted_slave_rename_olddir.count(dir->inode) == 0;
 
587
  }
584
588
 
585
589
  void trim_client_leases();
586
590
  void check_memory_usage();
617
621
      return NULL;
618
622
    return in->get_dirfrag(df.frag);
619
623
  }
 
624
  CDir* get_dirfrag(inodeno_t ino, const string& dn) {
 
625
    CInode *in = get_inode(ino);
 
626
    if (!in)
 
627
      return NULL;
 
628
    frag_t fg = in->pick_dirfrag(dn);
 
629
    return in->get_dirfrag(fg);
 
630
  }
620
631
  CDir* get_force_dirfrag(dirfrag_t df) {
621
632
    CInode *diri = get_inode(df.ino);
622
633
    if (!diri)
802
813
    open_ino_info_t() : checking(-1), auth_hint(-1),
803
814
      check_peers(true), fetch_backtrace(true), discover(false) {}
804
815
  };
805
 
  tid_t open_ino_last_tid;
 
816
  ceph_tid_t open_ino_last_tid;
806
817
  map<inodeno_t,open_ino_info_t> opening_inodes;
807
818
 
808
819
  void _open_ino_backtrace_fetched(inodeno_t ino, bufferlist& bl, int err);
830
841
  // -- find_ino_peer --
831
842
  struct find_ino_peer_info_t {
832
843
    inodeno_t ino;
833
 
    tid_t tid;
 
844
    ceph_tid_t tid;
834
845
    Context *fin;
835
846
    int hint;
836
847
    int checking;
839
850
    find_ino_peer_info_t() : tid(0), fin(NULL), hint(-1), checking(-1) {}
840
851
  };
841
852
 
842
 
  map<tid_t, find_ino_peer_info_t> find_ino_peer;
843
 
  tid_t find_ino_peer_last_tid;
 
853
  map<ceph_tid_t, find_ino_peer_info_t> find_ino_peer;
 
854
  ceph_tid_t find_ino_peer_last_tid;
844
855
 
845
856
  void find_ino_peers(inodeno_t ino, Context *c, int hint=-1);
846
857
  void _do_find_ino_peer(find_ino_peer_info_t& fip);
946
957
  struct ufragment {
947
958
    int bits;
948
959
    bool committed;
949
 
    bool complete;
950
960
    LogSegment *ls;
951
961
    list<Context*> waiters;
952
962
    list<frag_t> old_frags;
953
963
    bufferlist rollback;
954
 
    ufragment() : bits(0), committed(false), complete(false), ls(NULL) {}
 
964
    ufragment() : bits(0), committed(false), ls(NULL) {}
955
965
  };
956
966
  map<dirfrag_t, ufragment> uncommitted_fragments;
957
967
 
961
971
    list<CDir*> resultfrags;
962
972
    MDRequest *mdr;
963
973
    // for deadlock detection
964
 
    bool dirs_frozen;
 
974
    bool has_frozen;
965
975
    utime_t last_cum_auth_pins_change;
966
976
    int last_cum_auth_pins;
967
977
    int num_remote_waiters;     // number of remote authpin waiters
968
 
    fragment_info_t() : last_cum_auth_pins(0), num_remote_waiters(0) {}
 
978
    fragment_info_t() : has_frozen(false), last_cum_auth_pins(0), num_remote_waiters(0) {}
969
979
  };
970
980
  map<dirfrag_t,fragment_info_t> fragments;
971
981
 
1016
1026
 
1017
1027
  void find_stale_fragment_freeze();
1018
1028
  void fragment_freeze_inc_num_waiters(CDir *dir);
 
1029
  bool fragment_are_all_frozen(CDir *dir);
1019
1030
  int get_num_fragmenting_dirs() { return fragments.size(); }
1020
1031
 
1021
1032
  // -- updates --