~ubuntu-branches/ubuntu/precise/ceph/precise

« back to all changes in this revision

Viewing changes to src/os/ObjectStore.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:
74
74
  };
75
75
  
76
76
 
 
77
  struct Sequencer_impl {
 
78
    virtual void flush() = 0;
 
79
    virtual ~Sequencer_impl() {}
 
80
  };
77
81
  struct Sequencer {
78
 
    void *p;
 
82
    Sequencer_impl *p;
79
83
    Sequencer() : p(NULL) {}
80
84
    ~Sequencer() {
81
 
      assert(p == NULL);
 
85
      delete p;
 
86
    }
 
87
    void flush() {
 
88
      if (p)
 
89
        p->flush();
82
90
    }
83
91
  };
84
92
  
112
120
    static const int OP_STARTSYNC =    27;  // start a sync 
113
121
 
114
122
    static const int OP_RMATTRS =      28;  // cid, oid
 
123
    static const int OP_COLL_RENAME =       29;  // cid, newcid
115
124
 
116
125
  private:
117
 
    uint64_t ops, bytes;
 
126
    uint64_t ops;
 
127
    uint64_t pad_unused_bytes;
118
128
    uint32_t largest_data_len, largest_data_off, largest_data_off_in_tbl;
119
129
    bufferlist tbl;
120
130
    bufferlist::iterator p;
148
158
          s += bls.size() + 4096;
149
159
        return s;
150
160
      }
151
 
      return bytes;
 
161
      return get_encoded_bytes();
152
162
    }
153
163
 
154
164
    uint32_t get_data_length() {
159
169
        return largest_data_off_in_tbl +
160
170
          sizeof(__u8) +  // struct_v
161
171
          sizeof(ops) +
162
 
          sizeof(bytes) +
 
172
          sizeof(pad_unused_bytes) +
163
173
          sizeof(largest_data_len) +
164
174
          sizeof(largest_data_off) +
165
175
          sizeof(largest_data_off_in_tbl) +
445
455
      ::encode(aset, tbl);
446
456
      ops++;
447
457
    }
 
458
    void collection_rename(coll_t cid, coll_t ncid) {
 
459
      __u32 op = OP_COLL_RENAME;
 
460
      ::encode(op, tbl);
 
461
      ::encode(cid, tbl);
 
462
      ::encode(ncid, tbl);
 
463
      ops++;
 
464
    }
448
465
 
449
466
 
450
467
    // etc.
451
468
    Transaction() :
452
 
      ops(0), bytes(0), largest_data_len(0), largest_data_off(0), largest_data_off_in_tbl(0),
 
469
      ops(0), pad_unused_bytes(0), largest_data_len(0), largest_data_off(0), largest_data_off_in_tbl(0),
453
470
      old(false), opp(0), blp(0), oidp(0), cidp(0), lengthp(0), attrnamep(0), attrsetp(0) { }
454
471
    Transaction(bufferlist::iterator &dp) :
455
 
      ops(0), bytes(0), largest_data_len(0), largest_data_off(0), largest_data_off_in_tbl(0),
 
472
      ops(0), pad_unused_bytes(0), largest_data_len(0), largest_data_off(0), largest_data_off_in_tbl(0),
456
473
      old(false), opp(0), blp(0), oidp(0), cidp(0), lengthp(0), attrnamep(0), attrsetp(0) {
457
474
      decode(dp);
458
475
    }
459
476
    Transaction(bufferlist &nbl) :
460
 
      ops(0), bytes(0), largest_data_len(0), largest_data_off(0), largest_data_off_in_tbl(0),
 
477
      ops(0), pad_unused_bytes(0), largest_data_len(0), largest_data_off(0), largest_data_off_in_tbl(0),
461
478
      old(false), opp(0), blp(0), oidp(0), cidp(0), lengthp(0), attrnamep(0), attrsetp(0) {
462
479
      bufferlist::iterator dp = nbl.begin();
463
480
      decode(dp); 
467
484
      __u8 struct_v = 3;
468
485
      ::encode(struct_v, bl);
469
486
      ::encode(ops, bl);
470
 
      ::encode(bytes, bl);
 
487
      ::encode(pad_unused_bytes, bl);
471
488
      ::encode(largest_data_len, bl);
472
489
      ::encode(largest_data_off, bl);
473
490
      ::encode(largest_data_off_in_tbl, bl);
493
510
      } else {
494
511
        assert(struct_v <= 3);
495
512
        ::decode(ops, bl);
496
 
        ::decode(bytes, bl);
 
513
        ::decode(pad_unused_bytes, bl);
497
514
        if (struct_v >= 3) {
498
515
          ::decode(largest_data_len, bl);
499
516
          ::decode(largest_data_off, bl);
545
562
  virtual bool exists(coll_t cid, const sobject_t& oid) = 0;                   // useful?
546
563
  virtual int stat(coll_t cid, const sobject_t& oid, struct stat *st) = 0;     // struct stat?
547
564
  virtual int read(coll_t cid, const sobject_t& oid, uint64_t offset, size_t len, bufferlist& bl) = 0;
 
565
  virtual int fiemap(coll_t cid, const sobject_t& oid, uint64_t offset, size_t len, bufferlist& bl) = 0;
548
566
 
549
567
  /*
550
568
  virtual int _remove(coll_t cid, sobject_t oid) = 0;