1*1ae08745Sheppo /*
2*1ae08745Sheppo  * CDDL HEADER START
3*1ae08745Sheppo  *
4*1ae08745Sheppo  * The contents of this file are subject to the terms of the
5*1ae08745Sheppo  * Common Development and Distribution License (the "License").
6*1ae08745Sheppo  * You may not use this file except in compliance with the License.
7*1ae08745Sheppo  *
8*1ae08745Sheppo  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*1ae08745Sheppo  * or http://www.opensolaris.org/os/licensing.
10*1ae08745Sheppo  * See the License for the specific language governing permissions
11*1ae08745Sheppo  * and limitations under the License.
12*1ae08745Sheppo  *
13*1ae08745Sheppo  * When distributing Covered Code, include this CDDL HEADER in each
14*1ae08745Sheppo  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*1ae08745Sheppo  * If applicable, add the following below this CDDL HEADER, with the
16*1ae08745Sheppo  * fields enclosed by brackets "[]" replaced with your own identifying
17*1ae08745Sheppo  * information: Portions Copyright [yyyy] [name of copyright owner]
18*1ae08745Sheppo  *
19*1ae08745Sheppo  * CDDL HEADER END
20*1ae08745Sheppo  */
21*1ae08745Sheppo 
22*1ae08745Sheppo /*
23*1ae08745Sheppo  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*1ae08745Sheppo  * Use is subject to license terms.
25*1ae08745Sheppo  */
26*1ae08745Sheppo 
27*1ae08745Sheppo #include <sys/types.h>
28*1ae08745Sheppo #include <sys/param.h>
29*1ae08745Sheppo #include <sys/mdesc.h>
30*1ae08745Sheppo #include <sys/mdesc_impl.h>
31*1ae08745Sheppo 
32*1ae08745Sheppo uint64_t
md_get_gen(md_t * ptr)33*1ae08745Sheppo md_get_gen(md_t *ptr)
34*1ae08745Sheppo {
35*1ae08745Sheppo 	md_impl_t *mdp;
36*1ae08745Sheppo 
37*1ae08745Sheppo 	mdp = (md_impl_t *)ptr;
38*1ae08745Sheppo 
39*1ae08745Sheppo 	if (mdp == NULL)
40*1ae08745Sheppo 		return (MDESC_INVAL_GEN);
41*1ae08745Sheppo 
42*1ae08745Sheppo 	return (mdp->gen);
43*1ae08745Sheppo }
44