.hop_compare = tbf_cli_compare,
};
-static unsigned nrs_tbf_jobid_hop_hash(cfs_hash_t *hs, const void *key,
+static unsigned nrs_tbf_jobid_hop_hash(struct cfs_hash *hs, const void *key,
unsigned mask)
{
return cfs_hash_djb2_hash(key, strlen(key), mask);
return hlist_entry(hnode, struct nrs_tbf_client, tc_hnode);
}
-static void nrs_tbf_jobid_hop_get(cfs_hash_t *hs, struct hlist_node *hnode)
+static void nrs_tbf_jobid_hop_get(struct cfs_hash *hs, struct hlist_node *hnode)
{
struct nrs_tbf_client *cli = hlist_entry(hnode,
struct nrs_tbf_client,
atomic_inc(&cli->tc_ref);
}
-static void nrs_tbf_jobid_hop_put(cfs_hash_t *hs, struct hlist_node *hnode)
+static void nrs_tbf_jobid_hop_put(struct cfs_hash *hs, struct hlist_node *hnode)
{
struct nrs_tbf_client *cli = hlist_entry(hnode,
struct nrs_tbf_client,
atomic_dec(&cli->tc_ref);
}
-static void nrs_tbf_jobid_hop_exit(cfs_hash_t *hs, struct hlist_node *hnode)
+static void
+nrs_tbf_jobid_hop_exit(struct cfs_hash *hs, struct hlist_node *hnode)
{
struct nrs_tbf_client *cli = hlist_entry(hnode,
- struct nrs_tbf_client,
- tc_hnode);
+ struct nrs_tbf_client,
+ tc_hnode);
LASSERT(atomic_read(&cli->tc_ref) == 0);
nrs_tbf_cli_fini(cli);
}
-static cfs_hash_ops_t nrs_tbf_jobid_hash_ops = {
+static struct cfs_hash_ops nrs_tbf_jobid_hash_ops = {
.hs_hash = nrs_tbf_jobid_hop_hash,
.hs_keycmp = nrs_tbf_jobid_hop_keycmp,
.hs_key = nrs_tbf_jobid_hop_key,
CFS_HASH_DEPTH)
static struct nrs_tbf_client *
-nrs_tbf_jobid_hash_lookup(cfs_hash_t *hs,
- cfs_hash_bd_t *bd,
+nrs_tbf_jobid_hash_lookup(struct cfs_hash *hs,
+ struct cfs_hash_bd *bd,
const char *jobid)
{
struct hlist_node *hnode;
{
const char *jobid;
struct nrs_tbf_client *cli;
- cfs_hash_t *hs = head->th_cli_hash;
- cfs_hash_bd_t bd;
+ struct cfs_hash *hs = head->th_cli_hash;
+ struct cfs_hash_bd bd;
jobid = lustre_msg_get_jobid(req->rq_reqmsg);
if (jobid == NULL)
{
const char *jobid;
struct nrs_tbf_client *ret;
- cfs_hash_t *hs = head->th_cli_hash;
- cfs_hash_bd_t bd;
+ struct cfs_hash *hs = head->th_cli_hash;
+ struct cfs_hash_bd bd;
jobid = cli->tc_jobid;
cfs_hash_bd_get_and_lock(hs, (void *)jobid, &bd, 1);
nrs_tbf_jobid_cli_put(struct nrs_tbf_head *head,
struct nrs_tbf_client *cli)
{
- cfs_hash_bd_t bd;
- cfs_hash_t *hs = head->th_cli_hash;
+ struct cfs_hash_bd bd;
+ struct cfs_hash *hs = head->th_cli_hash;
struct nrs_tbf_bucket *bkt;
int hw;
struct list_head zombies;
int bits;
int i;
int rc;
- cfs_hash_bd_t bd;
+ struct cfs_hash_bd bd;
bits = nrs_tbf_jobid_hash_order();
if (bits < NRS_TBF_JOBID_BKT_BITS)
#define NRS_TBF_NID_BKT_BITS 8
#define NRS_TBF_NID_BITS 16
-static unsigned nrs_tbf_nid_hop_hash(cfs_hash_t *hs, const void *key,
+static unsigned nrs_tbf_nid_hop_hash(struct cfs_hash *hs, const void *key,
unsigned mask)
{
return cfs_hash_djb2_hash(key, sizeof(lnet_nid_t), mask);
return hlist_entry(hnode, struct nrs_tbf_client, tc_hnode);
}
-static void nrs_tbf_nid_hop_get(cfs_hash_t *hs, struct hlist_node *hnode)
+static void nrs_tbf_nid_hop_get(struct cfs_hash *hs, struct hlist_node *hnode)
{
struct nrs_tbf_client *cli = hlist_entry(hnode,
struct nrs_tbf_client,
atomic_inc(&cli->tc_ref);
}
-static void nrs_tbf_nid_hop_put(cfs_hash_t *hs, struct hlist_node *hnode)
+static void nrs_tbf_nid_hop_put(struct cfs_hash *hs, struct hlist_node *hnode)
{
struct nrs_tbf_client *cli = hlist_entry(hnode,
struct nrs_tbf_client,
atomic_dec(&cli->tc_ref);
}
-static void nrs_tbf_nid_hop_exit(cfs_hash_t *hs, struct hlist_node *hnode)
+static void nrs_tbf_nid_hop_exit(struct cfs_hash *hs, struct hlist_node *hnode)
{
struct nrs_tbf_client *cli = hlist_entry(hnode,
struct nrs_tbf_client,
nrs_tbf_cli_fini(cli);
}
-static cfs_hash_ops_t nrs_tbf_nid_hash_ops = {
+static struct cfs_hash_ops nrs_tbf_nid_hash_ops = {
.hs_hash = nrs_tbf_nid_hop_hash,
.hs_keycmp = nrs_tbf_nid_hop_keycmp,
.hs_key = nrs_tbf_nid_hop_key,
*/
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 },
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);
}
/**