]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
off_t -> __u64 throughout osd/os/ebofs
authorSage Weil <sage@newdream.net>
Fri, 23 May 2008 23:28:20 +0000 (16:28 -0700)
committerSage Weil <sage@newdream.net>
Fri, 23 May 2008 23:28:20 +0000 (16:28 -0700)
13 files changed:
src/config.h
src/ebofs/BlockDevice.cc
src/ebofs/BufferCache.cc
src/ebofs/BufferCache.h
src/ebofs/Ebofs.cc
src/ebofs/Ebofs.h
src/ebofs/Onode.h
src/ebofs/mkfs.ebofs.cc
src/ebofs/test.ebofs.cc
src/ebofs/types.h
src/os/FileStore.cc
src/os/FileStore.h
src/os/ObjectStore.h

index f5979f5f7b0fdead665ca932d32e3a9517444218..b8ab3776a659cbff50aeac07f6707229c01aa10b 100644 (file)
@@ -290,8 +290,8 @@ struct md_config_t {
   int   ebofs_commit_ms;
   int   ebofs_oc_size;
   int   ebofs_cc_size;
-  off_t ebofs_bc_size;
-  off_t ebofs_bc_max_dirty;
+  __u64 ebofs_bc_size;
+  __u64 ebofs_bc_max_dirty;
   unsigned ebofs_max_prefetch;
   bool  ebofs_realloc;
   bool ebofs_verify_csum_on_read;
index 7061f6deb2e281b8068b3b704a575ed363780b92..d0a296d7168d5be4cf174ea3714a54f94f6d9663 100644 (file)
@@ -639,8 +639,8 @@ int BlockDevice::_read(int fd, block_t bno, unsigned num, bufferlist& bl)
 
   assert(fd > 0);
   
-  off_t offset = bno * EBOFS_BLOCK_SIZE;
-  off_t actual = lseek(fd, offset, SEEK_SET);
+  __u64 offset = bno * EBOFS_BLOCK_SIZE;
+  __u64 actual = lseek(fd, offset, SEEK_SET);
   assert(actual == offset);
   
   size_t len = num*EBOFS_BLOCK_SIZE;
@@ -675,9 +675,9 @@ int BlockDevice::_write(int fd, unsigned bno, unsigned num, bufferlist& bl)
   assert(fd > 0);
   
   while (1) {
-    off_t offset = (off_t)bno << EBOFS_BLOCK_BITS;
-    assert((off_t)bno * (off_t)EBOFS_BLOCK_SIZE == offset);
-    off_t actual = lseek(fd, offset, SEEK_SET);
+    __u64 offset = bno << EBOFS_BLOCK_BITS;
+    assert(bno * EBOFS_BLOCK_SIZE == offset);
+    __u64 actual = lseek(fd, offset, SEEK_SET);
     assert(actual == offset);
     
     // write buffers
index 2a5a8a4a9b0d6a4729f3b2fa2798aca0d6548db4..3064c5879be64727e79ecc008de756d6dfb489b0 100644 (file)
 #include "Onode.h"
 
 
-void do_apply_partial(bufferlist& bl, map<off_t, bufferlist>& pm) 
+void do_apply_partial(bufferlist& bl, map<__u64, bufferlist>& pm) 
 {
   assert(bl.length() == (unsigned)EBOFS_BLOCK_SIZE);
   //assert(partial_is_complete());
   //cout << "apply_partial" << std::endl;
-  for (map<off_t, bufferlist>::iterator i = pm.begin();
+  for (map<__u64, bufferlist>::iterator i = pm.begin();
        i != pm.end();
        i++) {
     //cout << "do_apply_partial at " << i->first << "~" << i->second.length() << std::endl;
@@ -43,7 +43,7 @@ void do_apply_partial(bufferlist& bl, map<off_t, bufferlist>& pm)
 #define derr(x)  if (x <= g_conf.debug_ebofs) *_derr << dbeginl << g_clock.now() << " ebofs." << *this << "."
 
 
-void BufferHead::add_partial(off_t off, bufferlist& p) 
+void BufferHead::add_partial(__u64 off, bufferlist& p) 
 {
   unsigned len = p.length();
   assert(len <= (unsigned)EBOFS_BLOCK_SIZE);
@@ -51,7 +51,7 @@ void BufferHead::add_partial(off_t off, bufferlist& p)
   assert(off + len <= EBOFS_BLOCK_SIZE);
   
   // trim any existing that overlaps
-  map<off_t, bufferlist>::iterator i = partial.begin();
+  map<__u64, bufferlist>::iterator i = partial.begin();
   while (i != partial.end()) {
     // is [off,off+len)...
     // past i?
@@ -82,7 +82,7 @@ void BufferHead::add_partial(off_t off, bufferlist& p)
     // overlap head of i?
     if (off <= i->first && off+len < i->first + i->second.length()) {
       // move i (make new tail).
-      off_t tailoff = off+len;
+      __u64 tailoff = off+len;
       unsigned trim = tailoff - i->first;
       partial[tailoff].substr_of(i->second, trim, i->second.length()-trim);
       partial.erase(i++);   // should now be at tailoff
@@ -231,9 +231,9 @@ void ObjectCache::rx_finish(ioh_t ioh, block_t start, block_t length, bufferlist
       assert(exv[0].start != 0);
       block_t cur_block = exv[0].start;
       
-      off_t off_in_bl = (bh->start() - start) * EBOFS_BLOCK_SIZE;
+      __u64 off_in_bl = (bh->start() - start) * EBOFS_BLOCK_SIZE;
       assert(off_in_bl >= 0);
-      off_t len_in_bl = bh->length() * EBOFS_BLOCK_SIZE;
+      __u64 len_in_bl = bh->length() * EBOFS_BLOCK_SIZE;
 
       // verify csum
       csum_t want = *bh->oc->on->get_extent_csum_ptr(bh->start(), 1);
@@ -246,16 +246,16 @@ void ObjectCache::rx_finish(ioh_t ioh, block_t start, block_t length, bufferlist
        *bh->oc->on->get_extent_csum_ptr(bh->start(), 1) = got;
        bh->oc->on->data_csum += got - want;
        
-       interval_set<off_t> bad;
+       interval_set<__u64> bad;
        bad.insert(bh->start()*EBOFS_BLOCK_SIZE, EBOFS_BLOCK_SIZE);
        bh->oc->on->bad_byte_extents.union_of(bad);
 
-       interval_set<off_t> over;
-       for (map<off_t,bufferlist>::iterator q = bh->partial.begin();
+       interval_set<__u64> over;
+       for (map<__u64,bufferlist>::iterator q = bh->partial.begin();
             q != bh->partial.end();
             q++)
          over.insert(bh->start()*EBOFS_BLOCK_SIZE+q->first, q->second.length());
-       interval_set<off_t> new_over;
+       interval_set<__u64> new_over;
        new_over.intersection_of(over, bh->oc->on->bad_byte_extents);
        bh->oc->on->bad_byte_extents.subtract(new_over);
       }
index 5fb55cf0121a735066fbb1b156aeebf9611dcf18..133b15d4231b6d9b0a8e31bbea91575268c91c70 100644 (file)
@@ -55,7 +55,7 @@ class BufferHead : public LRUObject {
   ioh_t     tx_ioh;         // 
   block_t   tx_block;
 
-  map<off_t, bufferlist>     partial;   // partial dirty content overlayed onto incoming data
+  map<__u64, bufferlist>     partial;   // partial dirty content overlayed onto incoming data
 
   map<block_t, list<Context*> > waitfor_read;
   
@@ -173,8 +173,8 @@ class BufferHead : public LRUObject {
     shadows.clear();
   }
 
-  void copy_partial_substr(off_t start, off_t end, bufferlist& bl) {
-    map<off_t, bufferlist>::iterator i = partial.begin();
+  void copy_partial_substr(__u64 start, __u64 end, bufferlist& bl) {
+    map<__u64, bufferlist>::iterator i = partial.begin();
     
     // skip first bits (fully to left)
     while ((i->first + i->second.length() < start) &&
@@ -188,7 +188,7 @@ class BufferHead : public LRUObject {
     unsigned bhlen = MIN(end-start, i->second.length());
     bl.substr_of( i->second, bhoff, bhlen );
 
-    off_t pos = i->first + i->second.length();
+    __u64 pos = i->first + i->second.length();
     
     // have continuous to end?
     for (i++; i != partial.end(); i++) {
@@ -212,8 +212,8 @@ class BufferHead : public LRUObject {
     assert(bl.length() == (unsigned)(end-start));
   }
 
-  bool have_partial_range(off_t start, off_t end) {
-    map<off_t, bufferlist>::iterator i = partial.begin();
+  bool have_partial_range(__u64 start, __u64 end) {
+    map<__u64, bufferlist>::iterator i = partial.begin();
 
     // skip first bits (fully to left)
     while ((i->first + i->second.length() < start) &&
@@ -223,7 +223,7 @@ class BufferHead : public LRUObject {
 
     // have start?
     if (i->first > start) return false;
-    off_t pos = i->first + i->second.length();
+    __u64 pos = i->first + i->second.length();
 
     // have continuous to end?
     for (i++; i != partial.end(); i++) {
@@ -238,12 +238,12 @@ class BufferHead : public LRUObject {
     return false;
   }
 
-  bool partial_is_complete(off_t size) {
+  bool partial_is_complete(__u64 size) {
     return have_partial_range( 0, MIN(size, EBOFS_BLOCK_SIZE) );
   }
 
   void apply_partial();
-  void add_partial(off_t off, bufferlist& p);
+  void add_partial(__u64 off, bufferlist& p);
 
   void take_read_waiters(list<Context*>& finished) {
     for (map<block_t,list<Context*> >::iterator p = waitfor_read.begin();
@@ -455,13 +455,13 @@ class BufferCache {
   Cond  flush_cond;
   int   stat_waiter;
 
-  off_t stat_all;
-  off_t stat_clean, stat_corrupt;
-  off_t stat_dirty;
-  off_t stat_rx;
-  off_t stat_tx;
-  off_t stat_partial;
-  off_t stat_missing;
+  __u64 stat_all;
+  __u64 stat_clean, stat_corrupt;
+  __u64 stat_dirty;
+  __u64 stat_rx;
+  __u64 stat_tx;
+  __u64 stat_partial;
+  __u64 stat_missing;
   
   int partial_reads;
 
@@ -480,11 +480,11 @@ class BufferCache {
     {}
 
 
-  off_t get_size() {
+  __u64 get_size() {
     assert(stat_clean+stat_dirty+stat_rx+stat_tx+stat_partial+stat_corrupt+stat_missing == stat_all);
     return stat_all;
   }
-  off_t get_trimmable() {
+  __u64 get_trimmable() {
     return stat_clean+stat_corrupt;
   }
 
@@ -559,11 +559,11 @@ class BufferCache {
     }
     stat_all -= bh->length();
   }
-  off_t get_stat_tx() { return stat_tx; }
-  off_t get_stat_rx() { return stat_rx; }
-  off_t get_stat_dirty() { return stat_dirty; }
-  off_t get_stat_clean() { return stat_clean; }
-  off_t get_stat_partial() { return stat_partial; }
+  __u64 get_stat_tx() { return stat_tx; }
+  __u64 get_stat_rx() { return stat_rx; }
+  __u64 get_stat_dirty() { return stat_dirty; }
+  __u64 get_stat_clean() { return stat_clean; }
+  __u64 get_stat_partial() { return stat_partial; }
 
   
   map<version_t, int> &get_unflushed(int what) {
index 3bfad06e4b5f9de65776fbbc8b5fd437dc0ba86e..e05bbdc21cad27638aebc5e7be0a5094bf8d6b2f 100644 (file)
@@ -851,7 +851,7 @@ csum_t Ebofs::encode_onode(Onode *on, bufferlist& bl, unsigned& off)
   }
 
   // bad byte extents
-  for (map<off_t,off_t>::iterator p = on->bad_byte_extents.m.begin();
+  for (map<__u64,__u64>::iterator p = on->bad_byte_extents.m.begin();
        p != on->bad_byte_extents.m.end();
        p++) {
     extent_t o = {p->first, p->second};
@@ -1348,7 +1348,7 @@ void Ebofs::trim_buffer_cache()
   ebofs_lock.Unlock();
 }
 
-void Ebofs::trim_bc(off_t max)
+void Ebofs::trim_bc(__u64 max)
 {
   if (max < 0)
     max = g_conf.ebofs_bc_size;
@@ -1628,11 +1628,11 @@ void Ebofs::alloc_write(Onode *on,
 }
 
 
-int Ebofs::check_partial_edges(Onode *on, off_t off, off_t len, 
+int Ebofs::check_partial_edges(Onode *on, __u64 off, __u64 len, 
                               bool &partial_head, bool &partial_tail)
 {
   // partial block overwrite at head or tail?
-  off_t last_block_byte = on->last_block * EBOFS_BLOCK_SIZE;
+  __u64 last_block_byte = on->last_block * EBOFS_BLOCK_SIZE;
   partial_head = (off < last_block_byte) && (off & EBOFS_BLOCK_MASK);
   partial_tail = ((off+len) < on->object_size) && ((off+len) & EBOFS_BLOCK_MASK);
   dout(10) << "check_partial_edges on " << *on << " " << off << "~" << len 
@@ -1654,8 +1654,8 @@ int Ebofs::check_partial_edges(Onode *on, off_t off, off_t len,
        return -1;
       }
       if (bh->is_partial()) {
-       int off_in_bh = off & EBOFS_BLOCK_MASK;
-       int end_in_bh = MAX(EBOFS_BLOCK_SIZE, off_in_bh+len);
+       unsigned off_in_bh = off & EBOFS_BLOCK_MASK;
+       unsigned end_in_bh = MAX(EBOFS_BLOCK_SIZE, off_in_bh+len);
        if (!(off_in_bh == 0 || bh->have_partial_range(0, off_in_bh)) ||
            !(end_in_bh == EBOFS_BLOCK_SIZE || bh->have_partial_range(end_in_bh, EBOFS_BLOCK_SIZE-end_in_bh))) {
          dout(10) << "check_partial_edges can't complete partial head " << *bh << ", deferring" << dendl;
@@ -1675,10 +1675,10 @@ int Ebofs::check_partial_edges(Onode *on, off_t off, off_t len,
        return -1;
       }
       if (bh->is_partial()) {
-       off_t off_in_bh = off & EBOFS_BLOCK_MASK;
-       off_t end_in_bh = MAX(EBOFS_BLOCK_SIZE, off_in_bh+len);
-       off_t end = EBOFS_BLOCK_SIZE;
-       if ((off_t)bh->end()*EBOFS_BLOCK_SIZE > last_block_byte)
+       __u64 off_in_bh = off & EBOFS_BLOCK_MASK;
+       __u64 end_in_bh = MAX(EBOFS_BLOCK_SIZE, off_in_bh+len);
+       __u64 end = EBOFS_BLOCK_SIZE;
+       if (bh->end()*EBOFS_BLOCK_SIZE > last_block_byte)
          end = last_block_byte & EBOFS_BLOCK_MASK;
        if (!(off_in_bh == 0 || bh->have_partial_range(0, off_in_bh)) ||
            !(end_in_bh >= end || bh->have_partial_range(end_in_bh, end-end_in_bh))) {
@@ -1693,7 +1693,7 @@ int Ebofs::check_partial_edges(Onode *on, off_t off, off_t len,
   return 0;
 }
 
-int Ebofs::apply_write(Onode *on, off_t off, off_t len, const bufferlist& bl)
+int Ebofs::apply_write(Onode *on, __u64 off, __u64 len, const bufferlist& bl)
 {
   ObjectCache *oc = on->get_oc(&bc);
   //oc->scrub_csums();
@@ -1701,8 +1701,8 @@ int Ebofs::apply_write(Onode *on, off_t off, off_t len, const bufferlist& bl)
   assert(bl.length() == len);
 
   // map into blocks
-  off_t opos = off;        // byte pos in object
-  off_t left = len;        // bytes left
+  __u64 opos = off;        // byte pos in object
+  __u64 left = len;        // bytes left
   block_t bstart = off / EBOFS_BLOCK_SIZE;
   block_t blast = (len+off-1) / EBOFS_BLOCK_SIZE;
   block_t blen = blast-bstart+1;
@@ -1715,7 +1715,7 @@ int Ebofs::apply_write(Onode *on, off_t off, off_t len, const bufferlist& bl)
   // -- starting changing stuff --
 
   // extending object?
-  off_t old_object_size = on->object_size;
+  __u64 old_object_size = on->object_size;
   if (off+len > on->object_size) {
     dout(10) << "apply_write extending size on " << *on << ": " << on->object_size 
              << " -> " << off+len << dendl;
@@ -1803,15 +1803,15 @@ int Ebofs::apply_write(Onode *on, off_t off, off_t len, const bufferlist& bl)
     if ((bh->start() == bstart && partial_head) ||
         (bh->last() == blast && partial_tail)) {
       unsigned len_in_bh = MIN( left, 
-                               ((off_t)bh->end()*EBOFS_BLOCK_SIZE)-opos );
+                               (bh->end()*EBOFS_BLOCK_SIZE)-opos );
       
       if (bh->is_partial() || bh->is_rx() || bh->is_missing() || bh->is_corrupt()) {
         assert(bh->length() == 1);
 
        if (bh->is_corrupt()) {
          dout(10) << "apply_write  marking non-overwritten bytes bad on corrupt " << *bh << dendl;
-         interval_set<off_t> bad;
-         off_t bs = bh->start() * EBOFS_BLOCK_SIZE;
+         interval_set<__u64> bad;
+         __u64 bs = bh->start() * EBOFS_BLOCK_SIZE;
          if (off_in_bh) bad.insert(bs, bs+off_in_bh);
          if (off_in_bh+len_in_bh < (unsigned)EBOFS_BLOCK_SIZE)
            bad.insert(bs+off_in_bh+len_in_bh, bs+EBOFS_BLOCK_SIZE-off_in_bh-len_in_bh);
@@ -1946,10 +1946,10 @@ int Ebofs::apply_write(Onode *on, off_t off, off_t len, const bufferlist& bl)
 
     // ok
     //  we're now writing up to a block boundary, or EOF.
-    assert(off_in_bh+left >= (off_t)(EBOFS_BLOCK_SIZE*bh->length()) ||
+    assert(off_in_bh+left >= (__u64)(EBOFS_BLOCK_SIZE*bh->length()) ||
            (opos+left) >= on->object_size);
 
-    unsigned len_in_bh = MIN((off_t)bh->length()*EBOFS_BLOCK_SIZE - off_in_bh, 
+    unsigned len_in_bh = MIN((__u64)bh->length()*EBOFS_BLOCK_SIZE - off_in_bh, 
                             left);
     assert(len_in_bh <= left);
 
@@ -1977,8 +1977,8 @@ int Ebofs::apply_write(Onode *on, off_t off, off_t len, const bufferlist& bl)
       // zero leader?
       if (off_in_bh &&
          opos > old_object_size) {
-       off_t zstart = MAX(0, old_object_size-(off_t)bh->start()*EBOFS_BLOCK_SIZE);
-       off_t zlen = off_in_bh - zstart;
+       __u64 zstart = MAX(0, old_object_size-(__u64)bh->start()*EBOFS_BLOCK_SIZE);
+       __u64 zlen = off_in_bh - zstart;
        dout(15) << "apply_write zeroing bh lead over " << zstart << "~" << zlen << dendl;
        bh->data.zero(zstart, zlen);
       }
@@ -1990,8 +1990,8 @@ int Ebofs::apply_write(Onode *on, off_t off, off_t len, const bufferlist& bl)
 
       // zero the past-eof tail, too, to be tidy.
       if (len_in_bh < bh->data.length()) {
-       off_t zstart = off_in_bh+len_in_bh;
-       off_t zlen = bh->data.length()-(off_in_bh+len_in_bh);
+       __u64 zstart = off_in_bh+len_in_bh;
+       __u64 zlen = bh->data.length()-(off_in_bh+len_in_bh);
        bh->data.zero(zstart, zlen);
        dout(15) << "apply_write zeroing bh tail over " << zstart << "~" << zlen << dendl;
       }
@@ -2034,7 +2034,7 @@ int Ebofs::apply_write(Onode *on, off_t off, off_t len, const bufferlist& bl)
 }
 
 
-int Ebofs::apply_zero(Onode *on, off_t off, size_t len)
+int Ebofs::apply_zero(Onode *on, __u64 off, size_t len)
 {
   dout(10) << "apply_zero " << off << "~" << len << " on " << *on << dendl;
 
@@ -2121,7 +2121,7 @@ int Ebofs::apply_zero(Onode *on, off_t off, size_t len)
 
 // *** file i/o ***
 
-int Ebofs::attempt_read(Onode *on, off_t off, size_t len, bufferlist& bl, 
+int Ebofs::attempt_read(Onode *on, __u64 off, size_t len, bufferlist& bl, 
                        Cond *will_wait_on, bool *will_wait_on_bool)
 {
   dout(10) << "attempt_read " << *on << " " << off << "~" << len << dendl;
@@ -2134,8 +2134,8 @@ int Ebofs::attempt_read(Onode *on, off_t off, size_t len, bufferlist& bl,
       return -EIO;
     }
     if (on->bad_byte_extents.end() > off) {
-      off_t bad = on->bad_byte_extents.start_after(off);
-      if (bad < off+(off_t)len) {
+      __u64 bad = on->bad_byte_extents.start_after(off);
+      if (bad < off+(__u64)len) {
        len = bad-off;
        dout(10) << "attempt_read corrupt (bad byte extent) at " << bad << ", shortening read to " << len << dendl;
       }
@@ -2182,10 +2182,10 @@ int Ebofs::attempt_read(Onode *on, off_t off, size_t len, bufferlist& bl,
        i != partials.end();
        i++) {
     BufferHead *bh = i->second;
-    off_t bhstart = (off_t)(bh->start()*EBOFS_BLOCK_SIZE);
-    off_t bhend = (off_t)(bh->end()*EBOFS_BLOCK_SIZE);
-    off_t start = MAX( off, bhstart );
-    off_t end = MIN( off+(off_t)len, bhend );
+    __u64 bhstart = (__u64)(bh->start()*EBOFS_BLOCK_SIZE);
+    __u64 bhend = (__u64)(bh->end()*EBOFS_BLOCK_SIZE);
+    __u64 start = MAX( off, bhstart );
+    __u64 end = MIN( off+(__u64)len, bhend );
     
     if (!i->second->have_partial_range(start-bhstart, end-bhstart)) {
       // wait on this one
@@ -2203,7 +2203,7 @@ int Ebofs::attempt_read(Onode *on, off_t off, size_t len, bufferlist& bl,
   map<block_t,BufferHead*>::iterator p = partials.begin();
 
   bl.clear();
-  off_t pos = off;
+  __u64 pos = off;
   block_t curblock = bstart;
   while (curblock <= blast) {
     BufferHead *bh = 0;
@@ -2215,10 +2215,10 @@ int Ebofs::attempt_read(Onode *on, off_t off, size_t len, bufferlist& bl,
       p++;
     } else assert(0);
     
-    off_t bhstart = (off_t)(bh->start()*EBOFS_BLOCK_SIZE);
-    off_t bhend = (off_t)(bh->end()*EBOFS_BLOCK_SIZE);
-    off_t start = MAX( pos, bhstart );
-    off_t end = MIN( off+(off_t)len, bhend );
+    __u64 bhstart = (__u64)(bh->start()*EBOFS_BLOCK_SIZE);
+    __u64 bhend = (__u64)(bh->end()*EBOFS_BLOCK_SIZE);
+    __u64 start = MAX( pos, bhstart );
+    __u64 end = MIN( off+(__u64)len, bhend );
 
     if (bh->is_corrupt()) {
       if (bl.length()) {
@@ -2275,7 +2275,7 @@ int Ebofs::attempt_read(Onode *on, off_t off, size_t len, bufferlist& bl,
  * return value of -1 if onode isn't loaded.  otherwise, the number
  * of extents that need to be read (i.e. # of seeks)  
  */
-int Ebofs::is_cached(coll_t cid, pobject_t oid, off_t off, size_t len)
+int Ebofs::is_cached(coll_t cid, pobject_t oid, __u64 off, size_t len)
 {
   ebofs_lock.Lock();
   int r = _is_cached(oid, off, len);
@@ -2283,7 +2283,7 @@ int Ebofs::is_cached(coll_t cid, pobject_t oid, off_t off, size_t len)
   return r;
 }
 
-int Ebofs::_is_cached(pobject_t oid, off_t off, size_t len)
+int Ebofs::_is_cached(pobject_t oid, __u64 off, size_t len)
 {
   if (!have_onode(oid)) {
     dout(7) << "_is_cached " << oid << " " << off << "~" << len << " ... onode  " << dendl;
@@ -2326,14 +2326,14 @@ int Ebofs::_is_cached(pobject_t oid, off_t off, size_t len)
   */
 }
 
-void Ebofs::trim_from_cache(coll_t cid, pobject_t oid, off_t off, size_t len)
+void Ebofs::trim_from_cache(coll_t cid, pobject_t oid, __u64 off, size_t len)
 {
   ebofs_lock.Lock();
   _trim_from_cache(oid, off, len);
   ebofs_lock.Unlock();
 }
 
-void Ebofs::_trim_from_cache(pobject_t oid, off_t off, size_t len)
+void Ebofs::_trim_from_cache(pobject_t oid, __u64 off, size_t len)
 {
   // be careful not to load it if we don't have it
   if (!have_onode(oid)) {
@@ -2359,7 +2359,7 @@ void Ebofs::_trim_from_cache(pobject_t oid, off_t off, size_t len)
 
 
 int Ebofs::read(coll_t cid, pobject_t oid, 
-                off_t off, size_t len,
+                __u64 off, size_t len,
                 bufferlist& bl)
 {
   ebofs_lock.Lock();
@@ -2368,7 +2368,7 @@ int Ebofs::read(coll_t cid, pobject_t oid,
   return r;
 }
 
-int Ebofs::_read(pobject_t oid, off_t off, size_t len, bufferlist& bl)
+int Ebofs::_read(pobject_t oid, __u64 off, size_t len, bufferlist& bl)
 {
   dout(7) << "_read " << oid << " " << off << "~" << len << dendl;
 
@@ -2391,7 +2391,7 @@ int Ebofs::_read(pobject_t oid, off_t off, size_t len, bufferlist& bl)
     }
 
     size_t try_len = len ? len:on->object_size;
-    size_t will_read = MIN(off+(off_t)try_len, on->object_size) - off;
+    size_t will_read = MIN(off+(__u64)try_len, on->object_size) - off;
     
     bool done;
     r = attempt_read(on, off, will_read, bl, &cond, &done);
@@ -2468,7 +2468,7 @@ unsigned Ebofs::_apply_transaction(Transaction& t)
       {
         pobject_t oid;
        t.get_oid(oid);
-        off_t offset, len;
+        __u64 offset, len;
        t.get_length(offset);
        t.get_length(len);
         bufferlist *pbl;
@@ -2526,7 +2526,7 @@ unsigned Ebofs::_apply_transaction(Transaction& t)
       {
         pobject_t oid;
        t.get_oid(oid);
-        off_t offset, len;
+        __u64 offset, len;
        t.get_length(offset);
        t.get_length(len);
         bufferlist bl;
@@ -2542,7 +2542,7 @@ unsigned Ebofs::_apply_transaction(Transaction& t)
       {
         pobject_t oid;
        t.get_oid(oid);
-        off_t offset, len;
+        __u64 offset, len;
        t.get_length(offset);
        t.get_length(len);
         if (_zero(oid, offset, len) < 0) {
@@ -2556,7 +2556,7 @@ unsigned Ebofs::_apply_transaction(Transaction& t)
       {
         pobject_t oid;
        t.get_oid(oid);
-        off_t offset, len;
+        __u64 offset, len;
        t.get_length(offset);
        t.get_length(len);
         _trim_from_cache(oid, offset, len);
@@ -2567,7 +2567,7 @@ unsigned Ebofs::_apply_transaction(Transaction& t)
       {
         pobject_t oid;
        t.get_oid(oid);
-        off_t len;
+        __u64 len;
        t.get_length(len);
         if (_truncate(oid, len) < 0) {
           dout(7) << "apply_transaction fail on _truncate" << dendl;
@@ -2732,7 +2732,7 @@ unsigned Ebofs::_apply_transaction(Transaction& t)
 
 
 
-int Ebofs::_write(pobject_t oid, off_t offset, size_t length, const bufferlist& bl)
+int Ebofs::_write(pobject_t oid, __u64 offset, size_t length, const bufferlist& bl)
 {
   dout(7) << "_write " << oid << " " << offset << "~" << length << dendl;
   assert(bl.length() == length);
@@ -2808,7 +2808,7 @@ int Ebofs::_write(pobject_t oid, off_t offset, size_t length, const bufferlist&
   return length;
 }
 
-int Ebofs::_zero(pobject_t oid, off_t offset, size_t length)
+int Ebofs::_zero(pobject_t oid, __u64 offset, size_t length)
 {
   dout(7) << "_zero " << oid << " " << offset << "~" << length << dendl;
 
@@ -2822,7 +2822,7 @@ int Ebofs::_zero(pobject_t oid, off_t offset, size_t length)
 
   if (length > 0 &&
       offset < on->object_size) {
-    if (offset + (off_t)length >= on->object_size) {
+    if (offset + (__u64)length >= on->object_size) {
       _truncate(oid, offset);
     } else {
       while (1) {
@@ -2848,7 +2848,7 @@ int Ebofs::_zero(pobject_t oid, off_t offset, size_t length)
 
 
 int Ebofs::write(coll_t cid, pobject_t oid, 
-                 off_t off, size_t len,
+                 __u64 off, size_t len,
                  const bufferlist& bl, Context *onsafe)
 {
   ebofs_lock.Lock();
@@ -2875,7 +2875,7 @@ int Ebofs::write(coll_t cid, pobject_t oid,
   return r;
 }
 
-int Ebofs::zero(coll_t cid, pobject_t oid, off_t off, size_t len, Context *onsafe)
+int Ebofs::zero(coll_t cid, pobject_t oid, __u64 off, size_t len, Context *onsafe)
 {
   ebofs_lock.Lock();
   
@@ -2942,7 +2942,7 @@ int Ebofs::remove(coll_t cid, pobject_t oid, Context *onsafe)
   return r;
 }
 
-int Ebofs::_truncate(pobject_t oid, off_t size)
+int Ebofs::_truncate(pobject_t oid, __u64 size)
 {
   dout(7) << "_truncate " << oid << " size " << size << dendl;
 
@@ -3001,7 +3001,7 @@ int Ebofs::_truncate(pobject_t oid, off_t size)
 }
 
 
-int Ebofs::truncate(coll_t cid, pobject_t oid, off_t size, Context *onsafe)
+int Ebofs::truncate(coll_t cid, pobject_t oid, __u64 size, Context *onsafe)
 {
   ebofs_lock.Lock();
   
index 3fb85c374c83d3c8edc52db6c684948c815079b9..2ae263d69d5c5ba329a8e1628fc1348c4ed6c25f 100644 (file)
@@ -179,7 +179,7 @@ protected:
 
   version_t trigger_commit();
   void commit_bc_wait(version_t epoch);
-  void trim_bc(off_t max = -1);
+  void trim_bc(__u64 max = -1);
 
  public:
   void kick_idle();
@@ -196,7 +196,7 @@ protected:
 
 
  protected:
-  int check_partial_edges(Onode *on, off_t off, off_t len, 
+  int check_partial_edges(Onode *on, __u64 off, __u64 len, 
                          bool &partial_head, bool &partial_tail);
 
   void alloc_write(Onode *on, 
@@ -204,9 +204,9 @@ protected:
                    interval_set<block_t>& alloc,
                    block_t& old_bfirst, block_t& old_blast,
                   csum_t& old_csum_first, csum_t& old_csum_last);
-  int apply_write(Onode *on, off_t off, off_t len, const bufferlist& bl);
-  int apply_zero(Onode *on, off_t off, size_t len);
-  int attempt_read(Onode *on, off_t off, size_t len, bufferlist& bl, 
+  int apply_write(Onode *on, __u64 off, __u64 len, const bufferlist& bl);
+  int apply_zero(Onode *on, __u64 off, size_t len);
+  int attempt_read(Onode *on, __u64 off, size_t len, bufferlist& bl, 
                   Cond *will_wait_on, bool *will_wait_on_bool);
 
   Finisher finisher;
@@ -262,15 +262,15 @@ protected:
   // object interface
   bool exists(coll_t cid, pobject_t);
   int stat(coll_t cid, pobject_t, struct stat*);
-  int read(coll_t cid, pobject_t, off_t off, size_t len, bufferlist& bl);
-  int is_cached(coll_t cid, pobject_t oid, off_t off, size_t len);
+  int read(coll_t cid, pobject_t, __u64 off, size_t len, bufferlist& bl);
+  int is_cached(coll_t cid, pobject_t oid, __u64 off, size_t len);
 
-  int write(coll_t cid, pobject_t oid, off_t off, size_t len, const bufferlist& bl, Context *onsafe);
-  int zero(coll_t cid, pobject_t oid, off_t off, size_t len, Context *onsafe);
-  int truncate(coll_t cid, pobject_t oid, off_t size, Context *onsafe=0);
+  int write(coll_t cid, pobject_t oid, __u64 off, size_t len, const bufferlist& bl, Context *onsafe);
+  int zero(coll_t cid, pobject_t oid, __u64 off, size_t len, Context *onsafe);
+  int truncate(coll_t cid, pobject_t oid, __u64 size, Context *onsafe=0);
   int remove(coll_t cid, pobject_t oid, Context *onsafe=0);
   bool write_will_block();
-  void trim_from_cache(coll_t cid, pobject_t oid, off_t off, size_t len);
+  void trim_from_cache(coll_t cid, pobject_t oid, __u64 off, size_t len);
 
   int rename(pobject_t from, pobject_t to);
   int clone(coll_t cid, pobject_t from, pobject_t to, Context *onsafe);
@@ -325,18 +325,18 @@ private:
   // private interface -- use if caller already holds lock
   unsigned _apply_transaction(Transaction& t);
 
-  int _read(pobject_t oid, off_t off, size_t len, bufferlist& bl);
-  int _is_cached(pobject_t oid, off_t off, size_t len);
+  int _read(pobject_t oid, __u64 off, size_t len, bufferlist& bl);
+  int _is_cached(pobject_t oid, __u64 off, size_t len);
   int _stat(pobject_t oid, struct stat *st);
   int _getattr(pobject_t oid, const char *name, void *value, size_t size);
   int _getattrs(pobject_t oid, map<string,bufferptr> &aset);
   int _get_object_collections(pobject_t oid, set<coll_t>& ls);
 
   bool _write_will_block();
-  int _write(pobject_t oid, off_t off, size_t len, const bufferlist& bl);
-  void _trim_from_cache(pobject_t oid, off_t off, size_t len);
-  int _truncate(pobject_t oid, off_t size);
-  int _zero(pobject_t oid, off_t offset, size_t length);
+  int _write(pobject_t oid, __u64 off, size_t len, const bufferlist& bl);
+  void _trim_from_cache(pobject_t oid, __u64 off, size_t len);
+  int _truncate(pobject_t oid, __u64 size);
+  int _zero(pobject_t oid, __u64 offset, size_t length);
   int _remove(pobject_t oid);
   int _clone(pobject_t from, pobject_t to);
   int _setattr(pobject_t oid, const char *name, const void *value, size_t size);
index ad365d3f7e2b7f47aa325a397b34210c7d711ae4..bd48a0e966b5e1d9455159b1dd9cc62eace82d77 100644 (file)
@@ -76,7 +76,7 @@ public:
   extent_t onode_loc;
   epoch_t last_alloc_epoch; // epoch i last allocated for
 
-  __s64 object_size;
+  __u64 object_size;
   __u64 alloc_blocks, last_block;
   csum_t data_csum;
   bool readonly;
@@ -86,7 +86,7 @@ public:
   map<string, bufferptr> attr;
 
   map<block_t, ExtentCsum>   extent_map;
-  interval_set<off_t> bad_byte_extents;
+  interval_set<__u64> bad_byte_extents;
 
   interval_set<block_t> uncommitted;
 
index f2114cf25cbbf745d4506e6efb293cd0fa7ce2d0..9cbc000e3f48e662529b69a1cb54edb8044fa03d 100644 (file)
@@ -71,8 +71,8 @@ int main(int argc, const char **argv)
       
 
       pobject_t oid(0, 0, object_t(1,2));
-      off_t pos = 0;
-      off_t sz = 16;
+      __u64 pos = 0;
+      __u64 sz = 16;
 
       bufferlist bl;
       bl.append(crap, sz);
@@ -173,7 +173,7 @@ int main(int argc, const char **argv)
 
 
       char *p = bl.c_str();
-      off_t o = 0;
+      __u64 o = 0;
       for (int i=0; i<n; i++) {
         cout << "write at " << o << std::endl;
         for (int j=0;j<l;j++) 
@@ -214,7 +214,7 @@ int main(int argc, const char **argv)
 
       utime_t start = g_clock.now();
 
-      for (off_t m=0; m<megs; m++) {
+      for (__u64 m=0; m<megs; m++) {
         //if (m%100 == 0)
           cout << m << " / " << megs << std::endl;
         fs.write(10, bl.length(), 1024LL*1024LL*m, bl, (Context*)0);
@@ -254,7 +254,7 @@ int main(int argc, const char **argv)
       if (1) {
         srand(0);
         for (int i=0; i<10000; i++) {
-          off_t off = rand() % 1000000;
+          __u64 off = rand() % 1000000;
           size_t len = 1+rand() % 10000;
           cout << std::endl << i << " writing bit at " << off << " len " << len << std::endl;
           fs.write(10, len, off, bl, (Context*)0);
@@ -263,7 +263,7 @@ int main(int argc, const char **argv)
         }
         fs.remove(10);
         for (int i=0; i<100; i++) {
-          off_t off = rand() % 1000000;
+          __u64 off = rand() % 1000000;
           size_t len = 1+rand() % 10000;
           cout << std::endl << i << " writing bit at " << off << " len " << len << std::endl;
           fs.write(10, len, off, bl, (Context*)0);
@@ -275,7 +275,7 @@ int main(int argc, const char **argv)
       if (0) {
         // sequential write
         srand(0);
-        off_t off = 0;
+        __u64 off = 0;
         for (int i=0; i<10000; i++) {
           size_t len = 1024*1024;//1+rand() % 10000;
           cout << std::endl << i << " writing bit at " << off << " len " << len << std::endl;
@@ -291,7 +291,7 @@ int main(int argc, const char **argv)
         srand(0);
         for (int i=0; i<100; i++) {
           bufferlist bl;
-          off_t off = rand() % 1000000;
+          __u64 off = rand() % 1000000;
           size_t len = rand() % 1000;
           cout << std::endl << "read bit at " << off << " len " << len << std::endl;
           int r = fs.read(10, len, off, bl);
@@ -310,7 +310,7 @@ int main(int argc, const char **argv)
         srand(0);
         for (int i=0; i<100; i++) {
           bufferlist bl;
-          off_t off = rand() % 1000000;
+          __u64 off = rand() % 1000000;
           size_t len = 100;
           cout << std::endl << "read bit at " << off << " len " << len << std::endl;
           int r = fs.read(10, len, off, bl);
@@ -327,7 +327,7 @@ int main(int argc, const char **argv)
         // write on empty cache
         srand(0);
         for (int i=0; i<100; i++) {
-          off_t off = rand() % 1000000;
+          __u64 off = rand() % 1000000;
           size_t len = 100;
           cout << std::endl <<  "writing bit at " << off << " len " << len << std::endl;
           fs.write(10, len, off, bl, (Context*)0);
index 3af062fa2aaddd64a5f5083eafe19c58722f13ef..2611971b31eb4da51d9c188b06c02e635ccc34c6 100644 (file)
@@ -42,8 +42,8 @@ public:
       pobject_t oid;
       oid.oid.ino = (rand() % 1000) + 0x10000000;
       coll_t cid = rand() % 50;
-      off_t off = rand() % 10000;//0;//rand() % 1000000;
-      off_t len = 1+rand() % 100000;
+      __u64 off = rand() % 10000;//0;//rand() % 1000000;
+      __u64 len = 1+rand() % 100000;
       const char *a = "one";
       if (rand() % 2) a = "two";
       int l = 3;//rand() % 10;
@@ -76,7 +76,7 @@ public:
         {
           cout << t << " write " << hex << oid << dec << " at " << off << " len " << len << std::endl;
          char b[len];
-          for (int j=0;j<len;j++)
+          for (unsigned j=0;j<len;j++)
             b[j] = fingerprint_byte_at(off+j, oid.oid.ino);
           bufferlist w;
          w.append(b, len);
index 34cd0db9e70aa3119fdc1190a9968f413a9f365c..5ffe5367e35ed2488a529eab80dabb69ac7ca1e1 100644 (file)
@@ -39,9 +39,9 @@ using namespace __gnu_cxx;
 // disk
 typedef uint64_t block_t;        // disk location/sector/block
 
-static const int EBOFS_BLOCK_SIZE = 4096;
-static const int EBOFS_BLOCK_MASK = 4095;
-static const int EBOFS_BLOCK_BITS = 12;    // 1<<12 == 4096
+static const unsigned EBOFS_BLOCK_SIZE = 4096;
+static const unsigned EBOFS_BLOCK_MASK = 4095;
+static const unsigned EBOFS_BLOCK_BITS = 12;    // 1<<12 == 4096
 
 struct extent_t {
   block_t start, length;
index 575872b6764a38981949c5de39f56453370849a4..ed832c2e0fd5ccf0d4fac2cd086cc3f525a729f4 100644 (file)
@@ -423,7 +423,7 @@ int FileStore::remove(coll_t cid, pobject_t oid, Context *onsafe)
   return r < 0 ? -errno:r;
 }
 
-int FileStore::truncate(coll_t cid, pobject_t oid, off_t size, Context *onsafe)
+int FileStore::truncate(coll_t cid, pobject_t oid, __u64 size, Context *onsafe)
 {
   dout(20) << "truncate " << cid << " " << oid << " size " << size << dendl;
 
@@ -435,7 +435,7 @@ int FileStore::truncate(coll_t cid, pobject_t oid, off_t size, Context *onsafe)
 }
 
 int FileStore::read(coll_t cid, pobject_t oid, 
-                    off_t offset, size_t len,
+                    __u64 offset, size_t len,
                     bufferlist& bl) {
   dout(20) << "read " << cid << " " << oid << " len " << len << " off " << offset << dendl;
 
@@ -449,7 +449,7 @@ int FileStore::read(coll_t cid, pobject_t oid,
   }
   ::flock(fd, LOCK_EX);    // lock for safety
   
-  off_t actual = lseek(fd, offset, SEEK_SET);
+  __u64 actual = lseek(fd, offset, SEEK_SET);
   size_t got = 0;
 
   if (len == 0) {
@@ -471,7 +471,7 @@ int FileStore::read(coll_t cid, pobject_t oid,
 
 
 int FileStore::write(coll_t cid, pobject_t oid, 
-                     off_t offset, size_t len,
+                     __u64 offset, size_t len,
                      const bufferlist& bl, 
                      Context *onsafe)
 {
@@ -489,7 +489,7 @@ int FileStore::write(coll_t cid, pobject_t oid,
   ::flock(fd, LOCK_EX);    // lock for safety
   
   // seek
-  off_t actual = ::lseek(fd, offset, SEEK_SET);
+  __u64 actual = ::lseek(fd, offset, SEEK_SET);
   int did = 0;
   assert(actual == offset);
 
index 882386070e97900bf12c0945bc61389197c86c28..e5906b7f45a76a0f05819a6320312e3126aff997 100644 (file)
@@ -97,9 +97,9 @@ class FileStore : public JournalingObjectStore {
   bool exists(coll_t cid, pobject_t oid);
   int stat(coll_t cid, pobject_t oid, struct stat *st);
   int remove(coll_t cid, pobject_t oid, Context *onsafe);
-  int truncate(coll_t cid, pobject_t oid, off_t size, Context *onsafe);
-  int read(coll_t cid, pobject_t oid, off_t offset, size_t len, bufferlist& bl);
-  int write(coll_t cid, pobject_t oid, off_t offset, size_t len, const bufferlist& bl, Context *onsafe);
+  int truncate(coll_t cid, pobject_t oid, __u64 size, Context *onsafe);
+  int read(coll_t cid, pobject_t oid, __u64 offset, size_t len, bufferlist& bl);
+  int write(coll_t cid, pobject_t oid, __u64 offset, size_t len, const bufferlist& bl, Context *onsafe);
   int clone(coll_t cid, pobject_t oldoid, pobject_t newoid);
 
   void sync();
@@ -130,8 +130,8 @@ class FileStore : public JournalingObjectStore {
   int collection_list(coll_t c, list<pobject_t>& o);
 
   int pick_object_revision_lt(coll_t cid, pobject_t& oid) { return -1; }
-  void trim_from_cache(coll_t cid, pobject_t oid, off_t offset, size_t len) {}
-  int is_cached(coll_t cid, pobject_t oid, off_t offset, size_t len) { return -1; }
+  void trim_from_cache(coll_t cid, pobject_t oid, __u64 offset, size_t len) {}
+  int is_cached(coll_t cid, pobject_t oid, __u64 offset, size_t len) { return -1; }
 
 
 };
index df13023af25ae74485dfef868385c3f8f6df9a1f..575cec943a9696060d9a9888b1eb64ea3353252e 100644 (file)
@@ -134,7 +134,7 @@ public:
       cid = cids.front();
       cids.pop_front();
     }
-    void get_length(off_t& len) {
+    void get_length(__u64& len) {
       len = lengths.front();
       lengths.pop_front();
     }
@@ -160,7 +160,7 @@ public:
     }
       
 
-    void read(coll_t cid, pobject_t oid, off_t off, size_t len, bufferlist *pbl) {
+    void read(coll_t cid, pobject_t oid, __u64 off, size_t len, bufferlist *pbl) {
       int op = OP_READ;
       ops.push_back(op);
       cids.push_back(cid);
@@ -192,7 +192,7 @@ public:
       pattrsets.push_back(&aset);
     }
 
-    void write(coll_t cid, pobject_t oid, off_t off, size_t len, const bufferlist& bl) {
+    void write(coll_t cid, pobject_t oid, __u64 off, size_t len, const bufferlist& bl) {
       int op = OP_WRITE;
       ops.push_back(op);
       cids.push_back(cid);
@@ -201,7 +201,7 @@ public:
       lengths.push_back(len);
       bls.push_back(bl);
     }
-    void zero(coll_t cid, pobject_t oid, off_t off, size_t len) {
+    void zero(coll_t cid, pobject_t oid, __u64 off, size_t len) {
       int op = OP_ZERO;
       ops.push_back(op);
       cids.push_back(cid);
@@ -209,7 +209,7 @@ public:
       lengths.push_back(off);
       lengths.push_back(len);
     }
-    void trim_from_cache(coll_t cid, pobject_t oid, off_t off, size_t len) {
+    void trim_from_cache(coll_t cid, pobject_t oid, __u64 off, size_t len) {
       int op = OP_TRIMCACHE;
       ops.push_back(op);
       cids.push_back(cid);
@@ -217,7 +217,7 @@ public:
       lengths.push_back(off);
       lengths.push_back(len);
     }
-    void truncate(coll_t cid, pobject_t oid, off_t off) {
+    void truncate(coll_t cid, pobject_t oid, __u64 off) {
       int op = OP_TRUNCATE;
       ops.push_back(op);
       cids.push_back(cid);
@@ -353,7 +353,7 @@ public:
         {
          coll_t cid;
           pobject_t oid;
-          off_t offset, len;
+          __u64 offset, len;
          t.get_cid(cid);
          t.get_oid(oid);
          t.get_length(offset);
@@ -405,7 +405,7 @@ public:
          t.get_cid(cid);
          pobject_t oid;
          t.get_oid(oid);
-          off_t offset, len;
+          __u64 offset, len;
          t.get_length(offset);
          t.get_length(len);
           bufferlist bl;
@@ -420,7 +420,7 @@ public:
          t.get_cid(cid);
          pobject_t oid;
          t.get_oid(oid);
-          off_t offset, len;
+          __u64 offset, len;
          t.get_length(offset);
          t.get_length(len);
           zero(cid, oid, offset, len, 0);
@@ -433,7 +433,7 @@ public:
          t.get_cid(cid);
          pobject_t oid;
          t.get_oid(oid);
-          off_t offset, len;
+          __u64 offset, len;
          t.get_length(offset);
          t.get_length(len);
           trim_from_cache(cid, oid, offset, len);
@@ -446,7 +446,7 @@ public:
          t.get_cid(cid);
          pobject_t oid;
          t.get_oid(oid);
-          off_t len;
+          __u64 len;
          t.get_length(len);
           truncate(cid, oid, len, 0);
         }
@@ -603,19 +603,19 @@ public:
   virtual bool exists(coll_t cid, pobject_t oid) = 0;                   // useful?
   virtual int stat(coll_t cid, pobject_t oid, struct stat *st) = 0;     // struct stat?
   virtual int remove(coll_t cid, pobject_t oid, Context *onsafe=0) = 0;
-  virtual int truncate(coll_t cid, pobject_t oid, off_t size, Context *onsafe=0) = 0;
+  virtual int truncate(coll_t cid, pobject_t oid, __u64 size, Context *onsafe=0) = 0;
   
-  virtual int read(coll_t cid, pobject_t oid, off_t offset, size_t len, bufferlist& bl) = 0;
-  virtual int write(coll_t cid, pobject_t oid, off_t offset, size_t len, const bufferlist& bl, Context *onsafe) = 0;
-  virtual int zero(coll_t cid, pobject_t oid, off_t offset, size_t len, Context *onsafe) {
+  virtual int read(coll_t cid, pobject_t oid, __u64 offset, size_t len, bufferlist& bl) = 0;
+  virtual int write(coll_t cid, pobject_t oid, __u64 offset, size_t len, const bufferlist& bl, Context *onsafe) = 0;
+  virtual int zero(coll_t cid, pobject_t oid, __u64 offset, size_t len, Context *onsafe) {
     // write zeros.. yuck!
     bufferptr bp(len);
     bufferlist bl;
     bl.push_back(bp);
     return write(cid, oid, offset, len, bl, onsafe);
   }
-  virtual void trim_from_cache(coll_t cid, pobject_t oid, off_t offset, size_t len) = 0; //{ }
-  virtual int is_cached(coll_t cid, pobject_t oid, off_t offset, size_t len) = 0;  //{ return -1; }
+  virtual void trim_from_cache(coll_t cid, pobject_t oid, __u64 offset, size_t len) = 0; //{ }
+  virtual int is_cached(coll_t cid, pobject_t oid, __u64 offset, size_t len) = 0;  //{ return -1; }
 
   virtual int setattr(coll_t cid, pobject_t oid, const char *name,
                       const void *value, size_t size,