9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * CDDL HEADER START
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * The contents of this file are subject to the terms of the
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Common Development and Distribution License (the "License").
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * You may not use this file except in compliance with the License.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * See the License for the specific language governing permissions
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * and limitations under the License.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * When distributing Covered Code, include this CDDL HEADER in each
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * If applicable, add the following below this CDDL HEADER, with the
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * fields enclosed by brackets "[]" replaced with your own identifying
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * information: Portions Copyright [yyyy] [name of copyright owner]
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * CDDL HEADER END
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Use is subject to license terms.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * PURPOSE: Memory management support routines
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Description: Support routines for LMR functions
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor /* Allocate LMR */
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor lmr = (DAPL_LMR *)dapl_os_alloc(sizeof (DAPL_LMR));
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor /* zero the structure */
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * initialize the header
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor dapl_llist_init_entry(&lmr->header.ia_list_entry);
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * initialize the body
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor /* reset magic to prevent reuse */
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylordapl_lmr_convert_privileges(IN DAT_MEM_PRIV_FLAGS privileges)
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * if (DAT_MEM_PRIV_LOCAL_READ_FLAG & privileges)
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * do nothing
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor if (DAT_MEM_PRIV_LOCAL_WRITE_FLAG & privileges) {
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor if (DAT_MEM_PRIV_REMOTE_READ_FLAG & privileges) {
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor if (DAT_MEM_PRIV_REMOTE_WRITE_FLAG & privileges) {