summaryrefslogtreecommitdiff
path: root/src/os/CollectionIndex.h
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2012-11-17 18:18:23 -0800
committerSamuel Just <sam.just@inktank.com>2013-01-18 10:45:43 -0800
commit7e8e6491a788caf82abc6d6702ce8646655a8730 (patch)
treeb7f359ecd86596878a5897b3fc6f8867bf157e1b /src/os/CollectionIndex.h
parentdf399da120afa0a4cdac7a7b07dce53b911323fb (diff)
downloadceph-7e8e6491a788caf82abc6d6702ce8646655a8730.tar.gz
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
Diffstat (limited to 'src/os/CollectionIndex.h')
-rw-r--r--src/os/CollectionIndex.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/os/CollectionIndex.h b/src/os/CollectionIndex.h
index d931a88b2d5..4cd1c1762fd 100644
--- a/src/os/CollectionIndex.h
+++ b/src/os/CollectionIndex.h
@@ -166,6 +166,9 @@ protected:
vector<hobject_t> *ls ///< [out] Listed Objects
) = 0;
+ /// Call prior to removing directory
+ virtual int prep_delete() { return 0; }
+
/// Virtual destructor
virtual ~CollectionIndex() {}
};