Index: trunk/Nebulous/lib/Nebulous/Client.pm
===================================================================
--- trunk/Nebulous/lib/Nebulous/Client.pm	(revision 24996)
+++ trunk/Nebulous/lib/Nebulous/Client.pm	(revision 25121)
@@ -275,5 +275,5 @@
     my $self = shift;
 
-    my ($key, $vol_name) = validate_pos(@_,
+    my ($key, $vol_name, $min_copies) = validate_pos(@_,
         {
             type => SCALAR,
@@ -284,45 +284,45 @@
             optional    => 1,
         },
-    );
-
-    $log->debug( "entered - @_" );
-
-    my $locations;
+        {
+            # min copies
+            type        => SCALAR,
+            optional    => 1,
+        },
+    );
+
+    $min_copies ||= 1;
+
+    $log->debug( "entered - @_" );
+
+    my $stats = $self->stat($key);
+    my $instances = $stats->[6];
+    if ((not defined $instances) or ($instances == 0)) {
+        $self->set_err("can not cull - no instances");
+        $log->debug("leaving");
+        return;
+    }
+    if ($instances < $min_copies) {
+        $self->set_err("can not cull - not enough instances");
+        $log->debug("leaving");
+
+        return;
+    }
+
     # if vol_name is specified we need to stat the file to find out how many
     # instances there are on all volumes.  Otherwise we wouldn't know if it's
     # safe to remove the last instance on the specified volume.
     # XXX We need some way to determine which is the best instance to remove
+    my $locations;
     if (defined $vol_name) {
-        my @stats = $self->stat($key);
-        my $instances = $stats[6];
-        if (defined $instances and $instances < 2) {
-            $self->set_err("can not cull - not enough instances");
-            $log->debug("leaving");
-
-            return;
-        }
-
         $locations = $self->find_instances($key, $vol_name);
-        unless (defined $locations) {
-            $self->set_err( "no instances" );
-            $log->debug( "leaving" );
-
-            return;
-        }
     } else {
         $locations = $self->find_instances($key);
-        unless ($locations) {
-            $self->set_err( "no instances" );
-            $log->debug("leaving");
-
-            return;
-        }
-
-        if (scalar @{ $locations } < 2) {
-            $self->set_err("can not cull - not enough instances");
-            $log->debug("leaving");
-
-            return;
-        }
+    }
+
+    unless (defined $locations) {
+        $self->set_err( "no instances" );
+        $log->debug( "leaving" );
+
+        return;
     }
 
@@ -393,5 +393,5 @@
             }
             for (my $i = 1; $i < $stats->[6]; $i++) {
-                $self->cull($key);
+                $self->cull($key, "any", 1);
                 $removed++;
             }
