~ubuntu-branches/ubuntu/raring/ceph/raring

« back to all changes in this revision

Viewing changes to src/include/rados/buffer.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-06-08 15:54:37 UTC
  • mfrom: (1.1.8) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20120608155437-gy3j9k6wzv7w4gn9
Tags: 0.44.1-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - d/control: Switch from libcryptopp to libnss as libcryptopp
    is not seeded.
  - d/control,d/rules: Move from python-support to dh_python2.
  - d/patches/manpage_updates*.patch: cherry picked upstream manpage
    updates warning about lack of encryption, per MIR review.
  - d/rules,d/control: Drop radosgw since libfcgi is not in main and
    the code may not be suitable for LTS.
  - d/rules,d/control: Drop tcmalloc since google perftools is not
    in main yet.
  - d/rules,d/control: Drop ceph-fuse entirely per MIR review
    recommendation.
* d/patches/fix-radosgw-tests.patch: Cherry picked patch from upstream
  VCS to fixup tests to conditionally use radosgw if enabled.

Show diffs side-by-side

added added

removed removed

Lines of Context:
258
258
        return *this;
259
259
      }
260
260
 
 
261
      /// get current iterator offset in buffer::list
261
262
      unsigned get_off() { return off; }
 
263
      
 
264
      /// get number of bytes remaining from iterator position to the end of the buffer::list
 
265
      unsigned get_remaining() { return bl->length() - off; }
262
266
 
 
267
      /// true if iterator is at the end of the buffer::list
263
268
      bool end() {
264
269
        return p == ls->end();
265
270
        //return off == bl->length();
441
446
    p++;
442
447
  }
443
448
}
 
449
 
 
450
inline bool operator==(bufferlist &l, bufferlist &r) {
 
451
  if (l.length() != r.length())
 
452
    return false;
 
453
  for (unsigned p = 0; p < l.length(); p++) {
 
454
    if (l[p] != r[p])
 
455
      return false;
 
456
  }
 
457
  return true;
 
458
}
444
459
inline bool operator<(bufferlist& l, bufferlist& r) {
445
460
  return r > l;
446
461
}