* during deletion (same EBUSY return code)
*/
int remove(const std::string& soid);
-
+ int remove(const std::string& soid, int flags);
/**
* Resizes a striped object
* the truncation can not happen if any I/O is ongoing (it
return 0;
}
-int libradosstriper::RadosStriperImpl::remove(const std::string& soid)
+int libradosstriper::RadosStriperImpl::remove(const std::string& soid, int flags)
{
std::string firstObjOid = getObjectId(soid, 0);
try {
// delete rados objects in reverse order
int rcr = 0;
for (int i = nb_objects-1; i >= 0; i--) {
- rcr = m_ioCtx.remove(getObjectId(soid, i));
+ if (flags == 0) {
+ rcr = m_ioCtx.remove(getObjectId(soid, i));
+ } else {
+ rcr = m_ioCtx.remove(getObjectId(soid, i), flags);
+ }
if (rcr < 0 and -ENOENT != rcr) {
lderr(cct()) << "RadosStriperImpl::remove : deletion incomplete for " << soid
- << ", as " << getObjectId(soid, i) << " could not be deleted (rc=" << rc << ")"
- << dendl;
+ << ", as " << getObjectId(soid, i) << " could not be deleted (rc=" << rc << ")"
+ << dendl;
break;
}
}
// errror caught when trying to take the exclusive lock
return e.m_code;
}
+
}
int libradosstriper::RadosStriperImpl::trunc(const std::string& soid, uint64_t size)
// stat, deletion and truncation
int stat(const std::string& soid, uint64_t *psize, time_t *pmtime);
- int remove(const std::string& soid);
+ int remove(const std::string& soid, int flags=0);
int trunc(const std::string& soid, uint64_t size);
// reference counting
{
return rados_striper_impl->remove(soid);
}
+int libradosstriper::RadosStriper::remove(const std::string& soid, int flags)
+{
+ return rados_striper_impl->remove(soid, flags);
+}
int libradosstriper::RadosStriper::trunc(const std::string& soid, uint64_t size)
{
for (; iter != nargs.end(); ++iter) {
const string & oid = *iter;
if (use_striper) {
- ret = striper.remove(oid);
+ if (forcefull) {
+ ret = striper.remove(oid, CEPH_OSD_FLAG_FULL_FORCE);
+ } else {
+ ret = striper.remove(oid);
+ }
} else {
if (forcefull) {
ret = io_ctx.remove(oid, CEPH_OSD_FLAG_FULL_FORCE);