Print this page
NEX-15279 support NFS server in zone
NEX-15520 online NFS shares cause zoneadm halt to hang in nfs_export_zone_fini
Portions contributed by: Dan Kruchinin dan.kruchinin@nexenta.com
Portions contributed by: Stepan Zastupov stepan.zastupov@gmail.com
Reviewed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/nfs/nfs_log.h
+++ new/usr/src/uts/common/nfs/nfs_log.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
|
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 +
22 23 /*
23 24 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 25 * Use is subject to license terms.
25 26 */
26 27
28 +/*
29 + * Copyright 2018 Nexenta Systems, Inc.
30 + */
31 +
27 32 #ifndef _NFS_LOG_H
28 33 #define _NFS_LOG_H
29 34
30 -#pragma ident "%Z%%M% %I% %E% SMI"
31 -
32 35 #ifdef __cplusplus
33 36 extern "C" {
34 37 #endif
35 38
36 39 #include <nfs/nfs.h>
37 40 #include <nfs/export.h>
38 41 #include <rpc/rpc.h>
39 42
40 43 #define LOG_MODE 0600 /* open log with these permissions */
41 44 #define LOG_INPROG_STRING "_log_in_process"
42 45
43 46 /*
44 47 * Definition of dummy program for logging special non-nfs reqs
45 48 */
46 49 #define NFSLOG_PROGRAM ((rpcprog_t)42)
47 50 #define NFSLOG_VERSION ((rpcvers_t)1)
48 51
49 52 #define NFSLOG_VERSMIN ((rpcvers_t)1)
50 53 #define NFSLOG_VERSMAX ((rpcvers_t)1)
51 54
52 55 #define NFSLOG_NULL ((rpcproc_t)0)
53 56 #define NFSLOG_SHARE ((rpcproc_t)1)
54 57 #define NFSLOG_UNSHARE ((rpcproc_t)2)
55 58 #define NFSLOG_LOOKUP ((rpcproc_t)3)
56 59 #define NFSLOG_GETFH ((rpcproc_t)4)
57 60
58 61 /*
59 62 * Version of the on disk log file
60 63 */
61 64 #define NFSLOG_BUF_VERSION ((rpcvers_t)2)
62 65
63 66 #define NFSLOG_BUF_VERSMIN ((rpcvers_t)1)
64 67 #define NFSLOG_BUF_VERSMAX ((rpcvers_t)2)
65 68 /*
66 69 * Contents of the on disk log file header
67 70 *
68 71 * Note: This is the structure for older version 1 buffers, and does not
69 72 * adequately support large buffer files, as the offset is 32 bit. Newer
70 73 * buffer files are written using version 2 buffer header (below) which
71 74 * has a 64 bit offset. However, because existing buffers continue to use
72 75 * the old header format, the daemon xdr code can read and write either format.
73 76 * This definition below is not explicitely used anywhere in the code,
74 77 * but is implicitely used by the daemon xdr code. For that reason, it
75 78 * is kept here for information purpose only.
76 79 */
77 80 struct nfslog_buffer_header_1 {
78 81 uint32_t bh_length; /* Length of this header */
79 82 uint32_t bh_version; /* Version of buffer contents */
80 83 uint32_t bh_flags; /* Optional flags field */
81 84 uint32_t bh_offset; /* offset within file to begin */
82 85 timestruc32_t bh_timestamp; /* When the buffer was created */
83 86 };
84 87 typedef struct nfslog_buffer_header_1 nfslog_buffer_header_1;
85 88
86 89 /*
87 90 * For the current version 2, which supports largefiles
88 91 */
89 92 struct nfslog_buffer_header_2 {
90 93 uint32_t bh_length; /* Length of this header */
91 94 rpcvers_t bh_version; /* Version of buffer contents */
92 95 u_offset_t bh_offset; /* offset within file to begin */
93 96 uint32_t bh_flags; /* Optional flags field */
94 97 timestruc32_t bh_timestamp; /* When the buffer was created */
95 98 };
96 99 typedef struct nfslog_buffer_header_2 nfslog_buffer_header_2;
97 100
98 101 typedef struct nfslog_buffer_header_2 nfslog_buffer_header;
99 102
100 103 /* bh_flags values */
101 104 #define NFSLOG_BH_OFFSET_OVERFLOW 1 /* version 1 bh_offset */
102 105
103 106 /*
104 107 * For each record written to the log file, this struct is used
105 108 * as the logical header; it will be XDR encoded to be written to the file.
106 109 *
107 110 * Note: if the buffer file becomes large enough, the rh_rec_id may
108 111 * wrap around. This situation is appropriately handled by the daemon however.
109 112 */
110 113 struct nfslog_record_header {
111 114 uint32_t rh_reclen; /* Length of entire record */
112 115 uint32_t rh_rec_id; /* unique id for this log */
113 116 rpcprog_t rh_prognum; /* Program number */
114 117 rpcproc_t rh_procnum; /* Procedure number */
115 118 rpcvers_t rh_version; /* Version number */
116 119 uint32_t rh_auth_flavor; /* Auth flavor of RPC request */
117 120 timestruc32_t rh_timestamp; /* time stamp of the request */
118 121 uid_t rh_uid; /* uid of requestor as per RPC */
119 122 gid_t rh_gid; /* gid of requestor as per RPC */
120 123 };
121 124 typedef struct nfslog_record_header nfslog_record_header;
122 125
123 126 /*
124 127 * For each record written to the log file, this is the logical
125 128 * structure of the record; it will be XDR encoded and written to
126 129 * the file.
127 130 */
128 131 struct nfslog_request_record {
129 132 nfslog_record_header re_header; /* Header as defined above */
130 133 char *re_principal_name; /* Principal name of caller */
131 134 char *re_netid; /* Netid used for request */
132 135 char *re_tag; /* Log buffer tag for file system */
133 136 struct netbuf re_ipaddr; /* Requestors ip address */
134 137 caddr_t re_rpc_arg; /* RPC arguments and response */
135 138 caddr_t re_rpc_res;
136 139 };
137 140 typedef struct nfslog_request_record nfslog_request_record;
138 141
139 142 /*
140 143 * From this point forward, the definitions represent the arguments
141 144 * and results of each possible RPC that can be logged. These
142 145 * may have been trimmed in content from the real RPC arguments
143 146 * and results to save space.
144 147 */
145 148 typedef fhandle_t fhandle;
146 149
147 150 struct nfslog_sharefsargs {
148 151 int sh_flags;
149 152 uint32_t sh_anon;
150 153 char *sh_path;
151 154 fhandle sh_fh_buf;
152 155 };
153 156 typedef struct nfslog_sharefsargs nfslog_sharefsargs;
154 157
155 158 typedef nfsstat nfslog_sharefsres;
156 159
157 160 struct nfslog_getfhargs {
158 161 fhandle gfh_fh_buf;
159 162 char *gfh_path;
160 163 };
161 164 typedef struct nfslog_getfhargs nfslog_getfhargs;
162 165
163 166 struct nfslog_diropargs {
164 167 fhandle da_fhandle;
165 168 char *da_name;
166 169 };
167 170 typedef struct nfslog_diropargs nfslog_diropargs;
168 171
169 172 struct nfslog_drok {
170 173 fhandle drok_fhandle;
171 174 };
172 175 typedef struct nfslog_drok nfslog_drok;
173 176
174 177 struct nfslog_diropres {
175 178 nfsstat dr_status;
176 179 union {
177 180 nfslog_drok dr_ok;
178 181 } nfslog_diropres_u;
179 182 };
180 183 typedef struct nfslog_diropres nfslog_diropres;
181 184
182 185 typedef struct nfsreadargs nfslog_nfsreadargs;
183 186
184 187 struct nfslog_rrok {
185 188 uint32_t filesize;
186 189 uint32_t rrok_count;
187 190 };
188 191 typedef struct nfslog_rrok nfslog_rrok;
189 192
190 193 struct nfslog_rdresult {
191 194 nfsstat r_status;
192 195 union {
193 196 nfslog_rrok r_ok;
194 197 } nfslog_rdresult_u;
195 198 };
196 199 typedef struct nfslog_rdresult nfslog_rdresult;
197 200
198 201 struct nfslog_writeargs {
199 202 fhandle waargs_fhandle;
200 203 uint32_t waargs_begoff;
201 204 uint32_t waargs_offset;
202 205 uint32_t waargs_totcount;
203 206 uint32_t waargs_count;
204 207 };
205 208 typedef struct nfslog_writeargs nfslog_writeargs;
206 209
207 210 struct nfslog_writeresult {
208 211 nfsstat wr_status;
209 212 union {
210 213 uint32_t wr_size;
211 214 } nfslog_writeresult_u;
212 215 };
213 216 typedef struct nfslog_writeresult nfslog_writeresult;
214 217
215 218 struct nfslog_sattr {
216 219 uint32_t sa_mode;
217 220 uint32_t sa_uid;
218 221 uint32_t sa_gid;
219 222 uint32_t sa_size;
220 223 nfs2_timeval sa_atime;
221 224 nfs2_timeval sa_mtime;
222 225 };
223 226 typedef struct nfslog_sattr nfslog_sattr;
224 227
225 228 struct nfslog_createargs {
226 229 nfslog_sattr ca_sa;
227 230 nfslog_diropargs ca_da;
228 231 };
229 232 typedef struct nfslog_createargs nfslog_createargs;
230 233
231 234 struct nfslog_setattrargs {
232 235 fhandle saa_fh;
233 236 nfslog_sattr saa_sa;
234 237 };
235 238 typedef struct nfslog_setattrargs nfslog_setattrargs;
236 239
237 240 struct nfslog_rdlnres {
238 241 nfsstat rl_status;
239 242 union {
240 243 char *rl_ok;
241 244 } nfslog_rdlnres_u;
242 245 };
243 246 typedef struct nfslog_rdlnres nfslog_rdlnres;
244 247
245 248 struct nfslog_rnmargs {
246 249 nfslog_diropargs rna_from;
247 250 nfslog_diropargs rna_to;
248 251 };
249 252 typedef struct nfslog_rnmargs nfslog_rnmargs;
250 253
251 254 struct nfslog_linkargs {
252 255 fhandle la_from;
253 256 nfslog_diropargs la_to;
254 257 };
255 258 typedef struct nfslog_linkargs nfslog_linkargs;
256 259
257 260 struct nfslog_symlinkargs {
258 261 nfslog_diropargs sla_from;
259 262 char *sla_tnm;
260 263 nfslog_sattr sla_sa;
261 264 };
262 265 typedef struct nfslog_symlinkargs nfslog_symlinkargs;
263 266
264 267 struct nfslog_rddirargs {
265 268 fhandle rda_fh;
266 269 uint32_t rda_offset;
267 270 uint32_t rda_count;
268 271 };
269 272 typedef struct nfslog_rddirargs nfslog_rddirargs;
270 273
271 274 struct nfslog_rdok {
272 275 uint32_t rdok_offset;
273 276 uint32_t rdok_size;
274 277 bool_t rdok_eof;
275 278 };
276 279 typedef struct nfslog_rdok nfslog_rdok;
277 280
278 281 struct nfslog_rddirres {
279 282 nfsstat rd_status;
280 283 union {
281 284 nfslog_rdok rd_ok;
282 285 } nfslog_rddirres_u;
283 286 };
284 287 typedef struct nfslog_rddirres nfslog_rddirres;
285 288
286 289 struct nfslog_diropargs3 {
287 290 nfs_fh3 dir;
288 291 char *name;
289 292 };
290 293 typedef struct nfslog_diropargs3 nfslog_diropargs3;
291 294
292 295 struct nfslog_LOOKUP3res {
293 296 nfsstat3 status;
294 297 union {
295 298 nfs_fh3 object;
296 299 } nfslog_LOOKUP3res_u;
297 300 };
298 301 typedef struct nfslog_LOOKUP3res nfslog_LOOKUP3res;
299 302
300 303 struct nfslog_createhow3 {
301 304 createmode3 mode;
302 305 union {
303 306 set_size3 size;
304 307 } nfslog_createhow3_u;
305 308 };
306 309 typedef struct nfslog_createhow3 nfslog_createhow3;
307 310
308 311 struct nfslog_CREATE3args {
309 312 nfslog_diropargs3 where;
310 313 nfslog_createhow3 how;
311 314 };
312 315 typedef struct nfslog_CREATE3args nfslog_CREATE3args;
313 316
314 317 struct nfslog_CREATE3resok {
315 318 post_op_fh3 obj;
316 319 };
317 320 typedef struct nfslog_CREATE3resok nfslog_CREATE3resok;
318 321
319 322 struct nfslog_CREATE3res {
320 323 nfsstat3 status;
321 324 union {
322 325 nfslog_CREATE3resok ok;
323 326 } nfslog_CREATE3res_u;
324 327 };
325 328 typedef struct nfslog_CREATE3res nfslog_CREATE3res;
326 329
327 330 struct nfslog_SETATTR3args {
328 331 nfs_fh3 object;
329 332 set_size3 size;
330 333 };
331 334 typedef struct nfslog_SETATTR3args nfslog_SETATTR3args;
332 335
333 336 struct nfslog_READLINK3res {
334 337 nfsstat3 status;
335 338 union {
336 339 char *data;
337 340 } nfslog_READLINK3res_u;
338 341 };
339 342 typedef struct nfslog_READLINK3res nfslog_READLINK3res;
340 343
341 344 struct nfslog_READ3args {
342 345 nfs_fh3 file;
343 346 offset3 offset;
344 347 count3 count;
345 348 };
346 349 typedef struct nfslog_READ3args nfslog_READ3args;
347 350
348 351 struct nfslog_READ3resok {
349 352 size3 filesize;
350 353 count3 count;
351 354 bool_t eof;
352 355 uint32_t size;
353 356 };
354 357 typedef struct nfslog_READ3resok nfslog_READ3resok;
355 358
356 359 struct nfslog_READ3res {
357 360 nfsstat3 status;
358 361 union {
359 362 nfslog_READ3resok ok;
360 363 } nfslog_READ3res_u;
361 364 };
362 365 typedef struct nfslog_READ3res nfslog_READ3res;
363 366
364 367 struct nfslog_WRITE3args {
365 368 nfs_fh3 file;
366 369 offset3 offset;
367 370 count3 count;
368 371 stable_how stable;
369 372 };
370 373 typedef struct nfslog_WRITE3args nfslog_WRITE3args;
371 374
372 375 struct nfslog_WRITE3resok {
373 376 size3 filesize;
374 377 count3 count;
375 378 stable_how committed;
376 379 };
377 380 typedef struct nfslog_WRITE3resok nfslog_WRITE3resok;
378 381
379 382 struct nfslog_WRITE3res {
380 383 nfsstat3 status;
381 384 union {
382 385 nfslog_WRITE3resok ok;
383 386 } nfslog_WRITE3res_u;
384 387 };
385 388 typedef struct nfslog_WRITE3res nfslog_WRITE3res;
386 389
387 390 struct nfslog_MKDIR3args {
388 391 nfslog_diropargs3 where;
389 392 };
390 393 typedef struct nfslog_MKDIR3args nfslog_MKDIR3args;
391 394
392 395 struct nfslog_MKDIR3res {
393 396 nfsstat3 status;
394 397 union {
395 398 post_op_fh3 obj;
396 399 } nfslog_MKDIR3res_u;
397 400 };
398 401 typedef struct nfslog_MKDIR3res nfslog_MKDIR3res;
399 402
400 403 struct nfslog_SYMLINK3args {
401 404 nfslog_diropargs3 where;
402 405 char *symlink_data;
403 406 };
404 407 typedef struct nfslog_SYMLINK3args nfslog_SYMLINK3args;
405 408
406 409 struct nfslog_SYMLINK3res {
407 410 nfsstat3 status;
408 411 union {
409 412 post_op_fh3 obj;
410 413 } nfslog_SYMLINK3res_u;
411 414 };
412 415 typedef struct nfslog_SYMLINK3res nfslog_SYMLINK3res;
413 416
414 417 struct nfslog_MKNOD3args {
415 418 nfslog_diropargs3 where;
416 419 ftype3 type;
417 420 };
418 421 typedef struct nfslog_MKNOD3args nfslog_MKNOD3args;
419 422
420 423 struct nfslog_MKNOD3res {
421 424 nfsstat3 status;
422 425 union {
423 426 post_op_fh3 obj;
424 427 } nfslog_MKNOD3res_u;
425 428 };
426 429 typedef struct nfslog_MKNOD3res nfslog_MKNOD3res;
427 430
428 431 struct nfslog_REMOVE3args {
429 432 nfslog_diropargs3 object;
430 433 };
431 434 typedef struct nfslog_REMOVE3args nfslog_REMOVE3args;
432 435
433 436 struct nfslog_RMDIR3args {
434 437 nfslog_diropargs3 object;
435 438 };
436 439 typedef struct nfslog_RMDIR3args nfslog_RMDIR3args;
437 440
438 441 struct nfslog_RENAME3args {
439 442 nfslog_diropargs3 from;
440 443 nfslog_diropargs3 to;
441 444 };
442 445 typedef struct nfslog_RENAME3args nfslog_RENAME3args;
443 446
444 447 struct nfslog_LINK3args {
445 448 nfs_fh3 file;
446 449 nfslog_diropargs3 link;
447 450 };
448 451 typedef struct nfslog_LINK3args nfslog_LINK3args;
449 452
450 453 struct nfslog_READDIRPLUS3args {
451 454 nfs_fh3 dir;
452 455 count3 dircount;
453 456 count3 maxcount;
454 457 };
455 458 typedef struct nfslog_READDIRPLUS3args nfslog_READDIRPLUS3args;
456 459
457 460 struct nfslog_entryplus3 {
458 461 post_op_fh3 name_handle;
459 462 char *name;
460 463 struct nfslog_entryplus3 *nextentry;
461 464 };
462 465 typedef struct nfslog_entryplus3 nfslog_entryplus3;
463 466
464 467 struct nfslog_dirlistplus3 {
465 468 nfslog_entryplus3 *entries;
466 469 bool_t eof;
467 470 };
468 471 typedef struct nfslog_dirlistplus3 nfslog_dirlistplus3;
469 472
470 473 struct nfslog_READDIRPLUS3resok {
471 474 nfslog_dirlistplus3 reply;
472 475 };
473 476 typedef struct nfslog_READDIRPLUS3resok nfslog_READDIRPLUS3resok;
474 477
475 478 struct nfslog_READDIRPLUS3res {
476 479 nfsstat3 status;
477 480 union {
478 481 nfslog_READDIRPLUS3resok ok;
479 482 } nfslog_READDIRPLUS3res_u;
480 483 };
481 484 typedef struct nfslog_READDIRPLUS3res nfslog_READDIRPLUS3res;
482 485
483 486 struct nfslog_COMMIT3args {
484 487 nfs_fh3 file;
485 488 offset3 offset;
486 489 count3 count;
487 490 };
488 491 typedef struct nfslog_COMMIT3args nfslog_COMMIT3args;
489 492
490 493 /* the xdr functions */
491 494 #ifndef _KERNEL
492 495
493 496 extern bool_t xdr_nfsstat(XDR *, nfsstat *);
494 497 extern bool_t xdr_uint64(XDR *, uint64 *);
495 498 extern bool_t xdr_uint32(XDR *, uint32 *);
496 499 extern bool_t xdr_fhandle(XDR *, fhandle_t *);
497 500 extern bool_t xdr_nfs_fh3(XDR *, nfs_fh3 *);
498 501 extern bool_t xdr_nfsstat3(XDR *, nfsstat3 *);
499 502 extern bool_t xdr_nfslog_buffer_header(XDR *, nfslog_buffer_header *);
500 503 extern bool_t xdr_nfslog_request_record(XDR *, nfslog_request_record *);
501 504 extern bool_t xdr_nfslog_sharefsargs(XDR *, nfslog_sharefsargs *);
502 505 extern bool_t xdr_nfslog_sharefsres(XDR *, nfslog_sharefsres *);
503 506 extern bool_t xdr_nfslog_getfhargs(XDR *, nfslog_getfhargs *);
504 507 extern bool_t xdr_nfslog_diropargs(XDR *, nfslog_diropargs *);
505 508 extern bool_t xdr_nfslog_diropres(XDR *, nfslog_diropres *);
506 509 extern bool_t xdr_nfslog_nfsreadargs(XDR *, nfslog_nfsreadargs *);
507 510 extern bool_t xdr_nfslog_rdresult(XDR *, nfslog_rdresult *);
508 511 extern bool_t xdr_nfslog_writeargs(XDR *, nfslog_writeargs *);
509 512 extern bool_t xdr_nfslog_writeresult(XDR *, nfslog_writeresult *);
510 513 extern bool_t xdr_nfslog_createargs(XDR *, nfslog_createargs *);
511 514 extern bool_t xdr_nfslog_setattrargs(XDR *, nfslog_setattrargs *);
512 515 extern bool_t xdr_nfslog_rdlnres(XDR *, nfslog_rdlnres *);
513 516 extern bool_t xdr_nfslog_rnmargs(XDR *, nfslog_rnmargs *);
514 517 extern bool_t xdr_nfslog_linkargs(XDR *, nfslog_linkargs *);
515 518 extern bool_t xdr_nfslog_symlinkargs(XDR *, nfslog_symlinkargs *);
516 519 extern bool_t xdr_nfslog_rddirargs(XDR *, nfslog_rddirargs *);
517 520 extern bool_t xdr_nfslog_rddirres(XDR *, nfslog_rddirres *);
518 521 extern bool_t xdr_nfslog_diropargs3(XDR *, nfslog_diropargs3 *);
519 522 extern bool_t xdr_nfslog_LOOKUP3res(XDR *, nfslog_LOOKUP3res *);
520 523 extern bool_t xdr_nfslog_CREATE3args(XDR *, nfslog_CREATE3args *);
521 524 extern bool_t xdr_nfslog_CREATE3res(XDR *, nfslog_CREATE3res *);
522 525 extern bool_t xdr_nfslog_SETATTR3args(XDR *, nfslog_SETATTR3args *);
523 526 extern bool_t xdr_nfslog_READLINK3res(XDR *, nfslog_READLINK3res *);
524 527 extern bool_t xdr_nfslog_READ3args(XDR *, nfslog_READ3args *);
525 528 extern bool_t xdr_nfslog_READ3res(XDR *, nfslog_READ3res *);
526 529 extern bool_t xdr_nfslog_WRITE3args(XDR *, nfslog_WRITE3args *);
527 530 extern bool_t xdr_nfslog_WRITE3res(XDR *, nfslog_WRITE3res *);
528 531 extern bool_t xdr_nfslog_MKDIR3args(XDR *, nfslog_MKDIR3args *);
529 532 extern bool_t xdr_nfslog_MKDIR3res(XDR *, nfslog_MKDIR3res *);
530 533 extern bool_t xdr_nfslog_SYMLINK3args(XDR *, nfslog_SYMLINK3args *);
531 534 extern bool_t xdr_nfslog_SYMLINK3res(XDR *, nfslog_SYMLINK3res *);
532 535 extern bool_t xdr_nfslog_MKNOD3args(XDR *, nfslog_MKNOD3args *);
533 536 extern bool_t xdr_nfslog_MKNOD3res(XDR *, nfslog_MKNOD3res *);
534 537 extern bool_t xdr_nfslog_REMOVE3args(XDR *, nfslog_REMOVE3args *);
535 538 extern bool_t xdr_nfslog_RMDIR3args(XDR *, nfslog_RMDIR3args *);
536 539 extern bool_t xdr_nfslog_RENAME3args(XDR *, nfslog_RENAME3args *);
537 540 extern bool_t xdr_nfslog_LINK3args(XDR *, nfslog_LINK3args *);
538 541 extern bool_t xdr_nfslog_READDIRPLUS3args(XDR *, nfslog_READDIRPLUS3args *);
539 542 extern bool_t xdr_nfslog_READDIRPLUS3res(XDR *, nfslog_READDIRPLUS3res *);
540 543 extern bool_t xdr_nfslog_COMMIT3args(XDR *, nfslog_COMMIT3args *);
541 544
542 545 #else /* !_KERNEL */
543 546
544 547 extern bool_t xdr_nfsstat(XDR *, nfsstat *);
545 548 extern bool_t xdr_nfslog_nfsreadargs(XDR *, nfslog_nfsreadargs *);
546 549 extern bool_t xdr_nfslog_sharefsres(XDR *, nfslog_sharefsres *);
547 550 extern bool_t xdr_nfslog_sharefsargs(XDR *, struct exportinfo *);
548 551 extern bool_t xdr_nfslog_getfhargs(XDR *, nfslog_getfhargs *);
549 552 extern bool_t xdr_nfslog_diropargs(XDR *, struct nfsdiropargs *);
550 553 extern bool_t xdr_nfslog_drok(XDR *, struct nfsdrok *);
551 554 extern bool_t xdr_nfslog_diropres(XDR *, struct nfsdiropres *);
552 555 extern bool_t xdr_nfslog_getattrres(XDR *, struct nfsattrstat *);
553 556 extern bool_t xdr_nfslog_rrok(XDR *, struct nfsrrok *);
554 557 extern bool_t xdr_nfslog_rdresult(XDR *, struct nfsrdresult *);
555 558 extern bool_t xdr_nfslog_writeargs(XDR *, struct nfswriteargs *);
556 559 extern bool_t xdr_nfslog_writeresult(XDR *, struct nfsattrstat *);
557 560 extern bool_t xdr_nfslog_createargs(XDR *, struct nfscreatargs *);
558 561 extern bool_t xdr_nfslog_sattr(XDR *, struct nfssattr *);
559 562 extern bool_t xdr_nfslog_setattrargs(XDR *, struct nfssaargs *);
560 563 extern bool_t xdr_nfslog_rdlnres(XDR *, struct nfsrdlnres *);
561 564 extern bool_t xdr_nfslog_rnmargs(XDR *, struct nfsrnmargs *);
562 565 extern bool_t xdr_nfslog_symlinkargs(XDR *, struct nfsslargs *);
563 566 extern bool_t xdr_nfslog_statfs(XDR *, struct nfsstatfs *);
564 567 extern bool_t xdr_nfslog_linkargs(XDR *, struct nfslinkargs *);
565 568 extern bool_t xdr_nfslog_rddirargs(XDR *, struct nfsrddirargs *);
566 569 extern bool_t xdr_nfslog_rdok(XDR *, struct nfsrdok *);
567 570 extern bool_t xdr_nfslog_rddirres(XDR *, struct nfsrddirres *);
568 571 extern bool_t xdr_nfslog_diropargs3(XDR *, diropargs3 *);
569 572 extern bool_t xdr_nfslog_LOOKUP3res(XDR *, LOOKUP3res *);
570 573 extern bool_t xdr_nfslog_createhow3(XDR *, createhow3 *);
571 574 extern bool_t xdr_nfslog_CREATE3args(XDR *, CREATE3args *);
572 575 extern bool_t xdr_nfslog_CREATE3resok(XDR *, CREATE3resok *);
573 576 extern bool_t xdr_nfslog_CREATE3res(XDR *, CREATE3res *);
574 577 extern bool_t xdr_nfslog_GETATTR3res(XDR *, GETATTR3res *);
575 578 extern bool_t xdr_nfslog_ACCESS3args(XDR *, ACCESS3args *);
576 579 extern bool_t xdr_nfslog_ACCESS3res(XDR *, ACCESS3res *);
577 580 extern bool_t xdr_nfslog_SETATTR3args(XDR *, SETATTR3args *);
578 581 extern bool_t xdr_nfslog_SETATTR3res(XDR *, SETATTR3res *);
579 582 extern bool_t xdr_nfslog_READLINK3res(XDR *, READLINK3res *);
580 583 extern bool_t xdr_nfslog_READ3args(XDR *, READ3args *);
581 584 extern bool_t xdr_nfslog_READ3resok(XDR *, READ3resok *);
582 585 extern bool_t xdr_nfslog_READ3res(XDR *, READ3res *);
583 586 extern bool_t xdr_nfslog_READ3resok(XDR *, READ3resok *);
584 587 extern bool_t xdr_nfslog_READ3res(XDR *, READ3res *);
585 588 extern bool_t xdr_nfslog_WRITE3args(XDR *, WRITE3args *);
586 589 extern bool_t xdr_nfslog_WRITE3resok(XDR *, WRITE3resok *);
587 590 extern bool_t xdr_nfslog_WRITE3res(XDR *, WRITE3res *);
588 591 extern bool_t xdr_nfslog_MKDIR3args(XDR *, MKDIR3args *);
589 592 extern bool_t xdr_nfslog_MKDIR3res(XDR *, MKDIR3res *);
590 593 extern bool_t xdr_nfslog_SYMLINK3args(XDR *, SYMLINK3args *);
591 594 extern bool_t xdr_nfslog_SYMLINK3res(XDR *, SYMLINK3res *);
592 595 extern bool_t xdr_nfslog_MKNOD3args(XDR *, MKNOD3args *);
593 596 extern bool_t xdr_nfslog_MKNOD3res(XDR *, MKNOD3res *);
594 597 extern bool_t xdr_nfslog_REMOVE3args(XDR *, REMOVE3args *);
595 598 extern bool_t xdr_nfslog_REMOVE3res(XDR *, REMOVE3res *);
596 599 extern bool_t xdr_nfslog_RMDIR3args(XDR *, RMDIR3args *);
597 600 extern bool_t xdr_nfslog_RMDIR3res(XDR *, RMDIR3res *);
598 601 extern bool_t xdr_nfslog_RENAME3args(XDR *, RENAME3args *);
599 602 extern bool_t xdr_nfslog_RENAME3res(XDR *, RENAME3res *);
600 603 extern bool_t xdr_nfslog_LINK3args(XDR *, LINK3args *);
601 604 extern bool_t xdr_nfslog_LINK3res(XDR *, LINK3res *);
602 605 extern bool_t xdr_nfslog_READDIR3args(XDR *, READDIR3args *);
603 606 extern bool_t xdr_nfslog_READDIR3res(XDR *, READDIR3res *);
604 607 extern bool_t xdr_nfslog_FSSTAT3args(XDR *, FSSTAT3args *);
605 608 extern bool_t xdr_nfslog_FSSTAT3res(XDR *, FSSTAT3res *);
606 609 extern bool_t xdr_nfslog_FSINFO3args(XDR *, FSINFO3args *);
607 610 extern bool_t xdr_nfslog_FSINFO3res(XDR *, FSINFO3res *);
608 611 extern bool_t xdr_nfslog_PATHCONF3args(XDR *, PATHCONF3args *);
609 612 extern bool_t xdr_nfslog_PATHCONF3res(XDR *, PATHCONF3res *);
610 613 extern bool_t xdr_nfslog_COMMIT3args(XDR *, COMMIT3args *);
611 614 extern bool_t xdr_nfslog_COMMIT3res(XDR *, COMMIT3res *);
612 615 extern bool_t xdr_nfslog_READDIRPLUS3args(XDR *, READDIRPLUS3args *);
613 616 extern bool_t xdr_nfslog_READDIRPLUS3res(XDR *, READDIRPLUS3res *);
614 617 extern bool_t xdr_nfslog_request_record(XDR *, struct exportinfo *,
615 618 struct svc_req *, cred_t *, struct netbuf *,
616 619 unsigned int, unsigned int);
617 620
618 621
619 622 #endif /* !_KERNEL */
620 623
621 624 #ifdef _KERNEL
622 625
623 626 /*
624 627 * Used to direct nfslog_write_record() on its behavior of
625 628 * writing log entries
626 629 */
627 630 #define NFSLOG_ALL_BUFFERS 1
628 631 #define NFSLOG_ONE_BUFFER 2
629 632
630 633 /* Sizes of the various memory allocations for encoding records */
631 634 #define NFSLOG_SMALL_RECORD_SIZE 512
632 635 #define NFSLOG_SMALL_REC_NAME "nfslog_small_rec"
633 636 #define NFSLOG_MEDIUM_RECORD_SIZE 8192
634 637 #define NFSLOG_MEDIUM_REC_NAME "nfslog_medium_rec"
635 638 #define NFSLOG_LARGE_RECORD_SIZE 32768
636 639 #define NFSLOG_LARGE_REC_NAME "nfslog_large_rec"
637 640
638 641 /*
639 642 * Functions used for interaction with nfs logging
640 643 */
641 644 extern bool_t xdr_nfslog_buffer_header(XDR *, nfslog_buffer_header *);
642 645
643 646 extern void nfslog_share_record(struct exportinfo *exi, cred_t *cr);
644 647 extern void nfslog_unshare_record(struct exportinfo *exi, cred_t *cr);
645 648 extern void nfslog_getfh(struct exportinfo *, fhandle *, char *,
646 649 enum uio_seg, cred_t *);
|
↓ open down ↓ |
605 lines elided |
↑ open up ↑ |
647 650
648 651 extern void nfslog_init();
649 652 extern int nfslog_setup(struct exportinfo *);
650 653 extern void nfslog_disable(struct exportinfo *);
651 654 /*PRINTFLIKE2*/
652 655 extern void nfslog_dprint(const int, const char *fmt, ...)
653 656 __KPRINTFLIKE(2);
654 657 extern void *nfslog_record_alloc(struct exportinfo *, int,
655 658 void **, int);
656 659 extern void nfslog_record_free(void *, void *, size_t);
657 -extern struct exportinfo *nfslog_get_exi(struct exportinfo *,
660 +extern struct exportinfo *nfslog_get_exi(nfs_export_t *, struct exportinfo *,
658 661 struct svc_req *, caddr_t, unsigned int *);
659 662 extern void nfslog_write_record(struct exportinfo *, struct svc_req *,
660 663 caddr_t, caddr_t, cred_t *, struct netbuf *, unsigned int,
661 664 unsigned int);
662 665
663 666 extern struct log_buffer *nfslog_buffer_list;
664 667
665 668 /*
666 669 * Logging debug macro; expands to nothing for non-debug kernels.
667 670 */
668 671 #ifndef DEBUG
669 672 #define LOGGING_DPRINT(x)
670 673 #else
671 674 #define LOGGING_DPRINT(x) nfslog_dprint x
672 675 #endif
673 676
674 677 #endif
675 678
676 679 #ifdef __cplusplus
677 680 }
678 681 #endif
679 682
680 683 #endif /* _NFS_LOG_H */
|
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX