Print this page
7127 remove -Wno-missing-braces from Makefile.uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/klm/klmops.c
+++ new/usr/src/uts/common/klm/klmops.c
1 1 /*
2 2 * This file and its contents are supplied under the terms of the
3 3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 4 * You may only use this file in accordance with the terms of version
5 5 * 1.0 of the CDDL.
6 6 *
7 7 * A full copy of the text of the CDDL should have accompanied this
8 8 * source. A copy is of the CDDL is also available via the Internet
9 9 * at http://www.illumos.org/license/CDDL.
10 10 */
11 11
12 12 /*
13 13 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
14 14 */
15 15
16 16 /*
17 17 * NFS Lock Manager, client-side
18 18 * Note: depends on (links with) klmmod
19 19 *
20 20 * This file contains all the external entry points of klmops.
21 21 * Basically, this is the "glue" to the BSD nlm code.
22 22 */
23 23
24 24 #include <sys/types.h>
25 25 #include <sys/errno.h>
26 26 #include <sys/modctl.h>
27 27 #include <sys/flock.h>
28 28
↓ open down ↓ |
28 lines elided |
↑ open up ↑ |
29 29 #include <nfs/lm.h>
30 30 #include <rpcsvc/nlm_prot.h>
31 31 #include "nlm_impl.h"
32 32
33 33
34 34 static struct modlmisc modlmisc = {
35 35 &mod_miscops, "lock mgr calls"
36 36 };
37 37
38 38 static struct modlinkage modlinkage = {
39 - MODREV_1, &modlmisc, NULL
39 + MODREV_1, { &modlmisc, NULL }
40 40 };
41 41
42 42
43 43
44 44 /*
45 45 * ****************************************************************
46 46 * module init, fini, info
47 47 */
48 48 int
49 49 _init()
50 50 {
51 51 return (mod_install(&modlinkage));
52 52 }
53 53
54 54 int
55 55 _fini()
56 56 {
57 57 /* Don't unload. */
58 58 return (EBUSY);
59 59 }
60 60
61 61 int
62 62 _info(struct modinfo *modinfop)
63 63 {
64 64 return (mod_info(&modlinkage, modinfop));
65 65 }
66 66
67 67
68 68
69 69 /*
70 70 * ****************************************************************
71 71 * Stubs listed in modstubs.s
72 72 * These are called from fs/nfs
73 73 */
74 74
75 75 /*
76 76 * NFSv2 lock/unlock. Called by nfs_frlock()
77 77 * Uses NLM version 1 (NLM_VERS)
78 78 */
79 79 int
80 80 lm_frlock(struct vnode *vp, int cmd, struct flock64 *flk, int flags,
81 81 u_offset_t off, struct cred *cr, struct netobj *fh,
82 82 struct flk_callback *flcb)
83 83 {
84 84 return (nlm_frlock(vp, cmd, flk, flags, off,
85 85 cr, fh, flcb, NLM_VERS));
86 86 }
87 87
88 88 /*
89 89 * NFSv3 lock/unlock. Called by nfs3_frlock()
90 90 * Uses NLM version 4 (NLM4_VERS)
91 91 */
92 92 int
93 93 lm4_frlock(struct vnode *vp, int cmd, struct flock64 *flk, int flags,
94 94 u_offset_t off, struct cred *cr, struct netobj *fh,
95 95 struct flk_callback *flcb)
96 96 {
97 97 int err;
98 98 err = nlm_frlock(vp, cmd, flk, flags, off,
99 99 cr, fh, flcb, NLM4_VERS);
100 100 return (err);
101 101 }
102 102
103 103 /*
104 104 * NFSv2 shrlk/unshrlk. See nfs_shrlock
105 105 * Uses NLM version 3 (NLM_VERSX)
106 106 */
107 107 int
108 108 lm_shrlock(struct vnode *vp, int cmd,
109 109 struct shrlock *shr, int flags, struct netobj *fh)
110 110 {
111 111 return (nlm_shrlock(vp, cmd, shr, flags, fh, NLM_VERSX));
112 112 }
113 113
114 114 /*
115 115 * NFSv3 shrlk/unshrlk. See nfs3_shrlock
116 116 * Uses NLM version 4 (NLM4_VERS)
117 117 */
118 118 int
119 119 lm4_shrlock(struct vnode *vp, int cmd,
120 120 struct shrlock *shr, int flags, struct netobj *fh)
121 121 {
122 122 return (nlm_shrlock(vp, cmd, shr, flags, fh, NLM4_VERS));
123 123 }
124 124
125 125 /*
126 126 * Helper for nfs_lockrelease.
127 127 */
128 128 void
129 129 lm_register_lock_locally(struct vnode *vp, struct lm_sysid *ls,
130 130 struct flock64 *flk, int flags, u_offset_t offset)
131 131 {
132 132 nlm_register_lock_locally(vp, (struct nlm_host *)ls,
133 133 flk, flags, offset);
134 134 }
135 135
136 136 /*
137 137 * Old RPC service dispatch functions, no longer used.
138 138 * Here only to satisfy modstubs.s references.
139 139 */
140 140 void
141 141 lm_nlm_dispatch(struct svc_req *req, SVCXPRT *xprt)
142 142 {
143 143 _NOTE(ARGUNUSED(req, xprt))
144 144 }
145 145
146 146 void
147 147 lm_nlm4_dispatch(struct svc_req *req, SVCXPRT *xprt)
148 148 {
149 149 _NOTE(ARGUNUSED(req, xprt))
150 150 }
151 151
152 152 /*
153 153 * Old internal functions used for reclaiming locks
154 154 * our NFS client holds after some server restarts.
155 155 * The new NLM code does this differently, so these
156 156 * are here only to satisfy modstubs.s references.
157 157 */
158 158 void
159 159 lm_nlm_reclaim(struct vnode *vp, struct flock64 *flkp)
160 160 {
161 161 _NOTE(ARGUNUSED(vp, flkp))
162 162 }
163 163
164 164 void
165 165 lm_nlm4_reclaim(struct vnode *vp, struct flock64 *flkp)
166 166 {
167 167 _NOTE(ARGUNUSED(vp, flkp))
168 168 }
↓ open down ↓ |
119 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX