Whamcloud - gitweb
LU-4423 lustre: don't declare extern variables in C files.
[fs/lustre-release.git] / lustre / ptlrpc / nrs_tbf.c
index fdf409e..371c784 100644 (file)
@@ -1486,8 +1486,6 @@ static struct req_format *intent_req_fmt(__u32 it_opc)
                return &RQF_LDLM_INTENT_OPEN;
        else if (it_opc & (IT_GETATTR | IT_LOOKUP))
                return &RQF_LDLM_INTENT_GETATTR;
-       else if (it_opc & IT_UNLINK)
-               return &RQF_LDLM_INTENT_UNLINK;
        else if (it_opc & IT_GETXATTR)
                return &RQF_LDLM_INTENT_GETXATTR;
        else if (it_opc & (IT_GLIMPSE | IT_BRW))
@@ -3268,10 +3266,8 @@ static void nrs_tbf_req_stop(struct ptlrpc_nrs_policy *policy,
               nrq->nr_u.tbf.tr_sequence);
 }
 
-#ifdef CONFIG_PROC_FS
-
 /**
- * lprocfs interface
+ * debugfs interface
  */
 
 /**
@@ -3587,7 +3583,6 @@ nrs_tbf_type_flag(struct ptlrpc_service *svc, enum ptlrpc_nrs_queue_type queue)
        return type;
 }
 
-extern struct nrs_core nrs_core;
 #define LPROCFS_WR_NRS_TBF_MAX_CMD (4096)
 static ssize_t
 ptlrpc_lprocfs_nrs_tbf_rule_seq_write(struct file *file,
@@ -3659,7 +3654,8 @@ out_free_kernbuff:
 out:
        return rc ? rc : count;
 }
-LPROC_SEQ_FOPS(ptlrpc_lprocfs_nrs_tbf_rule);
+
+LDEBUGFS_SEQ_FOPS(ptlrpc_lprocfs_nrs_tbf_rule);
 
 /**
  * Initializes a TBF policy's lprocfs interface for service \a svc
@@ -3678,28 +3674,14 @@ static int nrs_tbf_lprocfs_init(struct ptlrpc_service *svc)
                { NULL }
        };
 
-       if (svc->srv_procroot == NULL)
+       if (IS_ERR_OR_NULL(svc->srv_debugfs_entry))
                return 0;
 
-       return lprocfs_add_vars(svc->srv_procroot, nrs_tbf_lprocfs_vars, NULL);
+       return ldebugfs_add_vars(svc->srv_debugfs_entry, nrs_tbf_lprocfs_vars,
+                                NULL);
 }
 
 /**
- * Cleans up a TBF policy's lprocfs interface for service \a svc
- *
- * \param[in] svc the service
- */
-static void nrs_tbf_lprocfs_fini(struct ptlrpc_service *svc)
-{
-       if (svc->srv_procroot == NULL)
-               return;
-
-       lprocfs_remove_proc_entry("nrs_tbf_rule", svc->srv_procroot);
-}
-
-#endif /* CONFIG_PROC_FS */
-
-/**
  * TBF policy operations
  */
 static const struct ptlrpc_nrs_pol_ops nrs_tbf_ops = {
@@ -3712,10 +3694,7 @@ static const struct ptlrpc_nrs_pol_ops nrs_tbf_ops = {
        .op_req_enqueue         = nrs_tbf_req_add,
        .op_req_dequeue         = nrs_tbf_req_del,
        .op_req_stop            = nrs_tbf_req_stop,
-#ifdef CONFIG_PROC_FS
        .op_lprocfs_init        = nrs_tbf_lprocfs_init,
-       .op_lprocfs_fini        = nrs_tbf_lprocfs_fini,
-#endif
 };
 
 /**