}
int HashIndex::recursive_remove(const vector<string> &path) {
+ return _recursive_remove(path, true);
+}
+
+int HashIndex::_recursive_remove(const vector<string> &path, bool top) {
vector<string> subdirs;
+ dout(20) << __func__ << " path=" << path << dendl;
int r = list_subdirs(path, &subdirs);
if (r < 0)
return r;
i != subdirs.end();
++i) {
subdir.push_back(*i);
- r = recursive_remove(subdir);
+ r = _recursive_remove(subdir, false);
if (r < 0)
return r;
subdir.pop_back();
}
- return remove_path(path);
+ if (top)
+ return 0;
+ else
+ return remove_path(path);
}
int HashIndex::start_col_split(const vector<string> &path) {
ghobject_t *next
);
private:
+ /// Internal recursively remove path and its subdirs
+ int _recursive_remove(
+ const vector<string> &path, ///< [in] path to remove
+ bool top ///< [in] internal tracking of first caller
+ ); /// @return Error Code, 0 on success
/// Recursively remove path and its subdirs
int recursive_remove(
const vector<string> &path ///< [in] path to remove