]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librados: don't destroy ObjListCtx when iterator reaches the end
authorJosh Durgin <josh.durgin@inktank.com>
Fri, 21 Feb 2014 23:52:59 +0000 (15:52 -0800)
committerJosh Durgin <josh.durgin@inktank.com>
Sat, 22 Feb 2014 00:06:28 +0000 (16:06 -0800)
commit8a0017ac2b982be3b83940b44c82e705898fa1d6
treede4614e02bcf86fc99c0753c57d684a157820313
parentd8a7befbc13adbf6eb9620ff99b8f35c974d0589
librados: don't destroy ObjListCtx when iterator reaches the end

There's no need to destroy it when we've used it once. It'll get destroyed
by the destructor anyway. Now that there's a seek method, we might want seek
and iterate again anyway, which is not possible if the ObjListCtx is gone.

Change get_next() to check the underlying ObjListCtx for the end of iteration
instead of deleting ObjListCtx, and modify the equality operator to count
the end marker (with ctx == NULL) as equal to having a ObjListCtx at the
end of its list.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/librados/librados.cc
src/test/librados/list.cc