/* $NetBSD: nfsdport.h,v 1.1.1.2 2016/11/18 07:49:12 pgoyette Exp $ */
/*-
* Copyright (c) 2009 Rick Macklem, University of Guelph
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* FreeBSD: head/sys/fs/nfs/nfsdport.h 283635 2015-05-27 22:00:05Z rmacklem
* $NetBSD: nfsdport.h,v 1.1.1.2 2016/11/18 07:49:12 pgoyette Exp $
*/
/*
* This structure acts as a "catch-all" for information that
* needs to be returned by nfsd_fhtovp().
*/
struct nfsexstuff {
int nes_exflag; /* export flags */
int nes_numsecflavor; /* # of security flavors */
int nes_secflavors[MAXSECFLAVORS]; /* and the flavors */
};
/*
* These are NO-OPS for BSD until Isilon upstreams EXITCODE support.
* EXITCODE is an in-memory ring buffer that holds the routines failing status.
* This is a valuable tool to use when debugging and analyzing issues.
* In addition to recording a routine's failing status, it offers
* logging of routines for call stack tracing.
* EXITCODE should be used only in routines that return a true errno value, as
* that value will be formatted to a displayable errno string. Routines that
* return regular int status that are not true errno should not set EXITCODE.
* If you want to log routine tracing, you can add EXITCODE(0) to any routine.
* NFS extended the EXITCODE with EXITCODE2 to record either the routine's
* exit errno status or the nd_repstat.
*/
#define NFSEXITCODE(error)
#define NFSEXITCODE2(error, nd)
#define NFSNAMEICNDSET(n, c, o, f) do { \
(n)->cn_cred = (c); \
(n)->cn_nameiop = (o); \
(n)->cn_flags = (f); \
} while (0)
/*
* A little bit of Darwin vfs kpi.
*/
#define vnode_mount(v) ((v)->v_mount)
#define vfs_statfs(m) (&((m)->mnt_stat))
#define NFSPATHLEN_T size_t
/*
* These are set to the minimum and maximum size of a server file
* handle.
*/
#define NFSRV_MINFH (sizeof (fhandle_t))
#define NFSRV_MAXFH (sizeof (fhandle_t))
/* Use this macro for debug printfs. */
#define NFSD_DEBUG(level, ...) do { \
if (nfsd_debuglevel >= (level)) \
printf(__VA_ARGS__); \
} while (0)