Whamcloud - gitweb
LU-6496 ptlrpc: Fix wrong code indentation in plain_authorize
[fs/lustre-release.git] / lustre / ptlrpc / nrs_tbf.c
index 6c7b5dc..d8c6a31 100644 (file)
@@ -22,6 +22,7 @@
 /*
  * Copyright (C) 2013 DataDirect Networks, Inc.
  *
+ * Copyright (c) 2014, Intel Corporation.
  */
 /*
  * lustre/ptlrpc/nrs_tbf.c
 
 #define NRS_POL_NAME_TBF       "tbf"
 
-int tbf_jobid_cache_size = 8192;
+static int tbf_jobid_cache_size = 8192;
 CFS_MODULE_PARM(tbf_jobid_cache_size, "i", int, 0644,
                "The size of jobid cache");
 
-int tbf_rate = 10000;
+static int tbf_rate = 10000;
 CFS_MODULE_PARM(tbf_rate, "i", int, 0644,
                "Default rate limit in RPCs/s");
 
-int tbf_depth = 3;
+static int tbf_depth = 3;
 CFS_MODULE_PARM(tbf_depth, "i", int, 0644,
                "How many tokens that a client can save up");
 
@@ -841,7 +842,7 @@ static void nrs_tbf_jobid_rule_fini(struct nrs_tbf_rule *rule)
        OBD_FREE(rule->tr_jobids_str, strlen(rule->tr_jobids_str) + 1);
 }
 
-struct nrs_tbf_ops nrs_tbf_jobid_ops = {
+static struct nrs_tbf_ops nrs_tbf_jobid_ops = {
        .o_name = NRS_TBF_TYPE_JOBID,
        .o_startup = nrs_tbf_jobid_startup,
        .o_cli_find = nrs_tbf_jobid_cli_find,
@@ -1073,7 +1074,7 @@ static int nrs_tbf_nid_parse(struct nrs_tbf_cmd *cmd, const char *id)
        return 0;
 }
 
-struct nrs_tbf_ops nrs_tbf_nid_ops = {
+static struct nrs_tbf_ops nrs_tbf_nid_ops = {
        .o_name = NRS_TBF_TYPE_NID,
        .o_startup = nrs_tbf_nid_startup,
        .o_cli_find = nrs_tbf_nid_cli_find,
@@ -1202,8 +1203,9 @@ static void nrs_tbf_stop(struct ptlrpc_nrs_policy *policy)
  * \retval 0   operation carried out successfully
  * \retval -ve error
  */
-int nrs_tbf_ctl(struct ptlrpc_nrs_policy *policy, enum ptlrpc_nrs_ctl opc,
-               void *arg)
+static int nrs_tbf_ctl(struct ptlrpc_nrs_policy *policy,
+                      enum ptlrpc_nrs_ctl opc,
+                      void *arg)
 {
        int rc = 0;
        ENTRY;
@@ -1547,7 +1549,7 @@ static void nrs_tbf_req_stop(struct ptlrpc_nrs_policy *policy,
               nrq->nr_u.tbf.tr_sequence);
 }
 
-#ifdef LPROCFS
+#ifdef CONFIG_PROC_FS
 
 /**
  * lprocfs interface
@@ -1823,9 +1825,9 @@ LPROC_SEQ_FOPS(ptlrpc_lprocfs_nrs_tbf_rule);
  * \retval 0   success
  * \retval != 0        error
  */
-int nrs_tbf_lprocfs_init(struct ptlrpc_service *svc)
+static int nrs_tbf_lprocfs_init(struct ptlrpc_service *svc)
 {
-       struct lprocfs_seq_vars nrs_tbf_lprocfs_vars[] = {
+       struct lprocfs_vars nrs_tbf_lprocfs_vars[] = {
                { .name         = "nrs_tbf_rule",
                  .fops         = &ptlrpc_lprocfs_nrs_tbf_rule_fops,
                  .data = svc },
@@ -1835,8 +1837,7 @@ int nrs_tbf_lprocfs_init(struct ptlrpc_service *svc)
        if (svc->srv_procroot == NULL)
                return 0;
 
-       return lprocfs_seq_add_vars(svc->srv_procroot, nrs_tbf_lprocfs_vars,
-                                   NULL);
+       return lprocfs_add_vars(svc->srv_procroot, nrs_tbf_lprocfs_vars, NULL);
 }
 
 /**
@@ -1844,7 +1845,7 @@ int nrs_tbf_lprocfs_init(struct ptlrpc_service *svc)
  *
  * \param[in] svc the service
  */
-void nrs_tbf_lprocfs_fini(struct ptlrpc_service *svc)
+static void nrs_tbf_lprocfs_fini(struct ptlrpc_service *svc)
 {
        if (svc->srv_procroot == NULL)
                return;
@@ -1852,7 +1853,7 @@ void nrs_tbf_lprocfs_fini(struct ptlrpc_service *svc)
        lprocfs_remove_proc_entry("nrs_tbf_rule", svc->srv_procroot);
 }
 
-#endif /* LPROCFS */
+#endif /* CONFIG_PROC_FS */
 
 /**
  * TBF policy operations
@@ -1867,7 +1868,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 LPROCFS
+#ifdef CONFIG_PROC_FS
        .op_lprocfs_init        = nrs_tbf_lprocfs_init,
        .op_lprocfs_fini        = nrs_tbf_lprocfs_fini,
 #endif