@@ -4501,16 +4501,11 @@ NDCTL_EXPORT int ndctl_namespace_enable(struct ndctl_namespace *ndns)
const char *devname = ndctl_namespace_get_devname(ndns);
struct ndctl_ctx *ctx = ndctl_namespace_get_ctx(ndns);
struct ndctl_region *region = ndns->region;
- unsigned long long size = ndctl_namespace_get_size(ndns);
int rc;
if (ndctl_namespace_is_enabled(ndns))
return 0;
- /* Don't try to enable idle namespace (no capacity allocated) */
- if (size == 0)
- return -ENXIO;
-
rc = ndctl_bind(ctx, ndns->module, devname);
/*
@@ -1161,15 +1161,12 @@ static int namespace_destroy(struct ndctl_region *region,
struct ndctl_namespace *ndns)
{
const char *devname = ndctl_namespace_get_devname(ndns);
- unsigned long long size;
int rc;
rc = namespace_prep_reconfig(region, ndns);
if (rc < 0)
return rc;
- size = ndctl_namespace_get_size(ndns);
-
/* Labeled namespace, destroy label / allocation */
if (rc == 2) {
rc = ndctl_namespace_delete(ndns);
@@ -1177,13 +1174,6 @@ static int namespace_destroy(struct ndctl_region *region,
debug("%s: failed to reclaim\n", devname);
}
- /*
- * Don't report a destroyed namespace when no capacity was
- * allocated.
- */
- if (size == 0 && rc == 0)
- rc = 1;
-
return rc;
}