X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fptlrpc%2Fnrs_tbf.c;h=94861726846f4be8d037c41ee4f82e0a54781dc6;hb=31170f9ceca91684ea66e0b16757881563a8cf26;hp=5ab39e1ec009582772a18493c18e503c7c15b926;hpb=511ea5850f2553d14891aeda7972d0526c67a3af;p=fs%2Flustre-release.git diff --git a/lustre/ptlrpc/nrs_tbf.c b/lustre/ptlrpc/nrs_tbf.c index 5ab39e1..9486172 100644 --- a/lustre/ptlrpc/nrs_tbf.c +++ b/lustre/ptlrpc/nrs_tbf.c @@ -807,7 +807,7 @@ nrs_tbf_jobid_list_free(struct list_head *jobid_list) list_for_each_entry_safe(jobid, n, jobid_list, tj_linkage) { OBD_FREE(jobid->tj_id, strlen(jobid->tj_id) + 1); list_del(&jobid->tj_linkage); - OBD_FREE(jobid, sizeof(struct nrs_tbf_jobid)); + OBD_FREE_PTR(jobid); } } @@ -817,13 +817,13 @@ nrs_tbf_jobid_list_add(struct cfs_lstr *id, struct list_head *jobid_list) struct nrs_tbf_jobid *jobid; char *ptr; - OBD_ALLOC(jobid, sizeof(struct nrs_tbf_jobid)); + OBD_ALLOC_PTR(jobid); if (jobid == NULL) return -ENOMEM; OBD_ALLOC(jobid->tj_id, id->ls_len + 1); if (jobid->tj_id == NULL) { - OBD_FREE(jobid, sizeof(struct nrs_tbf_jobid)); + OBD_FREE_PTR(jobid); return -ENOMEM; } @@ -1840,7 +1840,7 @@ nrs_tbf_expression_parse(struct cfs_lstr *src, struct list_head *cond_list) struct cfs_lstr field; int rc = 0; - OBD_ALLOC(expr, sizeof(struct nrs_tbf_expression)); + OBD_ALLOC_PTR(expr); if (expr == NULL) return -ENOMEM; @@ -1903,7 +1903,7 @@ nrs_tbf_conjunction_parse(struct cfs_lstr *src, struct list_head *cond_list) struct cfs_lstr expr; int rc = 0; - OBD_ALLOC(conjunction, sizeof(struct nrs_tbf_conjunction)); + OBD_ALLOC_PTR(conjunction); if (conjunction == NULL) return -ENOMEM; @@ -3583,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, @@ -3675,7 +3674,7 @@ static int nrs_tbf_lprocfs_init(struct ptlrpc_service *svc) { NULL } }; - if (IS_ERR_OR_NULL(svc->srv_debugfs_entry)) + if (!svc->srv_debugfs_entry) return 0; return ldebugfs_add_vars(svc->srv_debugfs_entry, nrs_tbf_lprocfs_vars,