Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-7384 lfsck: check transaction stop status
[fs/lustre-release.git]
/
lustre
/
ptlrpc
/
nrs_tbf.c
diff --git
a/lustre/ptlrpc/nrs_tbf.c
b/lustre/ptlrpc/nrs_tbf.c
index
254b194
..
5e57cfe
100644
(file)
--- a/
lustre/ptlrpc/nrs_tbf.c
+++ b/
lustre/ptlrpc/nrs_tbf.c
@@
-22,6
+22,7
@@
/*
* Copyright (C) 2013 DataDirect Networks, Inc.
*
/*
* Copyright (C) 2013 DataDirect Networks, Inc.
*
+ * Copyright (c) 2014, Intel Corporation.
*/
/*
* lustre/ptlrpc/nrs_tbf.c
*/
/*
* lustre/ptlrpc/nrs_tbf.c
@@
-439,7
+440,7
@@
static cfs_binheap_ops_t nrs_tbf_heap_ops = {
.hop_compare = tbf_cli_compare,
};
.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);
unsigned mask)
{
return cfs_hash_djb2_hash(key, strlen(key), mask);
@@
-468,7
+469,7
@@
static void *nrs_tbf_jobid_hop_object(struct hlist_node *hnode)
return hlist_entry(hnode, struct nrs_tbf_client, tc_hnode);
}
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,
{
struct nrs_tbf_client *cli = hlist_entry(hnode,
struct nrs_tbf_client,
@@
-477,7
+478,7
@@
static void nrs_tbf_jobid_hop_get(cfs_hash_t *hs, struct hlist_node *hnode)
atomic_inc(&cli->tc_ref);
}
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,
{
struct nrs_tbf_client *cli = hlist_entry(hnode,
struct nrs_tbf_client,
@@
-486,18
+487,19
@@
static void nrs_tbf_jobid_hop_put(cfs_hash_t *hs, struct hlist_node *hnode)
atomic_dec(&cli->tc_ref);
}
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 *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);
}
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,
.hs_hash = nrs_tbf_jobid_hop_hash,
.hs_keycmp = nrs_tbf_jobid_hop_keycmp,
.hs_key = nrs_tbf_jobid_hop_key,
@@
-513,8
+515,8
@@
static cfs_hash_ops_t nrs_tbf_jobid_hash_ops = {
CFS_HASH_DEPTH)
static struct nrs_tbf_client *
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 hlist_node *hnode;
@@
-541,8
+543,8
@@
nrs_tbf_jobid_cli_find(struct nrs_tbf_head *head,
{
const char *jobid;
struct nrs_tbf_client *cli;
{
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)
jobid = lustre_msg_get_jobid(req->rq_reqmsg);
if (jobid == NULL)
@@
-560,8
+562,8
@@
nrs_tbf_jobid_cli_findadd(struct nrs_tbf_head *head,
{
const char *jobid;
struct nrs_tbf_client *ret;
{
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);
jobid = cli->tc_jobid;
cfs_hash_bd_get_and_lock(hs, (void *)jobid, &bd, 1);
@@
-579,8
+581,8
@@
static void
nrs_tbf_jobid_cli_put(struct nrs_tbf_head *head,
struct nrs_tbf_client *cli)
{
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;
struct nrs_tbf_bucket *bkt;
int hw;
struct list_head zombies;
@@
-652,7
+654,7
@@
nrs_tbf_jobid_startup(struct ptlrpc_nrs_policy *policy,
int bits;
int i;
int rc;
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)
bits = nrs_tbf_jobid_hash_order();
if (bits < NRS_TBF_JOBID_BKT_BITS)
@@
-863,7
+865,7
@@
static struct nrs_tbf_ops nrs_tbf_jobid_ops = {
#define NRS_TBF_NID_BKT_BITS 8
#define NRS_TBF_NID_BITS 16
#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);
unsigned mask)
{
return cfs_hash_djb2_hash(key, sizeof(lnet_nid_t), mask);
@@
-893,7
+895,7
@@
static void *nrs_tbf_nid_hop_object(struct hlist_node *hnode)
return hlist_entry(hnode, struct nrs_tbf_client, tc_hnode);
}
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,
{
struct nrs_tbf_client *cli = hlist_entry(hnode,
struct nrs_tbf_client,
@@
-902,7
+904,7
@@
static void nrs_tbf_nid_hop_get(cfs_hash_t *hs, struct hlist_node *hnode)
atomic_inc(&cli->tc_ref);
}
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,
{
struct nrs_tbf_client *cli = hlist_entry(hnode,
struct nrs_tbf_client,
@@
-911,7
+913,7
@@
static void nrs_tbf_nid_hop_put(cfs_hash_t *hs, struct hlist_node *hnode)
atomic_dec(&cli->tc_ref);
}
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,
{
struct nrs_tbf_client *cli = hlist_entry(hnode,
struct nrs_tbf_client,
@@
-924,7
+926,7
@@
static void nrs_tbf_nid_hop_exit(cfs_hash_t *hs, struct hlist_node *hnode)
nrs_tbf_cli_fini(cli);
}
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,
.hs_hash = nrs_tbf_nid_hop_hash,
.hs_keycmp = nrs_tbf_nid_hop_keycmp,
.hs_key = nrs_tbf_nid_hop_key,
@@
-1182,9
+1184,7
@@
static void nrs_tbf_stop(struct ptlrpc_nrs_policy *policy)
LASSERT(cfs_binheap_is_empty(head->th_binheap));
cfs_binheap_destroy(head->th_binheap);
OBD_FREE_PTR(head);
LASSERT(cfs_binheap_is_empty(head->th_binheap));
cfs_binheap_destroy(head->th_binheap);
OBD_FREE_PTR(head);
- spin_lock(&nrs->nrs_lock);
nrs->nrs_throttling = 0;
nrs->nrs_throttling = 0;
- spin_unlock(&nrs->nrs_lock);
wake_up(&policy->pol_nrs->nrs_svcpt->scp_waitq);
}
wake_up(&policy->pol_nrs->nrs_svcpt->scp_waitq);
}
@@
-1548,7
+1548,7
@@
static void nrs_tbf_req_stop(struct ptlrpc_nrs_policy *policy,
nrq->nr_u.tbf.tr_sequence);
}
nrq->nr_u.tbf.tr_sequence);
}
-#ifdef
LPROC
FS
+#ifdef
CONFIG_PROC_
FS
/**
* lprocfs interface
/**
* lprocfs interface
@@
-1826,7
+1826,7
@@
LPROC_SEQ_FOPS(ptlrpc_lprocfs_nrs_tbf_rule);
*/
static int nrs_tbf_lprocfs_init(struct ptlrpc_service *svc)
{
*/
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 },
{ .name = "nrs_tbf_rule",
.fops = &ptlrpc_lprocfs_nrs_tbf_rule_fops,
.data = svc },
@@
-1836,8
+1836,7
@@
static int nrs_tbf_lprocfs_init(struct ptlrpc_service *svc)
if (svc->srv_procroot == NULL)
return 0;
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);
}
/**
}
/**
@@
-1853,7
+1852,7
@@
static void nrs_tbf_lprocfs_fini(struct ptlrpc_service *svc)
lprocfs_remove_proc_entry("nrs_tbf_rule", svc->srv_procroot);
}
lprocfs_remove_proc_entry("nrs_tbf_rule", svc->srv_procroot);
}
-#endif /*
LPROC
FS */
+#endif /*
CONFIG_PROC_
FS */
/**
* TBF policy operations
/**
* TBF policy operations
@@
-1868,7
+1867,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,
.op_req_enqueue = nrs_tbf_req_add,
.op_req_dequeue = nrs_tbf_req_del,
.op_req_stop = nrs_tbf_req_stop,
-#ifdef
LPROC
FS
+#ifdef
CONFIG_PROC_
FS
.op_lprocfs_init = nrs_tbf_lprocfs_init,
.op_lprocfs_fini = nrs_tbf_lprocfs_fini,
#endif
.op_lprocfs_init = nrs_tbf_lprocfs_init,
.op_lprocfs_fini = nrs_tbf_lprocfs_fini,
#endif