112
120
static const int OP_STARTSYNC = 27; // start a sync
114
122
static const int OP_RMATTRS = 28; // cid, oid
123
static const int OP_COLL_RENAME = 29; // cid, newcid
127
uint64_t pad_unused_bytes;
118
128
uint32_t largest_data_len, largest_data_off, largest_data_off_in_tbl;
120
130
bufferlist::iterator p;
159
169
return largest_data_off_in_tbl +
160
170
sizeof(__u8) + // struct_v
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);
458
void collection_rename(coll_t cid, coll_t ncid) {
459
__u32 op = OP_COLL_RENAME;
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) {
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();
467
484
__u8 struct_v = 3;
468
485
::encode(struct_v, bl);
469
486
::encode(ops, 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);
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;
550
568
virtual int _remove(coll_t cid, sobject_t oid) = 0;