Whamcloud - gitweb
LU-10855 ptlrpc: remove obsolete OBD RPC opcodes
[fs/lustre-release.git] / lustre / ptlrpc / nrs_tbf.c
index 980cff4..182515c 100644 (file)
@@ -815,8 +815,7 @@ static int
 nrs_tbf_jobid_list_add(struct cfs_lstr *id, struct list_head *jobid_list)
 {
        struct nrs_tbf_jobid *jobid;
-       struct cfs_lstr res;
-       int rc;
+       char *ptr;
 
        OBD_ALLOC(jobid, sizeof(struct nrs_tbf_jobid));
        if (jobid == NULL)
@@ -829,8 +828,8 @@ nrs_tbf_jobid_list_add(struct cfs_lstr *id, struct list_head *jobid_list)
        }
 
        memcpy(jobid->tj_id, id->ls_str, id->ls_len);
-       rc = cfs_gettok(id, '*', &res);
-       if (rc == 0)
+       ptr = lprocfs_strnstr(id->ls_str, "*", id->ls_len);
+       if (ptr == NULL)
                jobid->tj_match_flag = NRS_TBF_MATCH_FULL;
        else
                jobid->tj_match_flag = NRS_TBF_MATCH_WILDCARD;
@@ -3269,10 +3268,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
  */
 
 /**
@@ -3660,7 +3657,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
@@ -3679,27 +3677,13 @@ 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);
-}
-
-/**
- * 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);
+       return ldebugfs_add_vars(svc->srv_debugfs_entry, nrs_tbf_lprocfs_vars,
+                                NULL);
 }
 
-#endif /* CONFIG_PROC_FS */
-
 /**
  * TBF policy operations
  */
@@ -3713,10 +3697,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
 };
 
 /**