Whamcloud - gitweb
LU-4017 quota: cleanup codes of quota for new type
[fs/lustre-release.git] / lustre / quota / qmt_pool.c
index b20658b..679ceeb 100644 (file)
@@ -163,7 +163,7 @@ static int qpi_state_seq_show(struct seq_file *m, void *data)
                seq_printf(m, "    %s:\n"
                           "        #slv: %d\n"
                           "        #lqe: %d\n",
-                          QTYPE_NAME(type),
+                          qtype_name(type),
                           pool->qpi_slv_nr[type],
                    atomic_read(&pool->qpi_site[type]->lqs_hash->hs_count));
 
@@ -542,9 +542,8 @@ int qmt_pool_prepare(const struct lu_env *env, struct qmt_device *qmt,
                                                          &qti->qti_fid, false);
                        if (IS_ERR(obj)) {
                                rc = PTR_ERR(obj);
-                               CERROR("%s: failed to create glb index copy for"
-                                      " %s type (%d)\n", qmt->qmt_svname,
-                                      QTYPE_NAME(qtype), rc);
+                               CERROR("%s: failed to create glb index copy for %s type: rc = %d\n",
+                                      qmt->qmt_svname, qtype_name(qtype), rc);
                                RETURN(rc);
                        }
 
@@ -561,19 +560,15 @@ int qmt_pool_prepare(const struct lu_env *env, struct qmt_device *qmt,
 
                                rc = lquota_disk_write_glb(env, obj, 0, rec);
                                if (rc) {
-                                       CERROR("%s: failed to set default "
-                                              "grace time for %s type (%d)\n",
-                                              qmt->qmt_svname,
-                                              QTYPE_NAME(qtype), rc);
+                                       CERROR("%s: failed to set default grace time for %s type: rc = %d\n",
+                                              qmt->qmt_svname, qtype_name(qtype), rc);
                                        RETURN(rc);
                                }
 
                                rc = lquota_disk_update_ver(env, dev, obj, 1);
                                if (rc) {
-                                       CERROR("%s: failed to set initial "
-                                              "version for %s type (%d)\n",
-                                              qmt->qmt_svname,
-                                              QTYPE_NAME(qtype), rc);
+                                       CERROR("%s: failed to set initial version for %s type: rc = %d\n",
+                                              qmt->qmt_svname, qtype_name(qtype), rc);
                                        RETURN(rc);
                                }
                        }
@@ -584,9 +579,8 @@ int qmt_pool_prepare(const struct lu_env *env, struct qmt_device *qmt,
                                                                  &qmt_lqe_ops);
                        if (IS_ERR(pool->qpi_site[qtype])) {
                                rc = PTR_ERR(pool->qpi_site[qtype]);
-                               CERROR("%s: failed to create site for %s type "
-                                      "(%d)\n", qmt->qmt_svname,
-                                      QTYPE_NAME(qtype), rc);
+                               CERROR("%s: failed to create site for %s type: rc = %d\n",
+                                      qmt->qmt_svname, qtype_name(qtype), rc);
                                RETURN(rc);
                        }
 
@@ -598,9 +592,8 @@ int qmt_pool_prepare(const struct lu_env *env, struct qmt_device *qmt,
                                                      qmt_slv_cnt,
                                                      &pool->qpi_slv_nr[qtype]);
                        if (rc) {
-                               CERROR("%s: failed to scan & count slave "
-                                      "indexes for %s type (%d)\n",
-                                      qmt->qmt_svname, QTYPE_NAME(qtype), rc);
+                               CERROR("%s: failed to scan & count slave indexes for %s type: rc = %d\n",
+                                      qmt->qmt_svname, qtype_name(qtype), rc);
                                RETURN(rc);
                        }
 
@@ -617,7 +610,8 @@ int qmt_pool_prepare(const struct lu_env *env, struct qmt_device *qmt,
 #ifdef CONFIG_PROC_FS
                        /* add procfs file to dump the global index, mostly for
                         * debugging purpose */
-                       sprintf(qti->qti_buf, "glb-%s", QTYPE_NAME(qtype));
+                       snprintf(qti->qti_buf, MTI_NAME_MAXLEN,
+                                "glb-%s", qtype_name(qtype));
                        rc = lprocfs_seq_create(pool->qpi_proc, qti->qti_buf,
                                                0444, &lprocfs_quota_seq_fops,
                                                obj);