]> 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>
Fri, 18 Jan 2013 18:45:43 +0000 (10:45 -0800)
commit7e8e6491a788caf82abc6d6702ce8646655a8730
treeb7f359ecd86596878a5897b3fc6f8867bf157e1b
parentdf399da120afa0a4cdac7a7b07dce53b911323fb
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>
(cherry picked from commit fdc5e5d1877d7d7ed3851b9ec01f884559748249)

Conflicts:

src/os/HashIndex.cc
src/os/HashIndex.h
src/os/CollectionIndex.h
src/os/FileStore.cc
src/os/HashIndex.cc
src/os/HashIndex.h