* Another user is readpage for MDT.
*/
struct ptlrpc_bulk_desc {
+ unsigned int bd_refs; /* number MD's assigned including zero-sends */
/** completed with failure */
unsigned long bd_failure:1;
/** client side */
LASSERT(desc != NULL);
spin_lock(&desc->bd_lock);
- rc = desc->bd_md_count;
+ rc = desc->bd_refs;
spin_unlock(&desc->bd_lock);
return rc;
}
spin_lock(&desc->bd_lock);
- rc = desc->bd_md_count;
+ rc = desc->bd_refs;
spin_unlock(&desc->bd_lock);
return rc;
}
spin_lock(&desc->bd_lock);
req = desc->bd_req;
- LASSERT(desc->bd_md_count > 0);
- desc->bd_md_count--;
+ LASSERT(desc->bd_refs > 0);
+ desc->bd_refs--;
if (ev->type != LNET_EVENT_UNLINK && ev->status == 0) {
desc->bd_nob_transferred += ev->mlength;
/* NB don't unlock till after wakeup; desc can disappear under us
* otherwise */
- if (desc->bd_md_count == 0)
+ if (desc->bd_refs == 0)
ptlrpc_client_wake_req(desc->bd_req);
spin_unlock(&desc->bd_lock);
spin_lock(&desc->bd_lock);
- LASSERT(desc->bd_md_count > 0);
+ LASSERT(desc->bd_refs > 0);
if ((ev->type == LNET_EVENT_ACK ||
ev->type == LNET_EVENT_REPLY) &&
desc->bd_failure = 1;
if (ev->unlinked) {
- desc->bd_md_count--;
+ desc->bd_refs--;
/* This is the last callback no matter what... */
- if (desc->bd_md_count == 0)
+ if (desc->bd_refs == 0)
wake_up(&desc->bd_waitq);
}
* off high bits to get bulk count for this RPC. LU-1431 */
mbits = desc->bd_req->rq_mbits & ~((__u64)desc->bd_md_max_brw - 1);
total_md = desc->bd_req->rq_mbits - mbits + 1;
-
- desc->bd_md_count = total_md;
+ desc->bd_refs = total_md;
desc->bd_failure = 0;
md.user_ptr = &desc->bd_cbid;
* event this creates will signal completion with failure,
* so we return SUCCESS here! */
spin_lock(&desc->bd_lock);
- desc->bd_md_count -= total_md - posted_md;
+ desc->bd_refs -= total_md - posted_md;
spin_unlock(&desc->bd_lock);
- LASSERT(desc->bd_md_count >= 0);
+ LASSERT(desc->bd_refs >= 0);
mdunlink_iterate_helper(desc->bd_mds, posted_md);
RETURN(0);
desc->bd_registered = 1;
desc->bd_last_mbits = mbits;
- desc->bd_md_count = total_md;
+ desc->bd_refs = total_md;
md.user_ptr = &desc->bd_cbid;
md.handler = ptlrpc_handler;
md.threshold = 1; /* PUT or GET */
if (rc != 0) {
LASSERT(rc == -ENOMEM);
spin_lock(&desc->bd_lock);
- desc->bd_md_count -= total_md - posted_md;
+ desc->bd_refs -= total_md - posted_md;
spin_unlock(&desc->bd_lock);
- LASSERT(desc->bd_md_count >= 0);
+ LASSERT(desc->bd_refs >= 0);
mdunlink_iterate_helper(desc->bd_mds, desc->bd_md_max_brw);
req->rq_status = -ENOMEM;
desc->bd_registered = 0;
spin_lock(&desc->bd_lock);
/* Holler if peer manages to touch buffers before he knows the mbits */
- if (desc->bd_md_count != total_md)
+ if (desc->bd_refs != total_md)
CWARN("%s: Peer %s touched %d buffers while I registered\n",
desc->bd_import->imp_obd->obd_name, libcfs_id2str(peer),
- total_md - desc->bd_md_count);
+ total_md - desc->bd_refs);
spin_unlock(&desc->bd_lock);
- CDEBUG(D_NET, "Setup %u bulk %s buffers: %u pages %u bytes, "
- "mbits x%#llx-%#llx, portal %u\n", desc->bd_md_count,
+ CDEBUG(D_NET,
+ "Setup %u bulk %s buffers: %u pages %u bytes, mbits x%#llx-%#llx, portal %u\n",
+ desc->bd_refs,
ptlrpc_is_bulk_op_get(desc->bd_type) ? "get-source" : "put-sink",
desc->bd_iov_count, desc->bd_nob,
desc->bd_last_mbits, req->rq_mbits, desc->bd_portal);