|
@@ -479,10 +479,10 @@ public class SnapshotManager implements SnapshotStatsMXBean {
|
|
void checkSnapshotLimit(int limit, int snapshotCount, String type)
|
|
void checkSnapshotLimit(int limit, int snapshotCount, String type)
|
|
throws SnapshotException {
|
|
throws SnapshotException {
|
|
if (snapshotCount >= limit) {
|
|
if (snapshotCount >= limit) {
|
|
- String msg = "there are already " + (snapshotCount + 1)
|
|
|
|
|
|
+ String msg = "there are already " + snapshotCount
|
|
+ " snapshot(s) and the " + type + " snapshot limit is "
|
|
+ " snapshot(s) and the " + type + " snapshot limit is "
|
|
+ limit;
|
|
+ limit;
|
|
- if (fsdir.isImageLoaded()) {
|
|
|
|
|
|
+ if (isImageLoaded()) {
|
|
// We have reached the maximum snapshot limit
|
|
// We have reached the maximum snapshot limit
|
|
throw new SnapshotException(
|
|
throw new SnapshotException(
|
|
"Failed to create snapshot: " + msg);
|
|
"Failed to create snapshot: " + msg);
|
|
@@ -492,7 +492,10 @@ public class SnapshotManager implements SnapshotStatsMXBean {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ boolean isImageLoaded() {
|
|
|
|
+ return fsdir.isImageLoaded();
|
|
|
|
+ }
|
|
/**
|
|
/**
|
|
* Delete a snapshot for a snapshottable directory
|
|
* Delete a snapshot for a snapshottable directory
|
|
* @param snapshotName Name of the snapshot to be deleted
|
|
* @param snapshotName Name of the snapshot to be deleted
|