2 * Copyright (c) 2011 Christos Zoulas
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of the University nor the names of its contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * File: am-utils/include/nfs_common.c
33 struct nfs_common_args {
45 #ifdef HAVE_NFS_ARGS_T_ACREGMIN
46 #define GET_ACREGMIN(nap, a) nap->acregmin = a.acregmin;
47 #define PUT_ACREGMIN(nap, a) a.acregmin = nap->acregmin;
49 #define GET_ACREGMIN(nap, a)
50 #define PUT_ACREGMIN(nap, a)
52 #ifdef HAVE_NFS_ARGS_T_ACREGMAX
53 #define GET_ACREGMAX(nap, a) nap->acregmax = a.acregmax;
54 #define PUT_ACREGMAX(nap, a) a.acregmax = nap->acregmax;
56 #define GET_ACREGMAX(nap, a)
57 #define PUT_ACREGMAX(nap, a)
60 #ifdef HAVE_NFS_ARGS_T_ACDIRMIN
61 #define GET_ACDIRMIN(nap, a) nap->acdirmin = a.acdirmin;
62 #define PUT_ACDIRMIN(nap, a) a.acdirmin = nap->acdirmin;
64 #define GET_ACDIRMIN(nap, a)
65 #define PUT_ACDIRMIN(nap, a)
67 #ifdef HAVE_NFS_ARGS_T_ACDIRMAX
68 #define GET_ACDIRMAX(nap, a) nap->acdirmax = a.acdirmax;
69 #define PUT_ACDIRMAX(nap, a) a.acdirmax = nap->acdirmax;
71 #define GET_ACDIRMAX(nap, a)
72 #define PUT_ACDIRMAX(nap, a)
75 #define get_nfs_common_args(nap, a) \
77 nap->flags = a.flags; \
78 GET_ACREGMIN(nap, a) \
79 GET_ACREGMAX(nap, a) \
80 GET_ACDIRMIN(nap, a) \
81 GET_ACDIRMAX(nap, a) \
82 nap->timeo = a.timeo; \
83 nap->retrans = a.retrans; \
84 nap->rsize = a.rsize; \
85 nap->wsize = a.wsize; \
86 } while (/*CONSTCOND*/0)
88 #define put_nfs_common_args(nap, a) \
90 a.flags = nap->flags; \
91 PUT_ACREGMIN(nap, a) \
92 PUT_ACREGMAX(nap, a) \
93 PUT_ACDIRMIN(nap, a) \
94 PUT_ACDIRMAX(nap, a) \
95 a.timeo = nap->timeo; \
96 a.retrans = nap->retrans; \
97 a.rsize = nap->rsize; \
98 a.wsize = nap->wsize; \
99 } while (/*CONSTCOND*/0)