X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fptlrpc%2Fnrs_crr.c;h=41d0cb6a83643ea4b5f7301dab3d7531622ce51e;hb=HEAD;hp=f62728fd0381d225f4ec3aca3e1e151f6fededd0;hpb=9df933d9b4a63e06d93d2d07cf5e670fcc10c8fc;p=fs%2Flustre-release.git diff --git a/lustre/ptlrpc/nrs_crr.c b/lustre/ptlrpc/nrs_crr.c index f62728f..1e976d0 100644 --- a/lustre/ptlrpc/nrs_crr.c +++ b/lustre/ptlrpc/nrs_crr.c @@ -1,32 +1,12 @@ -/* - * GPL HEADER START - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 only, - * as published by the Free Software Foundation. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License version 2 for more details. A copy is - * included in the COPYING file that accompanied this code. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * GPL HEADER END - */ +// SPDX-License-Identifier: GPL-2.0 + /* * Copyright (c) 2013, 2017, Intel Corporation. * * Copyright 2012 Xyratex Technology Limited */ + /* - * lustre/ptlrpc/nrs_crr.c - * * Network Request Scheduler (NRS) CRR-N policy * * Request ordering in a batched Round-Robin manner over client NIDs @@ -34,11 +14,6 @@ * Author: Liang Zhen * Author: Nikitas Angelinas */ -/** - * \addtogoup nrs - * @{ - */ -#ifdef HAVE_SERVER_SUPPORT #define DEBUG_SUBSYSTEM S_RPC #include @@ -47,33 +22,29 @@ #include #include "ptlrpc_internal.h" -/** - * \name CRR-N policy - * +/* + * CRR-N policy * Client Round-Robin scheduling over client NIDs - * - * @{ - * */ #define NRS_POL_NAME_CRRN "crrn" /** - * Binary heap predicate. + * crrn_req_compare() - Binary heap predicate. + * @e1: the first binheap node to compare + * @e2: the second binheap node to compare * * Uses ptlrpc_nrs_request::nr_u::crr::cr_round and * ptlrpc_nrs_request::nr_u::crr::cr_sequence to compare two binheap nodes and * produce a binary predicate that shows their relative priority, so that the * binary heap can perform the necessary sorting operations. * - * \param[in] e1 the first binheap node to compare - * \param[in] e2 the second binheap node to compare - * - * \retval 0 e1 > e2 - * \retval 1 e1 <= e2 + * Return: + * * %0 if e1 > e2 + * * %1 if e1 <= e2 */ static int -crrn_req_compare(struct cfs_binheap_node *e1, struct cfs_binheap_node *e2) +crrn_req_compare(struct binheap_node *e1, struct binheap_node *e2) { struct ptlrpc_nrs_request *nrq1; struct ptlrpc_nrs_request *nrq2; @@ -89,36 +60,38 @@ crrn_req_compare(struct cfs_binheap_node *e1, struct cfs_binheap_node *e2) return nrq1->nr_u.crr.cr_sequence < nrq2->nr_u.crr.cr_sequence; } -static struct cfs_binheap_ops nrs_crrn_heap_ops = { +static struct binheap_ops nrs_crrn_heap_ops = { .hop_enter = NULL, .hop_exit = NULL, .hop_compare = crrn_req_compare, }; /** - * rhashtable operations for nrs_crrn_net::cn_cli_hash + * nrs_crrn_hashfn() - rhashtable operations for nrs_crrn_net::cn_cli_hash + * @data: pointer to key + * @len: length of key + * @seed: seed value (randomness regulator) * - * This uses ptlrpc_request::rq_peer.nid as its key, in order to hash + * This uses ptlrpc_request::rq_peer.nid (as nid4) as its key, in order to hash * nrs_crrn_client objects. */ static u32 nrs_crrn_hashfn(const void *data, u32 len, u32 seed) { - const lnet_nid_t *nid = data; + const struct lnet_nid *nid = data; - seed ^= cfs_hash_64((u64)nid, 32); - return seed; + return cfs_hash_32(nidhash(nid) ^ seed, 32); } static int nrs_crrn_cmpfn(struct rhashtable_compare_arg *arg, const void *obj) { const struct nrs_crrn_client *cli = obj; - const lnet_nid_t *nid = arg->key; + const struct lnet_nid *nid = arg->key; - return *nid != cli->cc_nid; + return nid_same(nid, &cli->cc_nid) ? 0 : -ESRCH; } static const struct rhashtable_params nrs_crrn_hash_params = { - .key_len = sizeof(lnet_nid_t), + .key_len = sizeof(struct lnet_nid), .key_offset = offsetof(struct nrs_crrn_client, cc_nid), .head_offset = offsetof(struct nrs_crrn_client, cc_rhead), .hashfn = nrs_crrn_hashfn, @@ -131,18 +104,19 @@ static void nrs_crrn_exit(void *vcli, void *data) LASSERTF(atomic_read(&cli->cc_ref) == 0, "Busy CRR-N object from client with NID %s, with %d refs\n", - libcfs_nid2str(cli->cc_nid), atomic_read(&cli->cc_ref)); + libcfs_nidstr(&cli->cc_nid), atomic_read(&cli->cc_ref)); OBD_FREE_PTR(cli); } /** - * Called when a CRR-N policy instance is started. + * nrs_crrn_start() - Called when a CRR-N policy instance is started. + * @policy: the policy + * @arg: used for passing parameters and information (optional) * - * \param[in] policy the policy - * - * \retval -ENOMEM OOM error - * \retval 0 success + * Return: + * * %-ENOMEM OOM error + * * %0 success */ static int nrs_crrn_start(struct ptlrpc_nrs_policy *policy, char *arg) { @@ -154,7 +128,7 @@ static int nrs_crrn_start(struct ptlrpc_nrs_policy *policy, char *arg) if (net == NULL) RETURN(-ENOMEM); - net->cn_binheap = cfs_binheap_create(&nrs_crrn_heap_ops, + net->cn_binheap = binheap_create(&nrs_crrn_heap_ops, CBH_FLAG_ATOMIC_GROW, 4096, NULL, nrs_pol2cptab(policy), nrs_pol2cptid(policy)); @@ -165,14 +139,14 @@ static int nrs_crrn_start(struct ptlrpc_nrs_policy *policy, char *arg) if (rc) GOTO(out_binheap, rc); - /** + /* * Set default quantum value to max_rpcs_in_flight for non-MDS OSCs; * there may be more RPCs pending from each struct nrs_crrn_client even * with the default max_rpcs_in_flight value, as we are scheduling over * NIDs, and there may be more than one mount point per client. */ net->cn_quantum = OBD_MAX_RIF_DEFAULT; - /** + /* * Set to 1 so that the test inside nrs_crrn_req_add() can evaluate to * true. */ @@ -183,7 +157,7 @@ static int nrs_crrn_start(struct ptlrpc_nrs_policy *policy, char *arg) RETURN(rc); out_binheap: - cfs_binheap_destroy(net->cn_binheap); + binheap_destroy(net->cn_binheap); out_net: OBD_FREE_PTR(net); @@ -191,13 +165,12 @@ out_net: } /** - * Called when a CRR-N policy instance is stopped. + * nrs_crrn_stop() - Called when a CRR-N policy instance is stopped. + * @policy: the policy * * Called when the policy has been instructed to transition to the * ptlrpc_nrs_pol_state::NRS_POL_STATE_STOPPED state and has no more pending * requests to serve. - * - * \param[in] policy the policy */ static void nrs_crrn_stop(struct ptlrpc_nrs_policy *policy) { @@ -206,27 +179,27 @@ static void nrs_crrn_stop(struct ptlrpc_nrs_policy *policy) LASSERT(net != NULL); LASSERT(net->cn_binheap != NULL); - LASSERT(cfs_binheap_is_empty(net->cn_binheap)); + LASSERT(binheap_is_empty(net->cn_binheap)); rhashtable_free_and_destroy(&net->cn_cli_hash, nrs_crrn_exit, NULL); - cfs_binheap_destroy(net->cn_binheap); + binheap_destroy(net->cn_binheap); OBD_FREE_PTR(net); } /** - * Performs a policy-specific ctl function on CRR-N policy instances; similar - * to ioctl. - * - * \param[in] policy the policy instance - * \param[in] opc the opcode - * \param[in,out] arg used for passing parameters and information + * nrs_crrn_ctl() - Performs a policy-specific ctl function on CRR-N policy + * instances; similar to ioctl. + * @policy: the policy instance + * @opc: the opcode + * @arg: used for passing parameters and information * * \pre assert_spin_locked(&policy->pol_nrs->->nrs_lock) * \post assert_spin_locked(&policy->pol_nrs->->nrs_lock) * - * \retval 0 operation carried out successfully - * \retval -ve error + * Return: + * * %0 operation carried out successfully + * * %negative on error */ static int nrs_crrn_ctl(struct ptlrpc_nrs_policy *policy, enum ptlrpc_nrs_ctl opc, @@ -234,13 +207,11 @@ static int nrs_crrn_ctl(struct ptlrpc_nrs_policy *policy, { assert_spin_locked(&policy->pol_nrs->nrs_lock); - switch((enum nrs_ctl_crr)opc) { + switch (opc) { default: RETURN(-EINVAL); - /** - * Read Round Robin quantum size of a policy instance. - */ + /* Read Round Robin quantum size of a policy instance. */ case NRS_CTL_CRRN_RD_QUANTUM: { struct nrs_crrn_net *net = policy->pol_private; @@ -248,9 +219,7 @@ static int nrs_crrn_ctl(struct ptlrpc_nrs_policy *policy, } break; - /** - * Write Round Robin quantum size of a policy instance. - */ + /* Write Round Robin quantum size of a policy instance. */ case NRS_CTL_CRRN_WR_QUANTUM: { struct nrs_crrn_net *net = policy->pol_private; @@ -264,26 +233,28 @@ static int nrs_crrn_ctl(struct ptlrpc_nrs_policy *policy, } /** - * Obtains resources from CRR-N policy instances. The top-level resource lives - * inside \e nrs_crrn_net and the second-level resource inside - * \e nrs_crrn_client object instances. - * - * \param[in] policy the policy for which resources are being taken for - * request \a nrq - * \param[in] nrq the request for which resources are being taken - * \param[in] parent parent resource, embedded in nrs_crrn_net for the + * nrs_crrn_res_get() - Obtains resources from CRR-N policy instances + * @policy: the policy for which resources are being taken for + * request @nrq + * @nrq: the request for which resources are being taken + * @parent: parent resource, embedded in nrs_crrn_net for the * CRR-N policy - * \param[out] resp resources references are placed in this array - * \param[in] moving_req signifies limited caller context; used to perform + * @resp: resources references are placed in this array (out param) + * @moving_req: signifies limited caller context; used to perform * memory allocations in an atomic context in this * policy * - * \retval 0 we are returning a top-level, parent resource, one that is - * embedded in an nrs_crrn_net object - * \retval 1 we are returning a bottom-level resource, one that is embedded - * in an nrs_crrn_client object + * Obtains resources from CRR-N policy instances. The top-level resource lives + * inside @nrs_crrn_net and the second-level resource inside @nrs_crrn_client + * object instances. + * + * see @nrs_resource_get_safe() * - * \see nrs_resource_get_safe() + * Return: + * * %0 we are returning a top-level, parent resource, one that is + * embedded in an nrs_crrn_net object + * * %1 we are returning a bottom-level resource, one that is embedded + * in an nrs_crrn_client object */ static int nrs_crrn_res_get(struct ptlrpc_nrs_policy *policy, struct ptlrpc_nrs_request *nrq, @@ -302,7 +273,6 @@ static int nrs_crrn_res_get(struct ptlrpc_nrs_policy *policy, net = container_of(parent, struct nrs_crrn_net, cn_res); req = container_of(nrq, struct ptlrpc_request, rq_nrq); - cli = rhashtable_lookup_fast(&net->cn_cli_hash, &req->rq_peer.nid, nrs_crrn_hash_params); if (cli) @@ -335,20 +305,17 @@ out: } /** - * Called when releasing references to the resource hierachy obtained for a - * request for scheduling using the CRR-N policy. - * - * \param[in] policy the policy the resource belongs to - * \param[in] res the resource to be released + * nrs_crrn_res_put() - Called when releasing references to the resource + * hierachy obtained for a request for scheduling using the CRR-N policy. + * @policy: the policy the resource belongs to + * @res: the resource to be released */ static void nrs_crrn_res_put(struct ptlrpc_nrs_policy *policy, const struct ptlrpc_nrs_resource *res) { struct nrs_crrn_client *cli; - /** - * Do nothing for freeing parent, nrs_crrn_net resources - */ + /* Do nothing for freeing parent, nrs_crrn_net resources */ if (res->res_parent == NULL) return; @@ -358,26 +325,25 @@ static void nrs_crrn_res_put(struct ptlrpc_nrs_policy *policy, } /** - * Called when getting a request from the CRR-N policy for handlingso that it can be served + * nrs_crrn_req_get() - Called when getting a request from the CRR-N policy for + * handlingso that it can be served * - * \param[in] policy the policy being polled - * \param[in] peek when set, signifies that we just want to examine the - * request, and not handle it, so the request is not removed - * from the policy. - * \param[in] force force the policy to return a request; unused in this policy + * @policy: the policy being polled + * @peek: when set, signifies that we just want to examine the request, + * and not handle it, so the request is not removed from the policy. + * @force: force the policy to return a request; unused in this policy * - * \retval the request to be handled - * \retval NULL no request available + * see @ptlrpc_nrs_req_get_nolock() + * see @nrs_request_get() * - * \see ptlrpc_nrs_req_get_nolock() - * \see nrs_request_get() + * Return the request to be handled or NULL no request available */ static struct ptlrpc_nrs_request *nrs_crrn_req_get(struct ptlrpc_nrs_policy *policy, bool peek, bool force) { struct nrs_crrn_net *net = policy->pol_private; - struct cfs_binheap_node *node = cfs_binheap_root(net->cn_binheap); + struct binheap_node *node = binheap_root(net->cn_binheap); struct ptlrpc_nrs_request *nrq; nrq = unlikely(node == NULL) ? NULL : @@ -394,18 +360,18 @@ struct ptlrpc_nrs_request *nrs_crrn_req_get(struct ptlrpc_nrs_policy *policy, LASSERT(nrq->nr_u.crr.cr_round <= cli->cc_round); - cfs_binheap_remove(net->cn_binheap, &nrq->nr_node); + binheap_remove(net->cn_binheap, &nrq->nr_node); cli->cc_active--; CDEBUG(D_RPCTRACE, "NRS: starting to handle %s request from %s, with round " "%llu\n", NRS_POL_NAME_CRRN, - libcfs_id2str(req->rq_peer), nrq->nr_u.crr.cr_round); + libcfs_idstr(&req->rq_peer), nrq->nr_u.crr.cr_round); - /** Peek at the next request to be served */ - node = cfs_binheap_root(net->cn_binheap); + /* Peek at the next request to be served */ + node = binheap_root(net->cn_binheap); - /** No more requests */ + /* No more requests */ if (unlikely(node == NULL)) { net->cn_round++; } else { @@ -423,7 +389,10 @@ struct ptlrpc_nrs_request *nrs_crrn_req_get(struct ptlrpc_nrs_policy *policy, } /** - * Adds request \a nrq to a CRR-N \a policy instance's set of queued requests + * nrs_crrn_req_add() - Adds request @nrq to a CRR-N @policy instance's set of + * queued requests + * @policy: the policy + * @nrq: the request to add * * A scheduling round is a stream of requests that have been sorted in batches * according to the client that they originate from (as identified by its NID); @@ -445,11 +414,9 @@ struct ptlrpc_nrs_request *nrs_crrn_req_get(struct ptlrpc_nrs_policy *policy, * maintain an ordered set of rounds, with each round consisting of an ordered * set of batches of requests. * - * \param[in] policy the policy - * \param[in] nrq the request to add - * - * \retval 0 request successfully added - * \retval != 0 error + * Return: + * * %0 request successfully added + * * %!=0 on error */ static int nrs_crrn_req_add(struct ptlrpc_nrs_policy *policy, struct ptlrpc_nrs_request *nrq) @@ -466,7 +433,7 @@ static int nrs_crrn_req_add(struct ptlrpc_nrs_policy *policy, if (cli->cc_quantum == 0 || cli->cc_round < net->cn_round || (cli->cc_active == 0 && cli->cc_quantum > 0)) { - /** + /* * If the client has no pending requests, and still some of its * quantum remaining unused, which implies it has not had a * chance to schedule up to its maximum allowed batch size of @@ -479,14 +446,14 @@ static int nrs_crrn_req_add(struct ptlrpc_nrs_policy *policy, if (cli->cc_active == 0 && cli->cc_quantum > 0) cli->cc_round++; - /** A new scheduling round has commenced */ + /* A new scheduling round has commenced */ if (cli->cc_round < net->cn_round) cli->cc_round = net->cn_round; - /** I was not the last client through here */ + /* I was not the last client through here */ if (cli->cc_sequence < net->cn_sequence) cli->cc_sequence = ++net->cn_sequence; - /** + /* * Reset the quantum if we have reached the maximum quantum * size for this batch, or even if we have not managed to * complete a batch size up to its maximum allowed size. @@ -498,7 +465,7 @@ static int nrs_crrn_req_add(struct ptlrpc_nrs_policy *policy, nrq->nr_u.crr.cr_round = cli->cc_round; nrq->nr_u.crr.cr_sequence = cli->cc_sequence; - rc = cfs_binheap_insert(net->cn_binheap, &nrq->nr_node); + rc = binheap_insert(net->cn_binheap, &nrq->nr_node); if (rc == 0) { cli->cc_active++; if (--cli->cc_quantum == 0) @@ -508,11 +475,10 @@ static int nrs_crrn_req_add(struct ptlrpc_nrs_policy *policy, } /** - * Removes request \a nrq from a CRR-N \a policy instance's set of queued - * requests. - * - * \param[in] policy the policy - * \param[in] nrq the request to remove + * nrs_crrn_req_del() - Removes request @nrq from a CRR-N @policy instance's set + * of queued requests. + * @policy: the policy + * @nrq: the request to remove */ static void nrs_crrn_req_del(struct ptlrpc_nrs_policy *policy, struct ptlrpc_nrs_request *nrq) @@ -528,20 +494,20 @@ static void nrs_crrn_req_del(struct ptlrpc_nrs_policy *policy, LASSERT(nrq->nr_u.crr.cr_round <= cli->cc_round); - is_root = &nrq->nr_node == cfs_binheap_root(net->cn_binheap); + is_root = &nrq->nr_node == binheap_root(net->cn_binheap); - cfs_binheap_remove(net->cn_binheap, &nrq->nr_node); + binheap_remove(net->cn_binheap, &nrq->nr_node); cli->cc_active--; - /** + /* * If we just deleted the node at the root of the binheap, we may have * to adjust round numbers. */ if (unlikely(is_root)) { - /** Peek at the next request to be served */ - struct cfs_binheap_node *node = cfs_binheap_root(net->cn_binheap); + /* Peek at the next request to be served */ + struct binheap_node *node = binheap_root(net->cn_binheap); - /** No more requests */ + /* No more requests */ if (unlikely(node == NULL)) { net->cn_round++; } else { @@ -555,11 +521,10 @@ static void nrs_crrn_req_del(struct ptlrpc_nrs_policy *policy, } /** - * Called right after the request \a nrq finishes being handled by CRR-N policy - * instance \a policy. - * - * \param[in] policy the policy that handled the request - * \param[in] nrq the request that was handled + * nrs_crrn_req_stop() - Called right after the request @nrq finishes being + * handled by CRR-N policy instance @policy. + * @policy: the policy that handled the request + * @nrq: the request that was handled */ static void nrs_crrn_req_stop(struct ptlrpc_nrs_policy *policy, struct ptlrpc_nrs_request *nrq) @@ -570,14 +535,12 @@ static void nrs_crrn_req_stop(struct ptlrpc_nrs_policy *policy, CDEBUG(D_RPCTRACE, "NRS: finished handling %s request from %s, with round %llu" "\n", NRS_POL_NAME_CRRN, - libcfs_id2str(req->rq_peer), nrq->nr_u.crr.cr_round); + libcfs_idstr(&req->rq_peer), nrq->nr_u.crr.cr_round); } -/** - * debugfs interface - */ +/* debugfs interface */ -/** +/* * Retrieves the value of the Round Robin quantum (i.e. the maximum batch size) * for CRR-N policy instances on both the regular and high-priority NRS head * of a service, as long as a policy instance is not in the @@ -587,9 +550,8 @@ static void nrs_crrn_req_stop(struct ptlrpc_nrs_policy *policy, * Quantum values are in # of RPCs, and output is in YAML format. * * For example: - * - * reg_quantum:8 - * hp_quantum:4 + * reg_quantum:8 + * hp_quantum:4 */ static int ptlrpc_lprocfs_nrs_crrn_quantum_seq_show(struct seq_file *m, void *data) @@ -598,7 +560,7 @@ ptlrpc_lprocfs_nrs_crrn_quantum_seq_show(struct seq_file *m, void *data) __u16 quantum; int rc; - /** + /* * Perform two separate calls to this as only one of the NRS heads' * policies may be in the ptlrpc_nrs_pol_state::NRS_POL_STATE_STARTED or * ptlrpc_nrs_pol_state::NRS_POL_STATE_STOPPING state. @@ -610,7 +572,7 @@ ptlrpc_lprocfs_nrs_crrn_quantum_seq_show(struct seq_file *m, void *data) if (rc == 0) { seq_printf(m, NRS_LPROCFS_QUANTUM_NAME_REG "%-5d\n", quantum); - /** + /* * Ignore -ENODEV as the regular NRS head's policy may be in the * ptlrpc_nrs_pol_state::NRS_POL_STATE_STOPPED state. */ @@ -627,7 +589,7 @@ ptlrpc_lprocfs_nrs_crrn_quantum_seq_show(struct seq_file *m, void *data) true, &quantum); if (rc == 0) { seq_printf(m, NRS_LPROCFS_QUANTUM_NAME_HP"%-5d\n", quantum); - /** + /* * Ignore -ENODEV as the high priority NRS head's policy may be * in the ptlrpc_nrs_pol_state::NRS_POL_STATE_STOPPED state. */ @@ -640,6 +602,12 @@ no_hp: } /** + * ptlrpc_lprocfs_nrs_crrn_quantum_seq_write() - Write operation debugfs file + * @file: file pointer to debugfs file + * @buffer: buffer (user space) + * @count: number of bytes in the buffer + * @off: offset + * * Sets the value of the Round Robin quantum (i.e. the maximum batch size) * for CRR-N policy instances of a service. The user can set the quantum size * for the regular or high priority NRS head individually by specifying each @@ -658,6 +626,10 @@ no_hp: * * policy instances in the ptlrpc_nrs_pol_state::NRS_POL_STATE_STOPPED state * are skipped later by nrs_crrn_ctl(). + * + * Return: + * * %>0 on success + * * %negative on failure */ static ssize_t ptlrpc_lprocfs_nrs_crrn_quantum_seq_write(struct file *file, @@ -665,30 +637,29 @@ ptlrpc_lprocfs_nrs_crrn_quantum_seq_write(struct file *file, size_t count, loff_t *off) { - struct ptlrpc_service *svc = ((struct seq_file *)file->private_data)->private; + struct seq_file *m = file->private_data; + struct ptlrpc_service *svc = m->private; enum ptlrpc_nrs_queue_type queue = 0; char kernbuf[LPROCFS_NRS_WR_QUANTUM_MAX_CMD]; char *val; long quantum_reg; long quantum_hp; - /** lprocfs_find_named_value() modifies its argument, so keep a copy */ + /* lprocfs_find_named_value() modifies its argument, so keep a copy */ size_t count_copy; int rc = 0; int rc2 = 0; - if (count > (sizeof(kernbuf) - 1)) - return -EINVAL; + if (count > (sizeof(kernbuf) - 1)) + return -EINVAL; if (copy_from_user(kernbuf, buffer, count)) return -EFAULT; - kernbuf[count] = '\0'; + kernbuf[count] = '\0'; count_copy = count; - /** - * Check if the regular quantum value has been specified - */ + /* Check if the regular quantum value has been specified */ val = lprocfs_find_named_value(kernbuf, NRS_LPROCFS_QUANTUM_NAME_REG, &count_copy); if (val != kernbuf) { @@ -701,9 +672,7 @@ ptlrpc_lprocfs_nrs_crrn_quantum_seq_write(struct file *file, count_copy = count; - /** - * Check if the high priority quantum value has been specified - */ + /* Check if the high priority quantum value has been specified */ val = lprocfs_find_named_value(kernbuf, NRS_LPROCFS_QUANTUM_NAME_HP, &count_copy); if (val != kernbuf) { @@ -717,7 +686,7 @@ ptlrpc_lprocfs_nrs_crrn_quantum_seq_write(struct file *file, queue |= PTLRPC_NRS_QUEUE_HP; } - /** + /* * If none of the queues has been specified, look for a valid numerical * value */ @@ -740,7 +709,7 @@ ptlrpc_lprocfs_nrs_crrn_quantum_seq_write(struct file *file, ((quantum_hp > LPROCFS_NRS_QUANTUM_MAX || quantum_hp <= 0)))) return -EINVAL; - /** + /* * We change the values on regular and HP NRS heads separately, so that * we do not exit early from ptlrpc_nrs_policy_control() with an error * returned by nrs_policy_ctl_locked(), in cases where the user has not @@ -776,31 +745,32 @@ ptlrpc_lprocfs_nrs_crrn_quantum_seq_write(struct file *file, LDEBUGFS_SEQ_FOPS(ptlrpc_lprocfs_nrs_crrn_quantum); /** - * Initializes a CRR-N policy's lprocfs interface for service \a svc + * nrs_crrn_lprocfs_init() - Initializes a CRR-N policy's lprocfs interface for + * service @svc + * @svc: the service (PTLRPC service) * - * \param[in] svc the service - * - * \retval 0 success - * \retval != 0 error + * Return: + * * %0 success + * * %!=0 error */ static int nrs_crrn_lprocfs_init(struct ptlrpc_service *svc) { - struct lprocfs_vars nrs_crrn_lprocfs_vars[] = { + struct ldebugfs_vars nrs_crrn_lprocfs_vars[] = { { .name = "nrs_crrn_quantum", .fops = &ptlrpc_lprocfs_nrs_crrn_quantum_fops, .data = 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_crrn_lprocfs_vars, NULL); + ldebugfs_add_vars(svc->srv_debugfs_entry, nrs_crrn_lprocfs_vars, NULL); + + return 0; } -/** - * CRR-N policy operations - */ +/* CRR-N policy operations */ static const struct ptlrpc_nrs_pol_ops nrs_crrn_ops = { .op_policy_start = nrs_crrn_start, .op_policy_stop = nrs_crrn_stop, @@ -814,17 +784,9 @@ static const struct ptlrpc_nrs_pol_ops nrs_crrn_ops = { .op_lprocfs_init = nrs_crrn_lprocfs_init, }; -/** - * CRR-N policy configuration - */ +/* CRR-N policy configuration */ struct ptlrpc_nrs_pol_conf nrs_conf_crrn = { .nc_name = NRS_POL_NAME_CRRN, .nc_ops = &nrs_crrn_ops, .nc_compat = nrs_policy_compat_all, }; - -/** @} CRR-N policy */ - -/** @} nrs */ - -#endif /* HAVE_SERVER_SUPPORT */