Whamcloud - gitweb
LU-4748 test: get one single qos_threshold_rr number
[fs/lustre-release.git] / lustre / fid / lproc_fid.c
index 5679366..3b9d170 100644 (file)
@@ -203,9 +203,12 @@ LPROC_SEQ_FOPS(lprocfs_server_fid_width);
 LPROC_SEQ_FOPS_RO(lprocfs_server_fid_server);
 
 struct lprocfs_seq_vars seq_server_proc_list[] = {
-       { "space",      &lprocfs_server_fid_space_fops },
-       { "width",      &lprocfs_server_fid_width_fops },
-       { "server",     &lprocfs_server_fid_server_fops },
+       { .name =       "space",
+         .fops =       &lprocfs_server_fid_space_fops  },
+       { .name =       "width",
+         .fops =       &lprocfs_server_fid_width_fops  },
+       { .name =       "server",
+         .fops =       &lprocfs_server_fid_server_fops },
        { NULL }
 };
 
@@ -228,6 +231,8 @@ static void *fldb_seq_start(struct seq_file *p, loff_t *pos)
        struct lu_server_fld    *fld;
        struct dt_object        *obj;
        const struct dt_it_ops  *iops;
+       struct dt_key           *key;
+       int                     rc;
 
        if (param == NULL || param->fsp_stop)
                return NULL;
@@ -237,9 +242,16 @@ static void *fldb_seq_start(struct seq_file *p, loff_t *pos)
        LASSERT(obj != NULL);
        iops = &obj->do_index_ops->dio_it;
 
-       iops->load(&param->fsp_env, param->fsp_it, *pos);
+       rc = iops->load(&param->fsp_env, param->fsp_it, *pos);
+       if (rc <= 0)
+               return NULL;
+
+       key = iops->key(&param->fsp_env, param->fsp_it);
+       if (IS_ERR(key))
+               return NULL;
+
+       *pos = be64_to_cpu(*(__u64 *)key);
 
-       *pos = be64_to_cpu(*(__u64 *)iops->key(&param->fsp_env, param->fsp_it));
        return param;
 }
 
@@ -614,10 +626,14 @@ LPROC_SEQ_FOPS_RO(lprocfs_client_fid_server);
 LPROC_SEQ_FOPS_RO(lprocfs_client_fid_fid);
 
 struct lprocfs_seq_vars seq_client_proc_list[] = {
-       { "space",      &lprocfs_client_fid_space_fops },
-       { "width",      &lprocfs_client_fid_width_fops },
-       { "server",     &lprocfs_client_fid_server_fops },
-       { "fid",        &lprocfs_client_fid_fid_fops },
+       { .name =       "space",
+         .fops =       &lprocfs_client_fid_space_fops  },
+       { .name =       "width",
+         .fops =       &lprocfs_client_fid_width_fops  },
+       { .name =       "server",
+         .fops =       &lprocfs_client_fid_server_fops },
+       { .name =       "fid",
+         .fops =       &lprocfs_client_fid_fid_fops    },
        { NULL }
 };
 #endif