/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <kvm.h>
#include <kstat.h>
#include <nfs/nfs_clnt.h>
#include <inttypes.h>
#include "libfsmgt.h"
#include "replica.h"
#define IGNORE 0
/*
* Private variables
*/
/*
* Private method declarations
*/
static int ignore(char *);
static int get_kstat_info(nfs_mntlist_t *, int *);
/*
* Public methods
*/
void
{
int i;
for (i = 0; i < list->nml_failovercount; i++) {
}
}
} /* nfs_free_mntinfo_list */
if (fs_mount_list == NULL) {
return (NULL);
}
return (NULL);
}
return (nfs_mount_list);
} /* nfs_get_filtered_mount_list */
{
if (fs_mount_list == NULL) {
return (NULL);
}
return (NULL);
}
return (nfs_mount_list);
} /* nfs_get_mount_by_mntopt */
{
return (NULL);
}
return (NULL);
}
return (nfs_mount_list);
} /* nfs_get_mount_list */
/*
* Private methods
*/
static int
{
return (-1);
}
/*
* Each kstat consists of header and data sections that are
* connected as a "chain" or linked list of kstat stuctures.
* The kc_chain used here is the pointer to the global kstat
* chain (or the head of the chain of kstat's).
*/
== -1) {
return (-1);
}
}
}
return (0);
} /* get_kstat_info */
static int
{
if (mrp == 0) {
return (0);
}
return (-1);
}
>= KNC_STRSIZE) {
return (-1);
}
>= SYS_NMLN) {
return (-1);
}
/*
* get the secmode name from /etc/nfssec.conf.
*/
} else {
}
mrp->nml_directio =
return (0);
}
/*
* MAXMIN is used to retrieve the minor number
* which is compared to the kstat instance.
* If they are the same then this is an instance
* for which mount information is needed.
* MAXMIN is the maximum minor number and is
* defined in mkdev.h.
*/
mrp = nfs_mntinfo;
}
return (mrp);
}
static nfs_mntlist_t *
/* ignore non "nfs" and the "ignore" entries */
continue;
}
return (NULL);
}
} else {
}
}
return (NULL);
}
return (headptr);
} /* get_nfs_info */
static nfs_mntlist_t *
int i, server_count = 0;
return (NULL);
}
} else {
return (NULL);
}
== NULL) {
return (NULL);
}
if ((rep_list =
return (NULL);
}
if ((mrp->nml_failoverlist =
return (NULL);
}
for (i = 0; i < server_count; i++) {
mrp->nml_failoverlist[i] =
if (!mrp->nml_failoverlist[i]) {
return (NULL);
}
}
/*
* If the number of servers is not 1 then resource is
* either a failover list or there is an error. In either
* case the path can't be determined and curpath is set to
* unknown".
*/
if (server_count == 1) {
char *path;
char *last;
} else {
/*
* If NULL is returned this is an
* invalid path entry. no path can
* be determined.
*/
}
} else {
':') + 1));
}
} else {
/*
* more than one server in the failover list
* path can't be determined.
*/
}
for (i = 0; i < server_count; i++) {
}
}
}
return (NULL);
}
return (NULL);
}
return (NULL);
}
return (NULL);
}
if (fsmnt_list->overlayed) {
} else {
}
return (mrp);
} /* get_mount_data */
void *data,
int *errp)
{
if (kstat_chain_id == -1) {
return (-1);
}
return (kstat_chain_id);
} /* safe_kstat_read */
/*
* ignore - Checks for the ignore mount option in the mount opts string.
* Returns 1 if the ignore option is found and 0 if not.
*/
static int
{
char *value;
char *s;
char *tmp;
return (0);
if (s == NULL)
return (0);
tmp = s;
while (*s != '\0') {
return (1);
}
}
return (0);
} /* ignore */