Whamcloud - gitweb
LU-5162 mdc: Add exception entry check for radix_tree
[fs/lustre-release.git] / lustre / ptlrpc / nrs_tbf.c
index eb5d955..2dedef3 100644 (file)
@@ -87,9 +87,9 @@ static enum hrtimer_restart nrs_tbf_timer_cb(struct hrtimer *timer)
 
 static void nrs_tbf_rule_fini(struct nrs_tbf_rule *rule)
 {
-       LASSERT(cfs_atomic_read(&rule->tr_ref) == 0);
-       LASSERT(cfs_list_empty(&rule->tr_cli_list));
-       LASSERT(cfs_list_empty(&rule->tr_linkage));
+       LASSERT(atomic_read(&rule->tr_ref) == 0);
+       LASSERT(list_empty(&rule->tr_cli_list));
+       LASSERT(list_empty(&rule->tr_linkage));
 
        rule->tr_head->th_ops->o_rule_fini(rule);
        OBD_FREE_PTR(rule);
@@ -103,7 +103,7 @@ static void nrs_tbf_rule_fini(struct nrs_tbf_rule *rule)
  */
 static void nrs_tbf_rule_put(struct nrs_tbf_rule *rule)
 {
-       if (cfs_atomic_dec_and_test(&rule->tr_ref))
+       if (atomic_dec_and_test(&rule->tr_ref))
                nrs_tbf_rule_fini(rule);
 }
 
@@ -112,7 +112,7 @@ static void nrs_tbf_rule_put(struct nrs_tbf_rule *rule)
  */
 static inline void nrs_tbf_rule_get(struct nrs_tbf_rule *rule)
 {
-       cfs_atomic_inc(&rule->tr_ref);
+       atomic_inc(&rule->tr_ref);
 }
 
 static void
@@ -137,7 +137,7 @@ nrs_tbf_cli_reset_value(struct nrs_tbf_head *head,
        cli->tc_depth = rule->tr_depth;
        cli->tc_ntoken = rule->tr_depth;
        cli->tc_check_time = ktime_to_ns(ktime_get());
-       cli->tc_rule_sequence = cfs_atomic_read(&head->th_rule_sequence);
+       cli->tc_rule_sequence = atomic_read(&head->th_rule_sequence);
        cli->tc_rule_generation = rule->tr_generation;
 
        if (cli->tc_in_heap)
@@ -150,26 +150,26 @@ nrs_tbf_cli_reset(struct nrs_tbf_head *head,
                  struct nrs_tbf_rule *rule,
                  struct nrs_tbf_client *cli)
 {
-       if (!cfs_list_empty(&cli->tc_linkage)) {
+       if (!list_empty(&cli->tc_linkage)) {
                LASSERT(rule != cli->tc_rule);
                nrs_tbf_cli_rule_put(cli);
        }
        LASSERT(cli->tc_rule == NULL);
-       LASSERT(cfs_list_empty(&cli->tc_linkage));
+       LASSERT(list_empty(&cli->tc_linkage));
        /* Rule's ref is added before called */
        cli->tc_rule = rule;
-       cfs_list_add_tail(&cli->tc_linkage, &rule->tr_cli_list);
+       list_add_tail(&cli->tc_linkage, &rule->tr_cli_list);
        nrs_tbf_cli_reset_value(head, cli);
 }
 
 static int
-nrs_tbf_rule_dump(struct nrs_tbf_rule *rule, char *buff, int length)
+nrs_tbf_rule_dump(struct nrs_tbf_rule *rule, struct seq_file *m)
 {
-       return rule->tr_head->th_ops->o_rule_dump(rule, buff, length);
+       return rule->tr_head->th_ops->o_rule_dump(rule, m);
 }
 
 static int
-nrs_tbf_rule_dump_all(struct nrs_tbf_head *head, char *buff, int length)
+nrs_tbf_rule_dump_all(struct nrs_tbf_head *head, struct seq_file *m)
 {
        struct nrs_tbf_rule *rule;
        int rc = 0;
@@ -177,9 +177,13 @@ nrs_tbf_rule_dump_all(struct nrs_tbf_head *head, char *buff, int length)
        LASSERT(head != NULL);
        spin_lock(&head->th_rule_lock);
        /* List the rules from newest to oldest */
-       cfs_list_for_each_entry(rule, &head->th_list, tr_linkage) {
+       list_for_each_entry(rule, &head->th_list, tr_linkage) {
                LASSERT((rule->tr_flags & NTRS_STOPPING) == 0);
-               rc += nrs_tbf_rule_dump(rule, buff + rc, length - rc);
+               rc = nrs_tbf_rule_dump(rule, m);
+               if (rc) {
+                       rc = -ENOSPC;
+                       break;
+               }
        }
        spin_unlock(&head->th_rule_lock);
 
@@ -252,7 +256,7 @@ nrs_tbf_cli_init(struct nrs_tbf_head *head,
        head->th_ops->o_cli_init(cli, req);
        CFS_INIT_LIST_HEAD(&cli->tc_list);
        CFS_INIT_LIST_HEAD(&cli->tc_linkage);
-       cfs_atomic_set(&cli->tc_ref, 1);
+       atomic_set(&cli->tc_ref, 1);
        rule = nrs_tbf_rule_match(head, cli);
        nrs_tbf_cli_reset(head, rule, cli);
 }
@@ -262,7 +266,7 @@ nrs_tbf_cli_fini(struct nrs_tbf_client *cli)
 {
        LASSERT(cfs_list_empty(&cli->tc_list));
        LASSERT(!cli->tc_in_heap);
-       LASSERT(cfs_atomic_read(&cli->tc_ref) == 0);
+       LASSERT(atomic_read(&cli->tc_ref) == 0);
        nrs_tbf_cli_rule_put(cli);
        OBD_FREE_PTR(cli);
 }
@@ -289,7 +293,7 @@ nrs_tbf_rule_start(struct ptlrpc_nrs_policy *policy,
        rule->tr_rpc_rate = start->tc_rpc_rate;
        rule->tr_nsecs = NSEC_PER_SEC / rule->tr_rpc_rate;
        rule->tr_depth = tbf_depth;
-       cfs_atomic_set(&rule->tr_ref, 1);
+       atomic_set(&rule->tr_ref, 1);
        CFS_INIT_LIST_HEAD(&rule->tr_cli_list);
        CFS_INIT_LIST_HEAD(&rule->tr_nids);
 
@@ -310,7 +314,7 @@ nrs_tbf_rule_start(struct ptlrpc_nrs_policy *policy,
        cfs_list_add(&rule->tr_linkage, &head->th_list);
        rule->tr_head = head;
        spin_unlock(&head->th_rule_lock);
-       cfs_atomic_inc(&head->th_rule_sequence);
+       atomic_inc(&head->th_rule_sequence);
        if (start->tc_rule_flags & NTRS_DEFAULT) {
                rule->tr_flags |= NTRS_DEFAULT;
                LASSERT(head->th_rule == NULL);
@@ -327,7 +331,7 @@ nrs_tbf_rule_change(struct ptlrpc_nrs_policy *policy,
 {
        struct nrs_tbf_rule *rule;
 
-       LASSERT(spin_is_locked(&policy->pol_nrs->nrs_lock));
+       assert_spin_locked(&policy->pol_nrs->nrs_lock);
 
        rule = nrs_tbf_rule_find(head, change->tc_name);
        if (rule == NULL)
@@ -348,7 +352,7 @@ nrs_tbf_rule_stop(struct ptlrpc_nrs_policy *policy,
 {
        struct nrs_tbf_rule *rule;
 
-       LASSERT(spin_is_locked(&policy->pol_nrs->nrs_lock));
+       assert_spin_locked(&policy->pol_nrs->nrs_lock);
 
        if (strcmp(stop->tc_name, NRS_TBF_DEFAULT_RULE) == 0)
                return -EPERM;
@@ -372,7 +376,7 @@ nrs_tbf_command(struct ptlrpc_nrs_policy *policy,
 {
        int rc;
 
-       LASSERT(spin_is_locked(&policy->pol_nrs->nrs_lock));
+       assert_spin_locked(&policy->pol_nrs->nrs_lock);
 
        switch (cmd->tc_cmd) {
        case NRS_CTL_TBF_START_RULE:
@@ -472,7 +476,7 @@ static void nrs_tbf_jobid_hop_get(cfs_hash_t *hs, cfs_hlist_node_t *hnode)
                                                     struct nrs_tbf_client,
                                                     tc_hnode);
 
-       cfs_atomic_inc(&cli->tc_ref);
+       atomic_inc(&cli->tc_ref);
 }
 
 static void nrs_tbf_jobid_hop_put(cfs_hash_t *hs, cfs_hlist_node_t *hnode)
@@ -481,7 +485,7 @@ static void nrs_tbf_jobid_hop_put(cfs_hash_t *hs, cfs_hlist_node_t *hnode)
                                                     struct nrs_tbf_client,
                                                     tc_hnode);
 
-       cfs_atomic_dec(&cli->tc_ref);
+       atomic_dec(&cli->tc_ref);
 }
 
 static void nrs_tbf_jobid_hop_exit(cfs_hash_t *hs, cfs_hlist_node_t *hnode)
@@ -491,7 +495,7 @@ static void nrs_tbf_jobid_hop_exit(cfs_hash_t *hs, cfs_hlist_node_t *hnode)
                                                     struct nrs_tbf_client,
                                                     tc_hnode);
 
-       LASSERT(cfs_atomic_read(&cli->tc_ref) == 0);
+       LASSERT(atomic_read(&cli->tc_ref) == 0);
        nrs_tbf_cli_fini(cli);
 }
 
@@ -601,7 +605,7 @@ nrs_tbf_jobid_cli_put(struct nrs_tbf_head *head,
                cli = cfs_list_entry(bkt->ntb_lru.next,
                                     struct nrs_tbf_client,
                                     tc_lru);
-               LASSERT(cfs_atomic_read(&cli->tc_ref) == 0);
+               LASSERT(atomic_read(&cli->tc_ref) == 0);
                cfs_hash_bd_del_locked(hs, &bd, &cli->tc_hnode);
                cfs_list_move(&cli->tc_lru, &zombies);
        }
@@ -816,13 +820,11 @@ static int nrs_tbf_jobid_rule_init(struct ptlrpc_nrs_policy *policy,
 }
 
 static int
-nrs_tbf_jobid_rule_dump(struct nrs_tbf_rule *rule, char *buff, int length)
+nrs_tbf_jobid_rule_dump(struct nrs_tbf_rule *rule, struct seq_file *m)
 {
-       return snprintf(buff, length, "%s {%s} %llu, ref %d\n",
-                       rule->tr_name,
-                       rule->tr_jobids_str,
-                       rule->tr_rpc_rate,
-                       cfs_atomic_read(&rule->tr_ref) - 1);
+       return seq_printf(m, "%s {%s} %llu, ref %d\n", rule->tr_name,
+                         rule->tr_jobids_str, rule->tr_rpc_rate,
+                         atomic_read(&rule->tr_ref) - 1);
 }
 
 static int
@@ -898,7 +900,7 @@ static void nrs_tbf_nid_hop_get(cfs_hash_t *hs, cfs_hlist_node_t *hnode)
                                                     struct nrs_tbf_client,
                                                     tc_hnode);
 
-       cfs_atomic_inc(&cli->tc_ref);
+       atomic_inc(&cli->tc_ref);
 }
 
 static void nrs_tbf_nid_hop_put(cfs_hash_t *hs, cfs_hlist_node_t *hnode)
@@ -907,7 +909,7 @@ static void nrs_tbf_nid_hop_put(cfs_hash_t *hs, cfs_hlist_node_t *hnode)
                                                     struct nrs_tbf_client,
                                                     tc_hnode);
 
-       cfs_atomic_dec(&cli->tc_ref);
+       atomic_dec(&cli->tc_ref);
 }
 
 static void nrs_tbf_nid_hop_exit(cfs_hash_t *hs, cfs_hlist_node_t *hnode)
@@ -916,9 +918,9 @@ static void nrs_tbf_nid_hop_exit(cfs_hash_t *hs, cfs_hlist_node_t *hnode)
                                                     struct nrs_tbf_client,
                                                     tc_hnode);
 
-       LASSERTF(cfs_atomic_read(&cli->tc_ref) == 0,
+       LASSERTF(atomic_read(&cli->tc_ref) == 0,
                 "Busy TBF object from client with NID %s, with %d refs\n",
-                libcfs_nid2str(cli->tc_nid), cfs_atomic_read(&cli->tc_ref));
+                libcfs_nid2str(cli->tc_nid), atomic_read(&cli->tc_ref));
 
        nrs_tbf_cli_fini(cli);
 }
@@ -1023,13 +1025,11 @@ static int nrs_tbf_nid_rule_init(struct ptlrpc_nrs_policy *policy,
 }
 
 static int
-nrs_tbf_nid_rule_dump(struct nrs_tbf_rule *rule, char *buff, int length)
+nrs_tbf_nid_rule_dump(struct nrs_tbf_rule *rule, struct seq_file *m)
 {
-       return snprintf(buff, length, "%s {%s} %llu, ref %d\n",
-                       rule->tr_name,
-                       rule->tr_nids_str,
-                       rule->tr_rpc_rate,
-                       cfs_atomic_read(&rule->tr_ref) - 1);
+       return seq_printf(m, "%s {%s} %llu, ref %d\n", rule->tr_name,
+                         rule->tr_nids_str, rule->tr_rpc_rate,
+                         atomic_read(&rule->tr_ref) - 1);
 }
 
 static int
@@ -1135,7 +1135,7 @@ static int nrs_tbf_start(struct ptlrpc_nrs_policy *policy, char *arg)
        if (head->th_binheap == NULL)
                GOTO(out_free_head, rc = -ENOMEM);
 
-       cfs_atomic_set(&head->th_rule_sequence, 0);
+       atomic_set(&head->th_rule_sequence, 0);
        spin_lock_init(&head->th_rule_lock);
        CFS_INIT_LIST_HEAD(&head->th_list);
        hrtimer_init(&head->th_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
@@ -1197,8 +1197,8 @@ static void nrs_tbf_stop(struct ptlrpc_nrs_policy *policy)
  * \param[in]    opc    the opcode
  * \param[in,out] arg   used for passing parameters and information
  *
- * \pre spin_is_locked(&policy->pol_nrs->->nrs_lock)
- * \post spin_is_locked(&policy->pol_nrs->->nrs_lock)
+ * \pre assert_spin_locked(&policy->pol_nrs->->nrs_lock)
+ * \post assert_spin_locked(&policy->pol_nrs->->nrs_lock)
  *
  * \retval 0   operation carried out successfully
  * \retval -ve error
@@ -1209,9 +1209,9 @@ int nrs_tbf_ctl(struct ptlrpc_nrs_policy *policy, enum ptlrpc_nrs_ctl opc,
        int rc = 0;
        ENTRY;
 
-       LASSERT(spin_is_locked(&policy->pol_nrs->nrs_lock));
+       assert_spin_locked(&policy->pol_nrs->nrs_lock);
 
-       switch (opc) {
+       switch ((enum nrs_ctl_tbf)opc) {
        default:
                RETURN(-EINVAL);
 
@@ -1220,26 +1220,13 @@ int nrs_tbf_ctl(struct ptlrpc_nrs_policy *policy, enum ptlrpc_nrs_ctl opc,
         */
        case NRS_CTL_TBF_RD_RULE: {
                struct nrs_tbf_head *head = policy->pol_private;
+               struct seq_file *m = (struct seq_file *) arg;
                struct ptlrpc_service_part *svcpt;
-               struct nrs_tbf_dump *dump;
-               int length;
-
-               dump = (struct nrs_tbf_dump *)arg;
 
                svcpt = policy->pol_nrs->nrs_svcpt;
-               length = snprintf(dump->td_buff, dump->td_size,
-                                 "CPT %d:\n",
-                                 svcpt->scp_cpt);
-               dump->td_length += length;
-               dump->td_buff += length;
-               dump->td_size -= length;
-
-               length = nrs_tbf_rule_dump_all(head,
-                                              dump->td_buff,
-                                              dump->td_size);
-               dump->td_length += length;
-               dump->td_buff += length;
-               dump->td_size -= length;
+               seq_printf(m, "CPT %d:\n", svcpt->scp_cpt);
+
+               rc = nrs_tbf_rule_dump_all(head, m);
                }
                break;
 
@@ -1297,7 +1284,7 @@ static int nrs_tbf_res_get(struct ptlrpc_nrs_policy *policy,
                spin_lock(&policy->pol_nrs->nrs_svcpt->scp_req_lock);
                LASSERT(cli->tc_rule);
                if (cli->tc_rule_sequence !=
-                   cfs_atomic_read(&head->th_rule_sequence) ||
+                   atomic_read(&head->th_rule_sequence) ||
                    cli->tc_rule->tr_flags & NTRS_STOPPING) {
                        struct nrs_tbf_rule *rule;
 
@@ -1321,7 +1308,7 @@ static int nrs_tbf_res_get(struct ptlrpc_nrs_policy *policy,
        nrs_tbf_cli_init(head, cli, req);
        tmp = head->th_ops->o_cli_findadd(head, cli);
        if (tmp != cli) {
-               cfs_atomic_dec(&cli->tc_ref);
+               atomic_dec(&cli->tc_ref);
                nrs_tbf_cli_fini(cli);
                cli = tmp;
        }
@@ -1382,7 +1369,7 @@ struct ptlrpc_nrs_request *nrs_tbf_req_get(struct ptlrpc_nrs_policy *policy,
        struct nrs_tbf_client     *cli;
        cfs_binheap_node_t        *node;
 
-       LASSERT(spin_is_locked(&policy->pol_nrs->nrs_svcpt->scp_req_lock));
+       assert_spin_locked(&policy->pol_nrs->nrs_svcpt->scp_req_lock);
 
        if (!peek && policy->pol_nrs->nrs_throttling)
                return NULL;
@@ -1469,7 +1456,7 @@ static int nrs_tbf_req_add(struct ptlrpc_nrs_policy *policy,
        struct nrs_tbf_client *cli;
        int                    rc = 0;
 
-       LASSERT(spin_is_locked(&policy->pol_nrs->nrs_svcpt->scp_req_lock));
+       assert_spin_locked(&policy->pol_nrs->nrs_svcpt->scp_req_lock);
 
        cli = container_of(nrs_request_resource(nrq),
                           struct nrs_tbf_client, tc_res);
@@ -1519,7 +1506,7 @@ static void nrs_tbf_req_del(struct ptlrpc_nrs_policy *policy,
        struct nrs_tbf_head   *head;
        struct nrs_tbf_client *cli;
 
-       LASSERT(spin_is_locked(&policy->pol_nrs->nrs_svcpt->scp_req_lock));
+       assert_spin_locked(&policy->pol_nrs->nrs_svcpt->scp_req_lock);
 
        cli = container_of(nrs_request_resource(nrq),
                           struct nrs_tbf_client, tc_res);
@@ -1554,7 +1541,7 @@ static void nrs_tbf_req_stop(struct ptlrpc_nrs_policy *policy,
        struct ptlrpc_request *req = container_of(nrq, struct ptlrpc_request,
                                                  rq_nrq);
 
-       LASSERT(spin_is_locked(&policy->pol_nrs->nrs_svcpt->scp_req_lock));
+       assert_spin_locked(&policy->pol_nrs->nrs_svcpt->scp_req_lock);
 
        CDEBUG(D_RPCTRACE, "NRS stop %s request from %s, seq: "LPU64"\n",
               policy->pol_desc->pd_name, libcfs_id2str(req->rq_peer),
@@ -1572,31 +1559,23 @@ static void nrs_tbf_req_stop(struct ptlrpc_nrs_policy *policy,
  */
 #define LPROCFS_NRS_RATE_MAX           65535
 
-static int ptlrpc_lprocfs_rd_nrs_tbf_rule(char *page, char **start,
-                                          off_t off, int count, int *eof,
-                                          void *data)
+static int
+ptlrpc_lprocfs_nrs_tbf_rule_seq_show(struct seq_file *m, void *data)
 {
-       struct ptlrpc_service       *svc = data;
+       struct ptlrpc_service       *svc = m->private;
        int                          rc;
-       int                          rc2;
-       struct nrs_tbf_dump          dump;
 
-       rc2 = snprintf(page, count, "regular_requests:\n");
+       seq_printf(m, "regular_requests:\n");
        /**
         * Perform two separate calls to this as only one of the NRS heads'
         * policies may be in the ptlrpc_nrs_pol_state::NRS_POL_STATE_STARTED or
         * ptlrpc_nrs_pol_state::NRS_POL_STATE_STOPPING state.
         */
-       dump.td_length = 0;
-       dump.td_buff = page + rc2;
-       dump.td_size = count - rc2;
        rc = ptlrpc_nrs_policy_control(svc, PTLRPC_NRS_QUEUE_REG,
                                       NRS_POL_NAME_TBF,
                                       NRS_CTL_TBF_RD_RULE,
-                                      false, &dump);
+                                      false, m);
        if (rc == 0) {
-               *eof = 1;
-               rc2 += dump.td_length;
                /**
                 * Ignore -ENODEV as the regular NRS head's policy may be in the
                 * ptlrpc_nrs_pol_state::NRS_POL_STATE_STOPPED state.
@@ -1608,17 +1587,12 @@ static int ptlrpc_lprocfs_rd_nrs_tbf_rule(char *page, char **start,
        if (!nrs_svc_has_hp(svc))
                goto no_hp;
 
-       rc2 += snprintf(page + rc2, count - rc2, "high_priority_requests:\n");
-       dump.td_length = 0;
-       dump.td_buff = page + rc2;
-       dump.td_size = count - rc2;
+       seq_printf(m, "high_priority_requests:\n");
        rc = ptlrpc_nrs_policy_control(svc, PTLRPC_NRS_QUEUE_HP,
                                       NRS_POL_NAME_TBF,
                                       NRS_CTL_TBF_RD_RULE,
-                                      false, &dump);
+                                      false, m);
        if (rc == 0) {
-               *eof = 1;
-               rc2 += dump.td_length;
                /**
                 * Ignore -ENODEV as the high priority NRS head's policy may be
                 * in the ptlrpc_nrs_pol_state::NRS_POL_STATE_STOPPED state.
@@ -1629,7 +1603,7 @@ static int ptlrpc_lprocfs_rd_nrs_tbf_rule(char *page, char **start,
 
 no_hp:
 
-       return rc2 ? : rc;
+       return rc;
 }
 
 static int nrs_tbf_id_parse(struct nrs_tbf_cmd *cmd, char **val)
@@ -1762,11 +1736,12 @@ out:
 
 extern struct nrs_core nrs_core;
 #define LPROCFS_WR_NRS_TBF_MAX_CMD (4096)
-static int ptlrpc_lprocfs_wr_nrs_tbf_rule(struct file *file,
-                                         const char *buffer,
-                                         unsigned long count, void *data)
+static ssize_t
+ptlrpc_lprocfs_nrs_tbf_rule_seq_write(struct file *file, const char *buffer,
+                                     size_t count, loff_t *off)
 {
-       struct ptlrpc_service     *svc = data;
+       struct seq_file           *m = file->private_data;
+       struct ptlrpc_service     *svc = m->private;
        char                      *kernbuf;
        char                      *val;
        int                        rc;
@@ -1830,7 +1805,7 @@ out_free_kernbuff:
 out:
        return rc ? rc : count;
 }
-
+LPROC_SEQ_FOPS(ptlrpc_lprocfs_nrs_tbf_rule);
 
 /**
  * Initializes a TBF policy's lprocfs interface for service \a svc
@@ -1842,11 +1817,9 @@ out:
  */
 int nrs_tbf_lprocfs_init(struct ptlrpc_service *svc)
 {
-       int     rc;
-       struct lprocfs_vars nrs_tbf_lprocfs_vars[] = {
+       struct lprocfs_seq_vars nrs_tbf_lprocfs_vars[] = {
                { .name         = "nrs_tbf_rule",
-                 .read_fptr    = ptlrpc_lprocfs_rd_nrs_tbf_rule,
-                 .write_fptr   = ptlrpc_lprocfs_wr_nrs_tbf_rule,
+                 .fops         = &ptlrpc_lprocfs_nrs_tbf_rule_fops,
                  .data = svc },
                { NULL }
        };
@@ -1854,9 +1827,8 @@ int nrs_tbf_lprocfs_init(struct ptlrpc_service *svc)
        if (svc->srv_procroot == NULL)
                return 0;
 
-       rc = lprocfs_add_vars(svc->srv_procroot, nrs_tbf_lprocfs_vars, NULL);
-
-       return rc;
+       return lprocfs_seq_add_vars(svc->srv_procroot, nrs_tbf_lprocfs_vars,
+                                   NULL);
 }
 
 /**
@@ -1869,7 +1841,7 @@ void nrs_tbf_lprocfs_fini(struct ptlrpc_service *svc)
        if (svc->srv_procroot == NULL)
                return;
 
-       lprocfs_remove_proc_entry("nrs_tbf_quantum", svc->srv_procroot);
+       lprocfs_remove_proc_entry("nrs_tbf_rule", svc->srv_procroot);
 }
 
 #endif /* LPROCFS */