]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: server: should apply new layout settings on top of old layout
authorGreg Farnum <gregory.farnum@dreamhost.com>
Thu, 25 Aug 2011 18:28:42 +0000 (11:28 -0700)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Thu, 25 Aug 2011 19:51:06 +0000 (12:51 -0700)
This way, the MDS can handle updates of some values without needing
the user to specify the entire layout (ie, they can just switch pools).
This brings the behavior more in line with setting the dir layout.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/mds/Server.cc

index 42691dce021b080b32a4c59d7ef022354c45a589..778fb3c4038ba2d67d09df487c39bb9bb5b7b017 100644 (file)
@@ -3213,11 +3213,7 @@ void Server::handle_client_setlayout(MDRequest *mdr)
   }
 
   // validate layout
-  ceph_file_layout layout;
-  memset(&layout, 0, sizeof(layout));
-  layout.fl_cas_hash = 0; // default value; "none"
-  layout.fl_pg_pool = 0; // default value "data" pool
-  layout.fl_pg_preferred = -1; // default value; "none"
+  ceph_file_layout layout = cur->get_projected_inode()->layout;
 
   if (req->head.args.setlayout.layout.fl_object_size > 0)
     layout.fl_object_size = req->head.args.setlayout.layout.fl_object_size;