200
200
int get_data_alignment() {
201
201
if (!largest_data_len)
203
return (largest_data_off - get_data_offset()) & ~PAGE_MASK;
203
return (largest_data_off - get_data_offset()) & ~CEPH_PAGE_MASK;
211
if (p.get_off() == 0)
215
210
int get_num_ops() {
219
if (p.get_off() == 0)
225
void get_bl(bufferlist& bl) {
226
if (p.get_off() == 0)
230
hobject_t get_oid() {
231
if (p.get_off() == 0)
234
if (sobject_encoding) {
237
hoid.snap = soid.snap;
245
if (p.get_off() == 0)
251
uint64_t get_length() {
252
if (p.get_off() == 0)
258
string get_attrname() {
259
if (p.get_off() == 0)
265
void get_attrset(map<string,bufferptr>& aset) {
266
if (p.get_off() == 0)
214
// ---- iterator ----
216
bufferlist::iterator p;
217
bool sobject_encoding;
219
iterator(Transaction *t)
221
sobject_encoding(t->sobject_encoding) {}
223
friend class Transaction;
234
void get_bl(bufferlist& bl) {
237
hobject_t get_oid() {
239
if (sobject_encoding) {
242
hoid.snap = soid.snap;
254
uint64_t get_length() {
259
string get_attrname() {
264
void get_attrset(map<string,bufferptr>& aset) {
270
return iterator(this);
271
273
// -----------------------------
564
568
virtual int statfs(struct statfs *buf) = 0;
571
* get ideal min value for collection_list_partial()
573
* default to some arbitrary values; the implementation will override.
575
virtual int get_ideal_list_min() { return 32; }
578
* get ideal max value for collection_list_partial()
580
* default to some arbitrary values; the implementation will override.
582
virtual int get_ideal_list_max() { return 64; }
567
585
virtual bool exists(coll_t cid, const hobject_t& oid) = 0; // useful?
568
586
virtual int stat(coll_t cid, const hobject_t& oid, struct stat *st) = 0; // struct stat?
620
638
virtual int collection_getattr(coll_t cid, const char *name, bufferlist& bl) = 0;
621
639
virtual int collection_getattrs(coll_t cid, map<string,bufferptr> &aset) = 0;
622
640
virtual bool collection_empty(coll_t c) = 0;
623
virtual int collection_list_partial(coll_t c, snapid_t seq, vector<hobject_t>& o, int count, collection_list_handle_t *handle) = 0;
624
641
virtual int collection_list(coll_t c, vector<hobject_t>& o) = 0;
645
* list partial contents of collection relative to a hash offset/position
647
* @param c collection
648
* @param start list objects that sort >= this value
649
* @param min return at least this many results, unless we reach the end
650
* @param max return no more than this many results
651
* @param snapid return no objects with snap < snapid
652
* @param ls [out] result
653
* @param next [out] next item sorts >= this value
654
* @return zero on success, or negative error
656
virtual int collection_list_partial(coll_t c, hobject_t start,
657
int min, int max, snapid_t snap,
658
vector<hobject_t> *ls, hobject_t *next) = 0;
627
662
virtual int _create_collection(coll_t c) = 0;
628
663
virtual int _destroy_collection(coll_t c) = 0;
639
674
virtual void flush() {}
640
675
virtual void sync_and_flush() {}
677
virtual int dump_journal(ostream& out) { return -EOPNOTSUPP; }
642
679
virtual int snapshot(const string& name) { return -EOPNOTSUPP; }
644
681
virtual void _fake_writes(bool b) {};
645
682
virtual void _get_frag_stat(FragmentationStat& st) {};
684
virtual uuid_d get_fsid() = 0;