ImageCtx::get_copyup_snap_id returns the oldest snapshot
to be used when calculating parent image overlaps.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Conflicts:
src/librbd/AioRequest.cc
return -ENOENT;
}
+ uint64_t ImageCtx::get_copyup_snap_id() const
+ {
+ assert(snap_lock.is_locked());
+ // copyup requires the largest possible parent overlap,
+ // which is always the oldest snapshot (if any).
+ if (!snaps.empty()) {
+ return snaps.back();
+ }
+ return CEPH_NOSNAP;
+ }
+
void ImageCtx::aio_read_from_cache(object_t o, uint64_t object_no,
bufferlist *bl, size_t len,
uint64_t off, Context *onfinish,
uint64_t get_parent_snap_id(librados::snap_t in_snap_id) const;
int get_parent_overlap(librados::snap_t in_snap_id,
uint64_t *overlap) const;
+ uint64_t get_copyup_snap_id() const;
void aio_read_from_cache(object_t o, uint64_t object_no, bufferlist *bl,
size_t len, uint64_t off, Context *onfinish,
int fadvise_flags);