Commit dadfcdab authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman

staging/lustre/ptlrpc: Adjust comments to better conform to coding style

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 30aa9c52
......@@ -72,7 +72,8 @@ ptlrpc_connection_get(lnet_process_id_t peer, lnet_nid_t self,
* returned and may be compared against out object.
*/
/* In the function below, .hs_keycmp resolves to
* conn_keycmp() */
* conn_keycmp()
*/
/* coverity[overrun-buffer-val] */
conn2 = cfs_hash_findadd_unique(conn_hash, &peer, &conn->c_hash);
if (conn != conn2) {
......
......@@ -71,7 +71,8 @@ void request_out_callback(lnet_event_t *ev)
if (ev->type == LNET_EVENT_UNLINK || ev->status != 0) {
/* Failed send: make it seem like the reply timed out, just
* like failing sends in client.c does currently... */
* like failing sends in client.c does currently...
*/
req->rq_net_err = 1;
ptlrpc_client_wake_req(req);
......@@ -95,7 +96,8 @@ void reply_in_callback(lnet_event_t *ev)
LASSERT(ev->md.start == req->rq_repbuf);
LASSERT(ev->offset + ev->mlength <= req->rq_repbuf_len);
/* We've set LNET_MD_MANAGE_REMOTE for all outgoing requests
for adaptive timeouts' early reply. */
* for adaptive timeouts' early reply.
*/
LASSERT((ev->md.options & LNET_MD_MANAGE_REMOTE) != 0);
spin_lock(&req->rq_lock);
......@@ -151,7 +153,8 @@ void reply_in_callback(lnet_event_t *ev)
req->rq_reply_off = ev->offset;
req->rq_nob_received = ev->mlength;
/* LNetMDUnlink can't be called under the LNET_LOCK,
so we must unlink in ptlrpc_unregister_reply */
* so we must unlink in ptlrpc_unregister_reply
*/
DEBUG_REQ(D_INFO, req,
"reply in flags=%x mlen=%u offset=%d replen=%d",
lustre_msg_get_flags(req->rq_reqmsg),
......@@ -162,7 +165,8 @@ void reply_in_callback(lnet_event_t *ev)
out_wake:
/* NB don't unlock till after wakeup; req can disappear under us
* since we don't have our own ref */
* since we don't have our own ref
*/
ptlrpc_client_wake_req(req);
spin_unlock(&req->rq_lock);
}
......@@ -213,7 +217,8 @@ void client_bulk_callback(lnet_event_t *ev)
desc->bd_failure = 1;
/* NB don't unlock till after wakeup; desc can disappear under us
* otherwise */
* otherwise
*/
if (desc->bd_md_count == 0)
ptlrpc_client_wake_req(desc->bd_req);
......@@ -250,7 +255,8 @@ static void ptlrpc_req_add_history(struct ptlrpc_service_part *svcpt,
__u64 new_seq;
/* set sequence ID for request and add it to history list,
* it must be called with hold svcpt::scp_lock */
* it must be called with hold svcpt::scp_lock
*/
new_seq = (sec << REQS_SEC_SHIFT) |
(usec << REQS_USEC_SHIFT) |
......@@ -258,7 +264,8 @@ static void ptlrpc_req_add_history(struct ptlrpc_service_part *svcpt,
if (new_seq > svcpt->scp_hist_seq) {
/* This handles the initial case of scp_hist_seq == 0 or
* we just jumped into a new time window */
* we just jumped into a new time window
*/
svcpt->scp_hist_seq = new_seq;
} else {
LASSERT(REQS_SEQ_SHIFT(svcpt) < REQS_USEC_SHIFT);
......@@ -266,7 +273,8 @@ static void ptlrpc_req_add_history(struct ptlrpc_service_part *svcpt,
* however, it's possible that we used up all bits for
* sequence and jumped into the next usec bucket (future time),
* then we hope there will be less RPCs per bucket at some
* point, and sequence will catch up again */
* point, and sequence will catch up again
*/
svcpt->scp_hist_seq += (1U << REQS_SEQ_SHIFT(svcpt));
new_seq = svcpt->scp_hist_seq;
}
......@@ -302,7 +310,8 @@ void request_in_callback(lnet_event_t *ev)
* request buffer we can use the request object embedded in
* rqbd. Note that if we failed to allocate a request,
* we'd have to re-post the rqbd, which we can't do in this
* context. */
* context.
*/
req = &rqbd->rqbd_req;
memset(req, 0, sizeof(*req));
} else {
......@@ -322,7 +331,8 @@ void request_in_callback(lnet_event_t *ev)
/* NB we ABSOLUTELY RELY on req being zeroed, so pointers are NULL,
* flags are reset and scalars are zero. We only set the message
* size to non-zero if this was a successful receive. */
* size to non-zero if this was a successful receive.
*/
req->rq_xid = ev->match_bits;
req->rq_reqbuf = ev->md.start + ev->offset;
if (ev->type == LNET_EVENT_PUT && ev->status == 0)
......@@ -352,7 +362,8 @@ void request_in_callback(lnet_event_t *ev)
svcpt->scp_nrqbds_posted);
/* Normally, don't complain about 0 buffers posted; LNET won't
* drop incoming reqs since we set the portal lazy */
* drop incoming reqs since we set the portal lazy
*/
if (test_req_buffer_pressure &&
ev->type != LNET_EVENT_UNLINK &&
svcpt->scp_nrqbds_posted == 0)
......@@ -369,7 +380,8 @@ void request_in_callback(lnet_event_t *ev)
svcpt->scp_nreqs_incoming++;
/* NB everything can disappear under us once the request
* has been queued and we unlock, so do the wake now... */
* has been queued and we unlock, so do the wake now...
*/
wake_up(&svcpt->scp_waitq);
spin_unlock(&svcpt->scp_lock);
......@@ -390,7 +402,8 @@ void reply_out_callback(lnet_event_t *ev)
if (!rs->rs_difficult) {
/* 'Easy' replies have no further processing so I drop the
* net's ref on 'rs' */
* net's ref on 'rs'
*/
LASSERT(ev->unlinked);
ptlrpc_rs_decref(rs);
return;
......@@ -400,7 +413,8 @@ void reply_out_callback(lnet_event_t *ev)
if (ev->unlinked) {
/* Last network callback. The net's ref on 'rs' stays put
* until ptlrpc_handle_rs() is done with it */
* until ptlrpc_handle_rs() is done with it
*/
spin_lock(&svcpt->scp_rep_lock);
spin_lock(&rs->rs_lock);
......@@ -483,7 +497,8 @@ static void ptlrpc_ni_fini(void)
/* Wait for the event queue to become idle since there may still be
* messages in flight with pending events (i.e. the fire-and-forget
* messages == client requests and "non-difficult" server
* replies */
* replies
*/
for (retries = 0;; retries++) {
rc = LNetEQFree(ptlrpc_eq_h);
......@@ -533,11 +548,13 @@ static int ptlrpc_ni_init(void)
}
/* CAVEAT EMPTOR: how we process portals events is _radically_
* different depending on... */
* different depending on...
*/
/* kernel LNet calls our master callback when there are new event,
* because we are guaranteed to get every event via callback,
* so we just set EQ size to 0 to avoid overhead of serializing
* enqueue/dequeue operations in LNet. */
* enqueue/dequeue operations in LNet.
*/
rc = LNetEQAlloc(0, ptlrpc_master_callback, &ptlrpc_eq_h);
if (rc == 0)
return 0;
......
......@@ -75,7 +75,8 @@
} while (0)
/* This is a callback from the llog_* functions.
* Assumes caller has already pushed us into the kernel context. */
* Assumes caller has already pushed us into the kernel context.
*/
static int llog_client_open(const struct lu_env *env,
struct llog_handle *lgh, struct llog_logid *logid,
char *name, enum llog_open_param open_param)
......@@ -316,8 +317,9 @@ static int llog_client_close(const struct lu_env *env,
struct llog_handle *handle)
{
/* this doesn't call LLOG_ORIGIN_HANDLE_CLOSE because
the servers all close the file at the end of every
other LLOG_ RPC. */
* the servers all close the file at the end of every
* other LLOG_ RPC.
*/
return 0;
}
......
......@@ -306,7 +306,8 @@ ptlrpc_lprocfs_req_history_max_seq_write(struct file *file,
/* This sanity check is more of an insanity check; we can still
* hose a kernel by allowing the request history to grow too
* far. */
* far.
*/
bufpages = (svc->srv_buf_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
if (val > totalram_pages / (2 * bufpages))
return -ERANGE;
......@@ -737,7 +738,8 @@ ptlrpc_lprocfs_svc_req_history_seek(struct ptlrpc_service_part *svcpt,
* recent), search from it onwards.
* Since the service history is LRU (i.e. culled reqs will
* be near the head), we shouldn't have to do long
* re-scans */
* re-scans
*/
LASSERTF(srhi->srhi_seq == srhi->srhi_req->rq_history_seq,
"%s:%d: seek seq %llu, request seq %llu\n",
svcpt->scp_service->srv_name, svcpt->scp_cpt,
......@@ -915,7 +917,8 @@ static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter)
* here. The request could contain any old crap, so you
* must be just as careful as the service's request
* parser. Currently I only print stuff here I know is OK
* to look at coz it was set up in request_in_callback()!!! */
* to look at coz it was set up in request_in_callback()!!!
*/
seq_printf(s, "%lld:%s:%s:x%llu:%d:%s:%lld:%lds(%+lds) ",
req->rq_history_seq, nidstr,
libcfs_id2str(req->rq_peer), req->rq_xid,
......
......@@ -87,7 +87,8 @@ static int ptl_send_buf(lnet_handle_md_t *mdh, void *base, int len,
int rc2;
/* We're going to get an UNLINK event when I unlink below,
* which will complete just like any other failed send, so
* I fall through and return success here! */
* I fall through and return success here!
*/
CERROR("LNetPut(%s, %d, %lld) failed: %d\n",
libcfs_id2str(conn->c_peer), portal, xid, rc);
rc2 = LNetMDUnlink(*mdh);
......@@ -152,7 +153,8 @@ static int ptlrpc_register_bulk(struct ptlrpc_request *req)
* using the same RDMA match bits after an error.
*
* For multi-bulk RPCs, rq_xid is the last XID needed for bulks. The
* first bulk XID is power-of-two aligned before rq_xid. LU-1431 */
* first bulk XID is power-of-two aligned before rq_xid. LU-1431
*/
xid = req->rq_xid & ~((__u64)desc->bd_md_max_brw - 1);
LASSERTF(!(desc->bd_registered &&
req->rq_send_state != LUSTRE_IMP_REPLAY) ||
......@@ -208,7 +210,8 @@ static int ptlrpc_register_bulk(struct ptlrpc_request *req)
}
/* Set rq_xid to matchbits of the final bulk so that server can
* infer the number of bulks that were prepared */
* infer the number of bulks that were prepared
*/
req->rq_xid = --xid;
LASSERTF(desc->bd_last_xid == (req->rq_xid & PTLRPC_BULK_OPS_MASK),
"bd_last_xid = x%llu, rq_xid = x%llu\n",
......@@ -259,7 +262,8 @@ int ptlrpc_unregister_bulk(struct ptlrpc_request *req, int async)
/* the unlink ensures the callback happens ASAP and is the last
* one. If it fails, it must be because completion just happened,
* but we must still l_wait_event() in this case to give liblustre
* a chance to run client_bulk_callback() */
* a chance to run client_bulk_callback()
*/
mdunlink_iterate_helper(desc->bd_mds, desc->bd_md_max_brw);
if (ptlrpc_client_bulk_active(req) == 0) /* completed or */
......@@ -279,7 +283,8 @@ int ptlrpc_unregister_bulk(struct ptlrpc_request *req, int async)
for (;;) {
/* Network access will complete in finite time but the HUGE
* timeout lets us CWARN for visibility of sluggish NALs */
* timeout lets us CWARN for visibility of sluggish LNDs
*/
lwi = LWI_TIMEOUT_INTERVAL(cfs_time_seconds(LONG_UNLINK),
cfs_time_seconds(1), NULL, NULL);
rc = l_wait_event(*wq, !ptlrpc_client_bulk_active(req), &lwi);
......@@ -309,7 +314,8 @@ static void ptlrpc_at_set_reply(struct ptlrpc_request *req, int flags)
(MSG_RESENT | MSG_REPLAY |
MSG_REQ_REPLAY_DONE | MSG_LOCK_REPLAY_DONE))) {
/* early replies, errors and recovery requests don't count
* toward our service time estimate */
* toward our service time estimate
*/
int oldse = at_measured(&svcpt->scp_at_estimate, service_time);
if (oldse != 0) {
......@@ -323,7 +329,8 @@ static void ptlrpc_at_set_reply(struct ptlrpc_request *req, int flags)
lustre_msg_set_service_time(req->rq_repmsg, service_time);
/* Report service time estimate for future client reqs, but report 0
* (to be ignored by client) if it's a error reply during recovery.
* (bz15815) */
* (bz15815)
*/
if (req->rq_type == PTL_RPC_MSG_ERR && !req->rq_export)
lustre_msg_set_timeout(req->rq_repmsg, 0);
else
......@@ -496,7 +503,8 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
LASSERT(request->rq_wait_ctx == 0);
/* If this is a re-transmit, we're required to have disengaged
* cleanly from the previous attempt */
* cleanly from the previous attempt
*/
LASSERT(!request->rq_receiving_reply);
LASSERT(!((lustre_msg_get_flags(request->rq_reqmsg) & MSG_REPLAY) &&
(request->rq_import->imp_state == LUSTRE_IMP_FULL)));
......@@ -548,7 +556,8 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
request->rq_replen);
if (rc) {
/* this prevents us from looping in
* ptlrpc_queue_wait */
* ptlrpc_queue_wait
*/
spin_lock(&request->rq_lock);
request->rq_err = 1;
spin_unlock(&request->rq_lock);
......@@ -600,7 +609,8 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
reply_md.eq_handle = ptlrpc_eq_h;
/* We must see the unlink callback to unset rq_reply_unlink,
so we can't auto-unlink */
* so we can't auto-unlink
*/
rc = LNetMDAttach(reply_me_h, reply_md, LNET_RETAIN,
&request->rq_reply_md_h);
if (rc != 0) {
......@@ -630,7 +640,8 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
ktime_get_real_ts64(&request->rq_arrival_time);
request->rq_sent = ktime_get_real_seconds();
/* We give the server rq_timeout secs to process the req, and
add the network latency for our local timeout. */
* add the network latency for our local timeout.
*/
request->rq_deadline = request->rq_sent + request->rq_timeout +
ptlrpc_at_get_net_latency(request);
......@@ -654,7 +665,8 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
cleanup_me:
/* MEUnlink is safe; the PUT didn't even get off the ground, and
* nobody apart from the PUT's target has the right nid+XID to
* access the reply buffer. */
* access the reply buffer.
*/
rc2 = LNetMEUnlink(reply_me_h);
LASSERT(rc2 == 0);
/* UNLINKED callback called synchronously */
......@@ -662,7 +674,8 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
cleanup_bulk:
/* We do sync unlink here as there was no real transfer here so
* the chance to have long unlink to sluggish net is smaller here. */
* the chance to have long unlink to sluggish net is smaller here.
*/
ptlrpc_unregister_bulk(request, 0);
out:
if (request->rq_memalloc)
......@@ -690,7 +703,8 @@ int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
/* NB: CPT affinity service should use new LNet flag LNET_INS_LOCAL,
* which means buffer can only be attached on local CPT, and LND
* threads can find it by grabbing a local lock */
* threads can find it by grabbing a local lock
*/
rc = LNetMEAttach(service->srv_req_portal,
match_id, 0, ~0, LNET_UNLINK,
rqbd->rqbd_svcpt->scp_cpt >= 0 ?
......
......@@ -43,9 +43,6 @@
#include "../../include/linux/libcfs/libcfs.h"
#include "ptlrpc_internal.h"
/* XXX: This is just for liblustre. Remove the #if defined directive when the
* "cfs_" prefix is dropped from cfs_list_head. */
/**
* NRS core object.
*/
......@@ -1358,7 +1355,8 @@ void ptlrpc_nrs_req_finalize(struct ptlrpc_request *req)
if (req->rq_nrq.nr_initialized) {
nrs_resource_put_safe(req->rq_nrq.nr_res_ptrs);
/* no protection on bit nr_initialized because no
* contention at this late stage */
* contention at this late stage
*/
req->rq_nrq.nr_finalized = 1;
}
}
......
......@@ -133,7 +133,8 @@ EXPORT_SYMBOL(lustre_msg_size_v2);
* NOTE: this should only be used for NEW requests, and should always be
* in the form of a v2 request. If this is a connection to a v1
* target then the first buffer will be stripped because the ptlrpc
* data is part of the lustre_msg_v1 header. b=14043 */
* data is part of the lustre_msg_v1 header. b=14043
*/
int lustre_msg_size(__u32 magic, int count, __u32 *lens)
{
__u32 size[] = { sizeof(struct ptlrpc_body) };
......@@ -157,7 +158,8 @@ int lustre_msg_size(__u32 magic, int count, __u32 *lens)
EXPORT_SYMBOL(lustre_msg_size);
/* This is used to determine the size of a buffer that was already packed
* and will correctly handle the different message formats. */
* and will correctly handle the different message formats.
*/
int lustre_packed_msg_size(struct lustre_msg *msg)
{
switch (msg->lm_magic) {
......@@ -267,7 +269,8 @@ lustre_get_emerg_rs(struct ptlrpc_service_part *svcpt)
spin_unlock(&svcpt->scp_rep_lock);
/* If we cannot get anything for some long time, we better
* bail out instead of waiting infinitely */
* bail out instead of waiting infinitely
*/
lwi = LWI_TIMEOUT(cfs_time_seconds(10), NULL, NULL);
rc = l_wait_event(svcpt->scp_rep_waitq,
!list_empty(&svcpt->scp_rep_idle), &lwi);
......@@ -676,7 +679,8 @@ int lustre_msg_buflen(struct lustre_msg *m, int n)
EXPORT_SYMBOL(lustre_msg_buflen);
/* NB return the bufcount for lustre_msg_v2 format, so if message is packed
* in V1 format, the result is one bigger. (add struct ptlrpc_body). */
* in V1 format, the result is one bigger. (add struct ptlrpc_body).
*/
int lustre_msg_bufcount(struct lustre_msg *m)
{
switch (m->lm_magic) {
......@@ -797,7 +801,8 @@ __u32 lustre_msg_get_flags(struct lustre_msg *msg)
/* no break */
default:
/* flags might be printed in debug code while message
* uninitialized */
* uninitialized
*/
return 0;
}
}
......@@ -1030,7 +1035,8 @@ int lustre_msg_get_status(struct lustre_msg *msg)
/* no break */
default:
/* status might be printed in debug code while message
* uninitialized */
* uninitialized
*/
return -EINVAL;
}
}
......@@ -1366,7 +1372,8 @@ void lustre_msg_set_jobid(struct lustre_msg *msg, char *jobid)
struct ptlrpc_body *pb;
/* Don't set jobid for ldlm ast RPCs, they've been shrunk.
* See the comment in ptlrpc_request_pack(). */
* See the comment in ptlrpc_request_pack().
*/
if (!opc || opc == LDLM_BL_CALLBACK ||
opc == LDLM_CP_CALLBACK || opc == LDLM_GL_CALLBACK)
return;
......@@ -1486,7 +1493,8 @@ void lustre_swab_ptlrpc_body(struct ptlrpc_body *b)
* clients and servers without ptlrpc_body_v2 (< 2.3)
* do not swab any fields beyond pb_jobid, as we are
* using this swab function for both ptlrpc_body
* and ptlrpc_body_v2. */
* and ptlrpc_body_v2.
*/
CLASSERT(offsetof(typeof(*b), pb_jobid) != 0);
}
EXPORT_SYMBOL(lustre_swab_ptlrpc_body);
......@@ -1500,7 +1508,8 @@ void lustre_swab_connect(struct obd_connect_data *ocd)
__swab32s(&ocd->ocd_index);
__swab32s(&ocd->ocd_brw_size);
/* ocd_blocksize and ocd_inodespace don't need to be swabbed because
* they are 8-byte values */
* they are 8-byte values
*/
__swab16s(&ocd->ocd_grant_extent);
__swab32s(&ocd->ocd_unused);
__swab64s(&ocd->ocd_transno);
......@@ -1510,7 +1519,8 @@ void lustre_swab_connect(struct obd_connect_data *ocd)
/* Fields after ocd_cksum_types are only accessible by the receiver
* if the corresponding flag in ocd_connect_flags is set. Accessing
* any field after ocd_maxbytes on the receiver without a valid flag
* may result in out-of-bound memory access and kernel oops. */
* may result in out-of-bound memory access and kernel oops.
*/
if (ocd->ocd_connect_flags & OBD_CONNECT_MAX_EASIZE)
__swab32s(&ocd->ocd_max_easize);
if (ocd->ocd_connect_flags & OBD_CONNECT_MAXBYTES)
......@@ -1970,7 +1980,8 @@ static void lustre_swab_ldlm_policy_data(ldlm_wire_policy_data_t *d)
{
/* the lock data is a union and the first two fields are always an
* extent so it's ok to process an LDLM_EXTENT and LDLM_FLOCK lock
* data the same way. */
* data the same way.
*/
__swab64s(&d->l_extent.start);
__swab64s(&d->l_extent.end);
__swab64s(&d->l_extent.gid);
......
......@@ -257,11 +257,12 @@ static int ptlrpc_pinger_main(void *arg)
/* Wait until the next ping time, or until we're stopped. */
time_to_next_wake = pinger_check_timeout(this_ping);
/* The ping sent by ptlrpc_send_rpc may get sent out
say .01 second after this.
ptlrpc_pinger_sending_on_import will then set the
next ping time to next_ping + .01 sec, which means
we will SKIP the next ping at next_ping, and the
ping will get sent 2 timeouts from now! Beware. */
* say .01 second after this.
* ptlrpc_pinger_sending_on_import will then set the
* next ping time to next_ping + .01 sec, which means
* we will SKIP the next ping at next_ping, and the
* ping will get sent 2 timeouts from now! Beware.
*/
CDEBUG(D_INFO, "next wakeup in " CFS_DURATION_T " (%ld)\n",
time_to_next_wake,
cfs_time_add(this_ping,
......
......@@ -101,8 +101,6 @@ struct nrs_core {
* registration/unregistration, and NRS core lprocfs operations.
*/
struct mutex nrs_mutex;
/* XXX: This is just for liblustre. Remove the #if defined directive
* when the * "cfs_" prefix is dropped from cfs_list_head. */
/**
* List of all policy descriptors registered with NRS core; protected
* by nrs_core::nrs_mutex.
......
......@@ -241,7 +241,8 @@ void ptlrpcd_add_req(struct ptlrpc_request *req)
l_wait_event(req->rq_set_waitq, !req->rq_set, &lwi);
} else if (req->rq_set) {
/* If we have a valid "rq_set", just reuse it to avoid double
* linked. */
* linked.
*/
LASSERT(req->rq_phase == RQ_PHASE_NEW);
LASSERT(req->rq_send_state == LUSTRE_IMP_REPLAY);
......@@ -319,7 +320,8 @@ static int ptlrpcd_check(struct lu_env *env, struct ptlrpcd_ctl *pc)
rc |= ptlrpc_check_set(env, set);
/* NB: ptlrpc_check_set has already moved completed request at the
* head of seq::set_requests */
* head of seq::set_requests
*/
list_for_each_safe(pos, tmp, &set->set_requests) {
req = list_entry(pos, struct ptlrpc_request, rq_set_chain);
if (req->rq_phase != RQ_PHASE_COMPLETE)
......@@ -337,7 +339,8 @@ static int ptlrpcd_check(struct lu_env *env, struct ptlrpcd_ctl *pc)
rc = atomic_read(&set->set_new_count);
/* If we have nothing to do, check whether we can take some
* work from our partner threads. */
* work from our partner threads.
*/
if (rc == 0 && pc->pc_npartners > 0) {
struct ptlrpcd_ctl *partner;
struct ptlrpc_request_set *ps;
......
......@@ -114,7 +114,8 @@ int ptlrpc_replay_next(struct obd_import *imp, int *inflight)
if (req->rq_transno > last_transno) {
/* Since the imp_committed_list is immutable before
* all of it's requests being replayed, it's safe to
* use a cursor to accelerate the search */
* use a cursor to accelerate the search
*/
imp->imp_replay_cursor = imp->imp_replay_cursor->next;
while (imp->imp_replay_cursor !=
......@@ -137,7 +138,8 @@ int ptlrpc_replay_next(struct obd_import *imp, int *inflight)
}
/* All the requests in committed list have been replayed, let's replay
* the imp_replay_list */
* the imp_replay_list
*/
if (!req) {
list_for_each_safe(tmp, pos, &imp->imp_replay_list) {
req = list_entry(tmp, struct ptlrpc_request,
......@@ -152,7 +154,8 @@ int ptlrpc_replay_next(struct obd_import *imp, int *inflight)
/* If need to resend the last sent transno (because a reconnect
* has occurred), then stop on the matching req and send it again.
* If, however, the last sent transno has been committed then we
* continue replay from the next request. */
* continue replay from the next request.
*/
if (req && imp->imp_resend_replay)
lustre_msg_add_flags(req->rq_reqmsg, MSG_RESENT);
......@@ -249,7 +252,8 @@ void ptlrpc_request_handle_notconn(struct ptlrpc_request *failed_req)
}
/* Wait for recovery to complete and resend. If evicted, then
this request will be errored out later.*/
* this request will be errored out later.
*/
spin_lock(&failed_req->rq_lock);
if (!failed_req->rq_no_resend)
failed_req->rq_resend = 1;
......@@ -271,13 +275,15 @@ int ptlrpc_set_import_active(struct obd_import *imp, int active)
LASSERT(obd);
/* When deactivating, mark import invalid, and abort in-flight
* requests. */
* requests.
*/
if (!active) {
LCONSOLE_WARN("setting import %s INACTIVE by administrator request\n",
obd2cli_tgt(imp->imp_obd));
/* set before invalidate to avoid messages about imp_inval
* set without imp_deactive in ptlrpc_import_delay_req */
* set without imp_deactive in ptlrpc_import_delay_req
*/
spin_lock(&imp->imp_lock);
imp->imp_deactive = 1;
spin_unlock(&imp->imp_lock);
......
......@@ -445,7 +445,8 @@ int sptlrpc_req_ctx_switch(struct ptlrpc_request *req,
/* alloc new request buffer
* we don't need to alloc reply buffer here, leave it to the
* rest procedure of ptlrpc */
* rest procedure of ptlrpc
*/
if (reqmsg_size != 0) {
rc = sptlrpc_cli_alloc_reqbuf(req, reqmsg_size);
if (!rc) {
......@@ -798,7 +799,8 @@ void sptlrpc_req_set_flavor(struct ptlrpc_request *req, int opcode)
spin_unlock(&sec->ps_lock);
/* force SVC_NULL for context initiation rpc, SVC_INTG for context
* destruction rpc */
* destruction rpc
*/
if (unlikely(req->rq_ctx_init))
flvr_set_svc(&req->rq_flvr.sf_rpc, SPTLRPC_SVC_NULL);
else if (unlikely(req->rq_ctx_fini))
......@@ -1688,7 +1690,8 @@ int sptlrpc_target_export_check(struct obd_export *exp,
return 0;
/* client side export has no imp_reverse, skip
* FIXME maybe we should check flavor this as well??? */
* FIXME maybe we should check flavor this as well???
*/
if (!exp->exp_imp_reverse)
return 0;
......@@ -1702,11 +1705,13 @@ int sptlrpc_target_export_check(struct obd_export *exp,
* the first req with the new flavor, then treat it as current flavor,
* adapt reverse sec according to it.
* note the first rpc with new flavor might not be with root ctx, in
* which case delay the sec_adapt by leaving exp_flvr_adapt == 1. */
* which case delay the sec_adapt by leaving exp_flvr_adapt == 1.
*/
if (unlikely(exp->exp_flvr_changed) &&
flavor_allowed(&exp->exp_flvr_old[1], req)) {
/* make the new flavor as "current", and old ones as
* about-to-expire */
* about-to-expire
*/
CDEBUG(D_SEC, "exp %p: just changed: %x->%x\n", exp,
exp->exp_flvr.sf_rpc, exp->exp_flvr_old[1].sf_rpc);
flavor = exp->exp_flvr_old[1];
......@@ -1742,10 +1747,12 @@ int sptlrpc_target_export_check(struct obd_export *exp,
}
/* if it equals to the current flavor, we accept it, but need to
* dealing with reverse sec/ctx */
* dealing with reverse sec/ctx
*/
if (likely(flavor_allowed(&exp->exp_flvr, req))) {
/* most cases should return here, we only interested in
* gss root ctx init */
* gss root ctx init
*/
if (!req->rq_auth_gss || !req->rq_ctx_init ||
(!req->rq_auth_usr_root && !req->rq_auth_usr_mdt &&
!req->rq_auth_usr_ost)) {
......@@ -1755,7 +1762,8 @@ int sptlrpc_target_export_check(struct obd_export *exp,
/* if flavor just changed, we should not proceed, just leave
* it and current flavor will be discovered and replaced
* shortly, and let _this_ rpc pass through */
* shortly, and let _this_ rpc pass through
*/
if (exp->exp_flvr_changed) {
LASSERT(exp->exp_flvr_adapt);
spin_unlock(&exp->exp_lock);
......@@ -1809,7 +1817,8 @@ int sptlrpc_target_export_check(struct obd_export *exp,
}
/* now it doesn't match the current flavor, the only chance we can
* accept it is match the old flavors which is not expired. */
* accept it is match the old flavors which is not expired.
*/
if (exp->exp_flvr_changed == 0 && exp->exp_flvr_expire[1]) {
if (exp->exp_flvr_expire[1] >= ktime_get_real_seconds()) {
if (flavor_allowed(&exp->exp_flvr_old[1], req)) {
......
......@@ -166,11 +166,13 @@ static int sec_gc_main(void *arg)
* is not optimal. we perhaps want to use balanced binary tree
* to trace each sec as order of expiry time.
* another issue here is we wakeup as fixed interval instead of
* according to each sec's expiry time */
* according to each sec's expiry time
*/
mutex_lock(&sec_gc_mutex);
list_for_each_entry(sec, &sec_gc_list, ps_gc_list) {
/* if someone is waiting to be deleted, let it
* proceed as soon as possible. */
* proceed as soon as possible.
*/
if (atomic_read(&sec_gc_wait_del)) {
CDEBUG(D_SEC, "deletion pending, start over\n");
mutex_unlock(&sec_gc_mutex);
......
......@@ -258,7 +258,8 @@ int null_enlarge_reqbuf(struct ptlrpc_sec *sec,
* imp_replay_list traversing threads. See LU-3333
* This is a bandaid at best, we really need to deal with this
* in request enlarging code before unpacking that's already
* there */
* there
*/
if (req->rq_import)
spin_lock(&req->rq_import->imp_lock);
memcpy(newbuf, req->rq_reqbuf, req->rq_reqlen);
......
......@@ -264,7 +264,8 @@ int plain_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
}
} else {
/* whether we sent with bulk or not, we expect the same
* in reply, except for early reply */
* in reply, except for early reply
*/
if (!req->rq_early &&
!equi(req->rq_pack_bulk == 1,
phdr->ph_flags & PLAIN_FL_BULK)) {
......@@ -673,7 +674,8 @@ int plain_enlarge_reqbuf(struct ptlrpc_sec *sec,
* imp_replay_list traversing threads. See LU-3333
* This is a bandaid at best, we really need to deal with this
* in request enlarging code before unpacking that's already
* there */
* there
*/
if (req->rq_import)
spin_lock(&req->rq_import->imp_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment