diff options
Diffstat (limited to 'src/osdc/Filer.h')
-rw-r--r-- | src/osdc/Filer.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/osdc/Filer.h b/src/osdc/Filer.h index d1cfb4f5275..607dc7b30d5 100644 --- a/src/osdc/Filer.h +++ b/src/osdc/Filer.h @@ -208,12 +208,14 @@ class Filer { uint64_t len, utime_t mtime, int flags, + bool keep_first, Context *onack, Context *oncommit) { vector<ObjectExtent> extents; Striper::file_to_extents(cct, ino, layout, offset, len, 0, extents); if (extents.size() == 1) { - if (extents[0].offset == 0 && extents[0].length == layout->fl_object_size) + if (extents[0].offset == 0 && extents[0].length == layout->fl_object_size && + (!keep_first || extents[0].objectno != 0)) objecter->remove(extents[0].oid, extents[0].oloc, snapc, mtime, flags, onack, oncommit); else @@ -223,7 +225,8 @@ class Filer { C_GatherBuilder gack(cct, onack); C_GatherBuilder gcom(cct, oncommit); for (vector<ObjectExtent>::iterator p = extents.begin(); p != extents.end(); ++p) { - if (p->offset == 0 && p->length == layout->fl_object_size) + if (p->offset == 0 && p->length == layout->fl_object_size && + (!keep_first || p->objectno != 0)) objecter->remove(p->oid, p->oloc, snapc, mtime, flags, onack ? gack.new_sub():0, @@ -240,6 +243,22 @@ class Filer { return 0; } + int zero(inodeno_t ino, + ceph_file_layout *layout, + const SnapContext& snapc, + uint64_t offset, + uint64_t len, + utime_t mtime, + int flags, + Context *onack, + Context *oncommit) { + + return zero(ino, layout, + snapc, offset, + len, mtime, + flags, false, + onack, oncommit); + } // purge range of ino.### objects int purge_range(inodeno_t ino, ceph_file_layout *layout, |