]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs: pool safety & print deprecation warning
authorJohn Spray <john.spray@redhat.com>
Tue, 15 Jul 2014 11:45:34 +0000 (12:45 +0100)
committerJohn Spray <john.spray@redhat.com>
Tue, 15 Jul 2014 11:45:34 +0000 (12:45 +0100)
Print a message indicating to users that this tool
is now deprecated in favour of vxattrs.

Signed-off-by: John Spray <john.spray@redhat.com>
src/cephfs.cc

index 90aee32c89675b81a510ab4acf3b73dcf19f13d7..fe2d6c6abde56f6ecfb5b7d9815d85a87e242f58 100644 (file)
@@ -50,7 +50,7 @@ int main (int argc, char **argv) {
   int stripe_unit = 0;
   int stripe_count = 0;
   int object_size = 0;
-  int64_t pool = 0;
+  int64_t pool = -1;
   int file_offset = 0;
   bool dir = false;
 
@@ -60,6 +60,9 @@ int main (int argc, char **argv) {
     return 0;
   }
 
+  cerr << "WARNING: This tool is deprecated.  Use the layout.* xattrs "
+          "to query and modify layouts." << endl;
+
   if (CMD_SHOW_LAYOUT == cmd) {
     struct ceph_ioctl_layout layout;
     memset(&layout, 0, sizeof(layout));
@@ -97,6 +100,10 @@ int main (int argc, char **argv) {
     struct ceph_ioctl_layout layout;
     memset(&layout, 0, sizeof(layout));
     int ioctl_num = (dir ? CEPH_IOC_SET_LAYOUT_POLICY : CEPH_IOC_SET_LAYOUT);
+    if (pool == -1) {
+      cerr << "Pool not specified (use --pool <name or id>)" << endl;
+      return 1;
+    }
     layout.data_pool = pool;
     layout.object_size = object_size;
     layout.stripe_count = stripe_count;