]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: pre-allocate inode numbers less frequently
authorYan, Zheng <zheng.z.yan@intel.com>
Wed, 30 Apr 2014 07:51:19 +0000 (15:51 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Tue, 6 May 2014 23:10:16 +0000 (07:10 +0800)
no need to refill the pre-allocated inode numbers each time an inode
number is used.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/Server.cc

index bbfdc50d9c970488a1206c85f724de030891ffcd..0cf46edd5ccbae7611a4d75f1af6ffefec50d2d2 100644 (file)
@@ -1916,7 +1916,7 @@ CInode* Server::prepare_new_inode(MDRequestRef& mdr, CDir *dir, inodeno_t useino
   }
     
   int got = g_conf->mds_client_prealloc_inos - mdr->session->get_num_projected_prealloc_inos();
-  if (got > 0) {
+  if (got > g_conf->mds_client_prealloc_inos / 2) {
     mds->inotable->project_alloc_ids(mdr->prealloc_inos, got);
     assert(mdr->prealloc_inos.size());  // or else fix projected increment semantics
     mdr->session->pending_prealloc_inos.insert(mdr->prealloc_inos);