2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License, Version 1.0 only 2N/A * (the "License"). You may not use this file except in compliance 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved. 2N/A * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A * PURPOSE: DAT registry implementation for uDAPL 2N/A * Description: init and fini functions for DAT module. 2N/A * Ideally, the following two rules could be enforced: 2N/A * - The DAT Registry's initialization function is executed before that 2N/A * of any DAT Providers and hence all calls into the registry occur 2N/A * after the registry module is initialized. 2N/A * - The DAT Registry's deinitialization function is executed after that 2N/A * of any DAT Providers and hence all calls into the registry occur 2N/A * before the registry module is deinitialized. 2N/A * However, on many platforms few guarantees are provided regarding the 2N/A * order in which modules initialization and deinitialization functions 2N/A * To understand why these rules are difficult to enforce using only 2N/A * features common to all platforms, consider the Linux platform. The order 2N/A * in which Linux shared libraries are loaded into a process's address space 2N/A * is undefined. When a DAT consumer explicitly links to DAT provider 2N/A * libraries, the order in which library initialization and deinitialization 2N/A * functions are invoked becomes important. For example if the DAPL provider 2N/A * calls dat_registry_add_provider() before the registry has been initialized, 2N/A * an error will occur. 2N/A * We assume that modules are loaded with a single thread. Given 2N/A * this assumption, we can use a simple state variable to determine 2N/A * the state of the DAT registry. 2N/A * Function: dat_module_get_state 2N/A * Function: dat_init 2N/A * update the module state flag immediately in case there 2N/A * is a recursive call to dat_init(). 2N/A "DAT Registry: Started (dat_init)\n");
2N/A * Function: dat_fini 2N/A "DAT Registry: Stopped (dat_fini)\n");