- req->rq_reqbuf->lm_secflvr = SPTLRPC_FLVR_NULL;
-
- if (!req->rq_import->imp_dlm_fake) {
- struct obd_device *obd = req->rq_import->imp_obd;
- null_encode_sec_part(req->rq_reqbuf,
- obd->u.cli.cl_sp_me);
- }
- req->rq_reqdata_len = req->rq_reqlen;
- return 0;
+ req->rq_reqbuf->lm_secflvr = SPTLRPC_FLVR_NULL;
+
+ if (!req->rq_import->imp_dlm_fake) {
+ struct obd_device *obd = req->rq_import->imp_obd;
+
+ null_encode_sec_part(req->rq_reqbuf,
+ obd->u.cli.cl_sp_me);
+ }
+ req->rq_reqdata_len = req->rq_reqlen;
+ return 0;
- if (cksumc != cksums) {
- CDEBUG(D_SEC,
- "early reply checksum mismatch: %08x != %08x\n",
- cksumc, cksums);
- return -EINVAL;
- }
- }
+ if (cksumc != cksums) {
+ CDEBUG(D_SEC,
+ "early reply checksum mismatch: %08x != %08x\n",
+ cksumc, cksums);
+ return -EINVAL;
+ }
+ }
- struct ptlrpc_svc_ctx *svc_ctx,
- struct sptlrpc_flavor *sf)
+ struct ptlrpc_svc_ctx *svc_ctx,
+ struct sptlrpc_flavor *sf)
- LASSERT(SPTLRPC_FLVR_POLICY(sf->sf_rpc) == SPTLRPC_POLICY_NULL);
-
- /* general layer has take a module reference for us, because we never
- * really destroy the sec, simply release the reference here.
- */
- sptlrpc_policy_put(&null_policy);
- return &null_sec;
+ LASSERT(SPTLRPC_FLVR_POLICY(sf->sf_rpc) == SPTLRPC_POLICY_NULL);
+
+ /*
+ * general layer has take a module reference for us, because we never
+ * really destroy the sec, simply release the reference here.
+ */
+ sptlrpc_policy_put(&null_policy);
+ return &null_sec;
- struct vfs_cred *vcred,
- int create, int remove_dead)
+ struct vfs_cred *vcred,
+ int create, int remove_dead)
- if (!req->rq_pool) {
- LASSERTF(req->rq_reqmsg == req->rq_reqbuf,
- "req %p: reqmsg %p is not reqbuf %p in null sec\n",
- req, req->rq_reqmsg, req->rq_reqbuf);
- LASSERTF(req->rq_reqbuf_len >= req->rq_reqlen,
- "req %p: reqlen %d should smaller than buflen %d\n",
- req, req->rq_reqlen, req->rq_reqbuf_len);
-
- OBD_FREE_LARGE(req->rq_reqbuf, req->rq_reqbuf_len);
- req->rq_reqbuf = NULL;
- req->rq_reqbuf_len = 0;
- }
+ if (!req->rq_pool) {
+ LASSERTF(req->rq_reqmsg == req->rq_reqbuf,
+ "req %p: reqmsg %p is not reqbuf %p in null sec\n",
+ req, req->rq_reqmsg, req->rq_reqbuf);
+ LASSERTF(req->rq_reqbuf_len >= req->rq_reqlen,
+ "req %p: reqlen %d should smaller than buflen %d\n",
+ req, req->rq_reqlen, req->rq_reqbuf_len);
+
+ OBD_FREE_LARGE(req->rq_reqbuf, req->rq_reqbuf_len);
+ req->rq_reqbuf = NULL;
+ req->rq_reqbuf_len = 0;
+ }
- OBD_FREE_LARGE(req->rq_repbuf, req->rq_repbuf_len);
- req->rq_repbuf = NULL;
- req->rq_repbuf_len = 0;
+ OBD_FREE_LARGE(req->rq_repbuf, req->rq_repbuf_len);
+ req->rq_repbuf = NULL;
+ req->rq_repbuf_len = 0;
- struct ptlrpc_request *req,
- int segment, int newsize)
+ struct ptlrpc_request *req,
+ int segment, int newsize)
- struct lustre_msg *newbuf;
- struct lustre_msg *oldbuf = req->rq_reqmsg;
- int oldsize, newmsg_size, alloc_size;
+ struct lustre_msg *newbuf;
+ struct lustre_msg *oldbuf = req->rq_reqmsg;
+ int oldsize, newmsg_size, alloc_size;
- LASSERT(req->rq_reqbuf);
- LASSERT(req->rq_reqbuf == req->rq_reqmsg);
- LASSERT(req->rq_reqbuf_len >= req->rq_reqlen);
- LASSERT(req->rq_reqlen == lustre_packed_msg_size(oldbuf));
+ LASSERT(req->rq_reqbuf);
+ LASSERT(req->rq_reqbuf == req->rq_reqmsg);
+ LASSERT(req->rq_reqbuf_len >= req->rq_reqlen);
+ LASSERT(req->rq_reqlen == lustre_packed_msg_size(oldbuf));
- /* compute new message size */
- oldsize = req->rq_reqbuf->lm_buflens[segment];
- req->rq_reqbuf->lm_buflens[segment] = newsize;
- newmsg_size = lustre_packed_msg_size(oldbuf);
- req->rq_reqbuf->lm_buflens[segment] = oldsize;
+ /* compute new message size */
+ oldsize = req->rq_reqbuf->lm_buflens[segment];
+ req->rq_reqbuf->lm_buflens[segment] = newsize;
+ newmsg_size = lustre_packed_msg_size(oldbuf);
+ req->rq_reqbuf->lm_buflens[segment] = oldsize;
- /* request from pool should always have enough buffer */
- LASSERT(!req->rq_pool || req->rq_reqbuf_len >= newmsg_size);
+ /* request from pool should always have enough buffer */
+ LASSERT(!req->rq_pool || req->rq_reqbuf_len >= newmsg_size);
* rq_reqmsg is not racing with parallel processing of
* 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
* rq_reqmsg is not racing with parallel processing of
* 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
if (req->rq_import)
spin_lock(&req->rq_import->imp_lock);
memcpy(newbuf, req->rq_reqbuf, req->rq_reqlen);
if (req->rq_import)
spin_lock(&req->rq_import->imp_lock);
memcpy(newbuf, req->rq_reqbuf, req->rq_reqlen);
- _sptlrpc_enlarge_msg_inplace(req->rq_reqmsg, segment, newsize);
- req->rq_reqlen = newmsg_size;
+ _sptlrpc_enlarge_msg_inplace(req->rq_reqmsg, segment, newsize);
+ req->rq_reqlen = newmsg_size;
}
static struct ptlrpc_svc_ctx null_svc_ctx = {
.sc_refcount = ATOMIC_INIT(1),
}
static struct ptlrpc_svc_ctx null_svc_ctx = {
.sc_refcount = ATOMIC_INIT(1),
- if (likely(req->rq_packed_final)) {
- if (lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT)
- req->rq_reply_off = lustre_msg_early_size();
- else
- req->rq_reply_off = 0;
- } else {
- __u32 cksum;
+ if (likely(req->rq_packed_final)) {
+ if (lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT)
+ req->rq_reply_off = lustre_msg_early_size();
+ else
+ req->rq_reply_off = 0;
+ } else {
+ __u32 cksum;
cksum = lustre_msg_calc_cksum(rs->rs_repbuf);
lustre_msg_set_cksum(rs->rs_repbuf, cksum);
cksum = lustre_msg_calc_cksum(rs->rs_repbuf);
lustre_msg_set_cksum(rs->rs_repbuf, cksum);
- .refresh = null_ctx_refresh,
- .sign = null_ctx_sign,
- .verify = null_ctx_verify,
+ .refresh = null_ctx_refresh,
+ .sign = null_ctx_sign,
+ .verify = null_ctx_verify,
- .create_sec = null_create_sec,
- .destroy_sec = null_destroy_sec,
- .lookup_ctx = null_lookup_ctx,
- .flush_ctx_cache = null_flush_ctx_cache,
- .alloc_reqbuf = null_alloc_reqbuf,
- .alloc_repbuf = null_alloc_repbuf,
- .free_reqbuf = null_free_reqbuf,
- .free_repbuf = null_free_repbuf,
- .enlarge_reqbuf = null_enlarge_reqbuf,
+ .create_sec = null_create_sec,
+ .destroy_sec = null_destroy_sec,
+ .lookup_ctx = null_lookup_ctx,
+ .flush_ctx_cache = null_flush_ctx_cache,
+ .alloc_reqbuf = null_alloc_reqbuf,
+ .alloc_repbuf = null_alloc_repbuf,
+ .free_reqbuf = null_free_reqbuf,
+ .free_repbuf = null_free_repbuf,
+ .enlarge_reqbuf = null_enlarge_reqbuf,
- .accept = null_accept,
- .alloc_rs = null_alloc_rs,
- .authorize = null_authorize,
- .free_rs = null_free_rs,
+ .accept = null_accept,
+ .alloc_rs = null_alloc_rs,
+ .authorize = null_authorize,
+ .free_rs = null_free_rs,
- .sp_owner = THIS_MODULE,
- .sp_name = "sec.null",
- .sp_policy = SPTLRPC_POLICY_NULL,
- .sp_cops = &null_sec_cops,
- .sp_sops = &null_sec_sops,
+ .sp_owner = THIS_MODULE,
+ .sp_name = "sec.null",
+ .sp_policy = SPTLRPC_POLICY_NULL,
+ .sp_cops = &null_sec_cops,
+ .sp_sops = &null_sec_sops,
- rc = sptlrpc_register_policy(&null_policy);
- if (rc)
- CERROR("failed to register %s: %d\n", null_policy.sp_name, rc);
+ rc = sptlrpc_register_policy(&null_policy);
+ if (rc)
+ CERROR("failed to register %s: %d\n", null_policy.sp_name, rc);
- rc = sptlrpc_unregister_policy(&null_policy);
- if (rc)
- CERROR("failed to unregister %s: %d\n", null_policy.sp_name,rc);
+ rc = sptlrpc_unregister_policy(&null_policy);
+ if (rc)
+ CERROR("failed to unregister %s: %d\n", null_policy.sp_name,
+ rc);