/* The application passes us an address range it wants to enable RDMA to/from. We map the area, and save the <R_Key,offset> pair in rm->m_rdma_cookie. This causes it to be sent along to the peer in an extension header.  */
int rds_cmsg_rdma_map(struct rds_sock *rs, struct rds_message *rm, struct cmsghdr *cmsg)
/* The application passes us an address range it wants to enable RDMA to/from. We map the area, and save the <R_Key,offset> pair in rm->m_rdma_cookie. This causes it to be sent along to the peer in an extension header.  */
int rds_cmsg_rdma_map(struct rds_sock *rs, struct rds_message *rm, struct cmsghdr *cmsg)
{
	if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct rds_get_mr_args)) ||
	    rm->m_rdma_cookie != 0)
		return -EINVAL;
	return __rds_rdma_map(rs, CMSG_DATA(cmsg), &rm->m_rdma_cookie, &rm->m_rdma_mr);
}