struct cfs_hash *hs = head->th_cli_hash;
struct nrs_tbf_bucket *bkt;
int hw;
- struct list_head zombies;
+ LIST_HEAD(zombies);
- INIT_LIST_HEAD(&zombies);
cfs_hash_bd_get(hs, &cli->tc_jobid, &bd);
bkt = cfs_hash_bd_extra_get(hs, &bd);
if (!cfs_hash_bd_dec_and_lock(hs, &bd, &cli->tc_ref))
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);
}
}
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;
}
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))
struct cfs_hash *hs = head->th_cli_hash;
struct nrs_tbf_bucket *bkt;
int hw;
- struct list_head zombies;
+ LIST_HEAD(zombies);
- INIT_LIST_HEAD(&zombies);
cfs_hash_bd_get(hs, &cli->tc_key, &bd);
bkt = cfs_hash_bd_extra_get(hs, &bd);
if (!cfs_hash_bd_dec_and_lock(hs, &bd, &cli->tc_ref))
struct cfs_lstr field;
int rc = 0;
- OBD_ALLOC(expr, sizeof(struct nrs_tbf_expression));
+ OBD_ALLOC_PTR(expr);
if (expr == NULL)
return -ENOMEM;
struct cfs_lstr expr;
int rc = 0;
- OBD_ALLOC(conjunction, sizeof(struct nrs_tbf_conjunction));
+ OBD_ALLOC_PTR(conjunction);
if (conjunction == NULL)
return -ENOMEM;
*/
case NRS_CTL_TBF_RD_RULE: {
struct nrs_tbf_head *head = policy->pol_private;
- struct seq_file *m = (struct seq_file *) arg;
+ struct seq_file *m = arg;
struct ptlrpc_service_part *svcpt;
svcpt = policy->pol_nrs->nrs_svcpt;
nrq->nr_u.tbf.tr_sequence);
}
-#ifdef CONFIG_PROC_FS
-
/**
- * lprocfs interface
+ * debugfs interface
*/
/**
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,
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
{ NULL }
};
- if (svc->srv_procroot == NULL)
+ if (!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 = {
.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
};
/**