]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: use 0 for layout defaults, not -1
authorSage Weil <sage@newdream.net>
Wed, 2 Sep 2009 23:33:59 +0000 (16:33 -0700)
committerSage Weil <sage@newdream.net>
Wed, 2 Sep 2009 23:33:59 +0000 (16:33 -0700)
This simplifies callers that zero the structs.  And 0 is
clearly an illegal value, so it's safe to mean 'use the
default'.

src/client/Client.cc
src/mds/Server.cc

index 6c9e1238fcf5dfb86763dbd277a013bc514b5efe..8be4116f89f125c6a5ea324959003a6d6becfb5c 100644 (file)
@@ -125,10 +125,10 @@ Client::Client(Messenger *m, MonClient *mc) : timer(client_lock), client_lock("C
 
   cwd = NULL;
 
-  file_stripe_unit = -1;
-  file_stripe_count = -1;
-  object_size = -1;
-  file_replication = -1;
+  file_stripe_unit = 0;
+  file_stripe_count = 0;
+  object_size = 0;
+  file_replication = 0;
 
   // 
   root = 0;
index fe1b59a56cc732026b55119b2ccfeddaa7bdbb6f..eda9c16a6b2bedc754c13ed394d979c5b10de50c 100644 (file)
@@ -2101,13 +2101,13 @@ void Server::handle_client_openc(MDRequest *mdr)
   }
   in->inode.rstat.rfiles = 1;
 
-  if (req->head.args.open.stripe_unit != 0xffffffff)
+  if (req->head.args.open.stripe_unit)
     in->inode.layout.fl_stripe_unit = req->head.args.open.stripe_unit;
-  if (req->head.args.open.stripe_count != 0xffffffff)
+  if (req->head.args.open.stripe_count)
     in->inode.layout.fl_stripe_count = req->head.args.open.stripe_count;
-  if (req->head.args.open.object_size != 0xffffffff)
+  if (req->head.args.open.object_size)
     in->inode.layout.fl_object_size = req->head.args.open.object_size;
-  /*if(req->head.args->open.file_replication != 0xffffffff)
+  /*if(req->head.args->open.file_replication)
     in->inode.layout.fl_pg_pool.set_size(req->head.args.open.file_replication);
   */