1214048Srmacklem/*-
2214048Srmacklem * Copyright (c) 2009 Rick Macklem, University of Guelph
3214048Srmacklem * All rights reserved.
4214048Srmacklem *
5214048Srmacklem * Redistribution and use in source and binary forms, with or without
6214048Srmacklem * modification, are permitted provided that the following conditions
7214048Srmacklem * are met:
8214048Srmacklem * 1. Redistributions of source code must retain the above copyright
9214048Srmacklem *    notice, this list of conditions and the following disclaimer.
10214048Srmacklem * 2. Redistributions in binary form must reproduce the above copyright
11214048Srmacklem *    notice, this list of conditions and the following disclaimer in the
12214048Srmacklem *    documentation and/or other materials provided with the distribution.
13214048Srmacklem *
14214048Srmacklem * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15214048Srmacklem * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16214048Srmacklem * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17214048Srmacklem * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18214048Srmacklem * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19214048Srmacklem * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20214048Srmacklem * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21214048Srmacklem * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22214048Srmacklem * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23214048Srmacklem * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24214048Srmacklem * SUCH DAMAGE.
25214048Srmacklem *
26214048Srmacklem * $FreeBSD$
27214048Srmacklem */
28214048Srmacklem
29214048Srmacklem#ifndef _NFS_MOUNTCOMMON_H_
30214048Srmacklem#define	_NFS_MOUNTCOMMON_H_
31214048Srmacklem
32214048Srmacklem/*
33214048Srmacklem * The common fields of the nfsmount structure for the two clients
34214048Srmacklem * used by the nlm. It includes a function pointer that provides
35214048Srmacklem * a mechanism for getting the client specific info for an nfs vnode.
36214048Srmacklem */
37214053Srmacklemtypedef void	nfs_getinfofromvp_ftype(struct vnode *, uint8_t *, size_t *,
38216931Srmacklem		    struct sockaddr_storage *, int *, off_t *,
39216931Srmacklem		    struct timeval *);
40216931Srmacklemtypedef int	nfs_vinvalbuf_ftype(struct vnode *, int, struct thread *, int);
41214048Srmacklem
42214048Srmacklemstruct	nfsmount_common {
43214048Srmacklem	struct mtx	nmcom_mtx;
44214048Srmacklem	int	nmcom_flag;		/* Flags for soft/hard... */
45214048Srmacklem	int	nmcom_state;		/* Internal state flags */
46214048Srmacklem	struct	mount *nmcom_mountp;	/* Vfs structure for this filesystem */
47214048Srmacklem	int	nmcom_timeo;		/* Init timer for NFSMNT_DUMBTIMR */
48214048Srmacklem	int	nmcom_retry;		/* Max retries */
49214048Srmacklem	char	nmcom_hostname[MNAMELEN];	/* server's name */
50214048Srmacklem	nfs_getinfofromvp_ftype	*nmcom_getinfo;	/* Get info from nfsnode */
51216931Srmacklem	nfs_vinvalbuf_ftype	*nmcom_vinvalbuf; /* Invalidate buffers */
52214048Srmacklem};
53214048Srmacklem
54214048Srmacklem#endif	/* _NFS_MOUNTCOMMON_H_ */
55