]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
os/: Add CollectionIndex::prep_delete
authorSamuel Just <sam.just@inktank.com>
Sun, 18 Nov 2012 02:18:23 +0000 (18:18 -0800)
committerSamuel Just <sam.just@inktank.com>
Wed, 5 Dec 2012 19:34:18 +0000 (11:34 -0800)
commitfdc5e5d1877d7d7ed3851b9ec01f884559748249
tree0c7b8317f05fc5f4c1255c88e747b233edc81555
parenta48dee547c8d9bd3cbb03416752d67078eee80f7
os/: Add CollectionIndex::prep_delete

If an unlink is interupted between removing the file
and updating the subdir attribute, the attribute will
overestimate the number of files in the directory.  This
is by design, at worst we will merge the collection later
than intended, but closing the gap would require a second
subdir xattr update.  However, this can in extreme cases
result in a collection with subdirectories but no objects.
FileStore::_destry_collection would therefore see an
erroneous -ENOTEMPTY.

prep_delete allows the CollectionIndex implementation to
clean up state prior to removal.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/os/CollectionIndex.h
src/os/FileStore.cc
src/os/HashIndex.cc
src/os/HashIndex.h