Whamcloud - gitweb
LU-5034 llite: Change readdir BRW metrics 75/10275/2
authorJinshan Xiong <jinshan.xiong@intel.com>
Fri, 9 May 2014 00:08:14 +0000 (17:08 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 20 May 2014 04:53:29 +0000 (04:53 +0000)
To simplify the code, change the metrics from bytes to pages.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: If458cb64ba5de14ed709f6fe03db956935201566
Reviewed-on: http://review.whamcloud.com/10275
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/dir.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/llite_nfs.c
lustre/llite/statahead.c

index 54acb3d..04c1da6 100644 (file)
@@ -316,7 +316,7 @@ static int ll_readdir(struct file *filp, void *cookie, filldir_t filldir)
                GOTO(out, rc = PTR_ERR(op_data));
 
        op_data->op_hash_offset = pos;
-       op_data->op_max_pages = sbi->ll_md_brw_size >> PAGE_CACHE_SHIFT;
+       op_data->op_max_pages = sbi->ll_md_brw_pages;
 #ifdef HAVE_DIR_CONTEXT
        ctx->pos = pos;
        rc = ll_dir_read(inode, op_data, ctx);
index edebe5d..dc3b644 100644 (file)
@@ -524,7 +524,7 @@ struct ll_sb_info {
         /* =0 - hold lock over whole read/write
          * >0 - max. chunk to be read/written w/o lock re-acquiring */
         unsigned long             ll_max_rw_chunk;
-        unsigned int              ll_md_brw_size; /* used by readdir */
+       unsigned int              ll_md_brw_pages; /* readdir pages per RPC */
 
         struct lu_site           *ll_site;
         struct cl_device         *ll_cl;
index 3aa25aa..30e16fc 100644 (file)
@@ -378,9 +378,9 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
                 sbi->ll_flags |= LL_SBI_64BIT_HASH;
 
        if (data->ocd_connect_flags & OBD_CONNECT_BRW_SIZE)
-               sbi->ll_md_brw_size = data->ocd_brw_size;
+               sbi->ll_md_brw_pages = data->ocd_brw_size >> PAGE_CACHE_SHIFT;
        else
-               sbi->ll_md_brw_size = PAGE_CACHE_SIZE;
+               sbi->ll_md_brw_pages = 1;
 
        if (data->ocd_connect_flags & OBD_CONNECT_LAYOUTLOCK)
                sbi->ll_flags |= LL_SBI_LAYOUT_LOCK;
index be04a1c..d942d90 100644 (file)
@@ -254,8 +254,7 @@ static int ll_get_name(struct dentry *dentry, char *name,
                GOTO(out, rc = PTR_ERR(op_data));
 
        op_data->op_hash_offset = 0;
-       op_data->op_max_pages =
-               ll_i2sbi(dir)->ll_md_brw_size >> PAGE_CACHE_SHIFT;
+       op_data->op_max_pages = ll_i2sbi(dir)->ll_md_brw_pages;
        mutex_lock(&dir->i_mutex);
 #ifdef HAVE_DIR_CONTEXT
        rc = ll_dir_read(dir, op_data, &lgd.ctx);
index 88a9bee..591958d 100644 (file)
@@ -1090,8 +1090,7 @@ static int ll_statahead_thread(void *arg)
                RETURN(PTR_ERR(op_data));
 
        op_data->op_hash_offset = 0;
-       op_data->op_max_pages =
-               ll_i2sbi(dir)->ll_md_brw_size >> PAGE_CACHE_SHIFT;
+       op_data->op_max_pages = ll_i2sbi(dir)->ll_md_brw_pages;
 
        if (sbi->ll_flags & LL_SBI_AGL_ENABLED)
                ll_start_agl(parent, sai);
@@ -1365,8 +1364,7 @@ static int is_first_dirent(struct inode *dir, struct dentry *dentry)
         */
        op_data->op_stripe_offset = 0;
        op_data->op_hash_offset = 0;
-       op_data->op_max_pages =
-               ll_i2sbi(dir)->ll_md_brw_size >> PAGE_CACHE_SHIFT;
+       op_data->op_max_pages = ll_i2sbi(dir)->ll_md_brw_pages;
 
        for (ent = ll_dir_entry_start(dir, op_data, &page);
             ent != NULL && !IS_ERR(ent);