~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to src/mds/CDir.h

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum, Clint Byrum, Micah Gersten
  • Date: 2011-02-12 22:50:26 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110212225026-yyyw4tk0msgql3ul
Tags: 0.24.2-0ubuntu1
[ Clint Byrum <clint@ubuntu.com> ]
* New upstream release. (LP: #658670, LP: #684011)
* debian/patches/fix-mkcephfs.patch: dropped (applied upstream)
* Removed .la files from libceph1-dev, libcrush1-dev and 
  librados1-dev (per Debian policy v3.9.1 10.2).
* debian/control: adding pkg-config as a build dependency
* debian/control: depend on libcrypto++-dev instead of libssl-dev
* debian/watch: added watch file

[ Micah Gersten <micahg@ubuntu.com> ]
* debian/control: add Homepage

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
class MDCache;
39
39
class MDCluster;
40
40
class Context;
 
41
class bloom_filter;
41
42
 
42
43
class ObjectOperation;
43
44
 
101
102
  static const unsigned STATE_FRAGMENTING =   (1<<14);
102
103
  static const unsigned STATE_STICKY =        (1<<15);  // sticky pin due to inode stickydirs
103
104
  static const unsigned STATE_DNPINNEDFRAG =  (1<<16);  // dir is refragmenting
 
105
  static const unsigned STATE_ASSIMRSTAT =    (1<<17);  // assimilating inode->frag rstats
104
106
 
105
107
  // common states
106
108
  static const unsigned STATE_CLEAN =  0;
166
168
  snapid_t first;
167
169
  map<snapid_t,old_rstat_t> dirty_old_rstat;  // [value.first,key]
168
170
 
 
171
  // my inodes with dirty rstat data
 
172
  elist<CInode*> dirty_rstat_inodes;     
 
173
 
 
174
  void resync_accounted_fragstat();
 
175
  void resync_accounted_rstat();
 
176
  void assimilate_dirty_rstat_inodes();
 
177
  void assimilate_dirty_rstat_inodes_finish(Mutation *mut, EMetaBlob *blob);
 
178
 
169
179
protected:
170
180
  version_t projected_version;
171
181
  list<fnode_t*> projected_fnode;
191
201
  fnode_t *project_fnode();
192
202
 
193
203
  void pop_and_dirty_projected_fnode(LogSegment *ls);
194
 
  bool is_projected() { return get_projected_version() > get_version(); }
 
204
  bool is_projected() { return !projected_fnode.empty(); }
195
205
  version_t pre_dirty(version_t min=0);
196
206
  void _mark_dirty(LogSegment *ls);
197
207
  void _set_dirty_flag() {
210
220
  typedef map<dentry_key_t, CDentry*> map_t;
211
221
protected:
212
222
 
213
 
  // contents
 
223
  // contents of this directory
214
224
  map_t items;       // non-null AND null
215
225
  unsigned num_head_items;
216
226
  unsigned num_head_null;
264
274
  friend class CDirDiscover;
265
275
  friend class CDirExport;
266
276
 
 
277
  bloom_filter *bloom;
 
278
  /* If you set up the bloom filter, you must keep it accurate!
 
279
   * It's deleted when you mark_complete() and is deliberately not serialized.*/
 
280
 
267
281
 public:
268
282
  CDir(CInode *in, frag_t fg, MDCache *mdcache, bool auth);
269
283
  ~CDir() {
325
339
  void link_primary_inode( CDentry *dn, CInode *in );
326
340
  void unlink_inode( CDentry *dn );
327
341
  void try_remove_unlinked_dn(CDentry *dn);
 
342
 
 
343
  void add_to_bloom(CDentry *dn);
 
344
  bool is_in_bloom(const string& name);
 
345
  bool has_bloom() { return (bloom ? true : false); }
328
346
private:
329
347
  void link_inode_work( CDentry *dn, CInode *in );
330
348
  void unlink_inode_work( CDentry *dn );
336
354
 
337
355
public:
338
356
  void split(int bits, list<CDir*>& subs, list<Context*>& waiters, bool replay);
339
 
  void merge(int bits, list<Context*>& waiters, bool replay);
 
357
  void merge(list<CDir*>& subs, list<Context*>& waiters, bool replay);
 
358
 
 
359
  bool should_split() {
 
360
    return (int)get_num_head_items() > g_conf.mds_bal_split_size;
 
361
  }
 
362
  bool should_merge() {
 
363
    return (int)get_num_head_items() < g_conf.mds_bal_merge_size;
 
364
  }
 
365
 
340
366
private:
341
367
  void steal_dentry(CDentry *dn);  // from another dir.  used by merge/split.
342
368
  void purge_stolen(list<Context*>& waiters, bool replay);
438
464
    return file_object_t(ino(), frag);
439
465
  }
440
466
  void fetch(Context *c, bool ignore_authpinnability=false);
441
 
  void _fetched(bufferlist &bl);
 
467
  void fetch(Context *c, const string& want_dn, bool ignore_authpinnability=false);
 
468
  void _fetched(bufferlist &bl, const string& want_dn);
442
469
 
443
470
  // -- commit --
444
471
  map<version_t, list<Context*> > waiting_for_commit;
457
484
  version_t get_committed_version() { return committed_version; }
458
485
  void set_committed_version(version_t v) { committed_version = v; }
459
486
 
460
 
  void mark_complete() { state_set(STATE_COMPLETE); }
 
487
  void mark_complete();
461
488
 
462
489
 
463
490
  // -- reference counting --
545
572
    }
546
573
    if (nested_auth_pins != 0) 
547
574
      return;
 
575
    if (!is_subtree_root() && inode->is_frozen())
 
576
      return;
548
577
    if (state_test(STATE_FREEZINGTREE)) {
549
578
      _freeze_tree();
550
579
      auth_unpin(this);