Print this page
11083 support NFS server in zone
Portions contributed by: Dan Kruchinin <dan.kruchinin@nexenta.com>
Portions contributed by: Stepan Zastupov <stepan.zastupov@gmail.com>
Portions contributed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
Portions contributed by: Mike Zeller <mike@mikezeller.net>
Portions contributed by: Dan McDonald <danmcd@joyent.com>
Portions contributed by: Gordon Ross <gordon.w.ross@gmail.com>
Portions contributed by: Vitaliy Gusev <gusev.vitaliy@gmail.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Jason King <jbk@joyent.com>
Reviewed by: C Fraire <cfraire@me.com>
Change-Id: I22f289d357503f9b48a0bc2482cc4328a6d43d16


   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */

  22 /*
  23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 




  27 #ifndef _NFS_LOG_H
  28 #define _NFS_LOG_H
  29 
  30 #pragma ident   "%Z%%M% %I%     %E% SMI"
  31 
  32 #ifdef  __cplusplus
  33 extern "C" {
  34 #endif
  35 
  36 #include <nfs/nfs.h>
  37 #include <nfs/export.h>
  38 #include <rpc/rpc.h>
  39 
  40 #define LOG_MODE                0600    /* open log with these permissions */
  41 #define LOG_INPROG_STRING       "_log_in_process"
  42 
  43 /*
  44  * Definition of dummy program for logging special non-nfs reqs
  45  */
  46 #define NFSLOG_PROGRAM          ((rpcprog_t)42)
  47 #define NFSLOG_VERSION          ((rpcvers_t)1)
  48 
  49 #define NFSLOG_VERSMIN          ((rpcvers_t)1)
  50 #define NFSLOG_VERSMAX          ((rpcvers_t)1)
  51 


 637 
 638 /*
 639  * Functions used for interaction with nfs logging
 640  */
 641 extern bool_t   xdr_nfslog_buffer_header(XDR *, nfslog_buffer_header *);
 642 
 643 extern void     nfslog_share_record(struct exportinfo *exi, cred_t *cr);
 644 extern void     nfslog_unshare_record(struct exportinfo *exi, cred_t *cr);
 645 extern void     nfslog_getfh(struct exportinfo *, fhandle *, char *,
 646                 enum uio_seg, cred_t *);
 647 
 648 extern void     nfslog_init();
 649 extern int      nfslog_setup(struct exportinfo *);
 650 extern void     nfslog_disable(struct exportinfo *);
 651 /*PRINTFLIKE2*/
 652 extern void     nfslog_dprint(const int, const char *fmt, ...)
 653         __KPRINTFLIKE(2);
 654 extern void     *nfslog_record_alloc(struct exportinfo *, int,
 655                 void **, int);
 656 extern void     nfslog_record_free(void *, void *, size_t);
 657 extern struct   exportinfo *nfslog_get_exi(struct exportinfo *,
 658                 struct svc_req *, caddr_t, unsigned int *);
 659 extern void     nfslog_write_record(struct exportinfo *, struct svc_req *,
 660                 caddr_t, caddr_t, cred_t *, struct netbuf *, unsigned int,
 661                 unsigned int);
 662 
 663 extern struct log_buffer *nfslog_buffer_list;
 664 
 665 /*
 666  * Logging debug macro; expands to nothing for non-debug kernels.
 667  */
 668 #ifndef DEBUG
 669 #define LOGGING_DPRINT(x)
 670 #else
 671 #define LOGGING_DPRINT(x)       nfslog_dprint x
 672 #endif
 673 
 674 #endif
 675 
 676 #ifdef  __cplusplus
 677 }


   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 
  23 /*
  24  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  25  * Use is subject to license terms.
  26  */
  27 
  28 /*
  29  * Copyright 2018 Nexenta Systems, Inc.
  30  */
  31 
  32 #ifndef _NFS_LOG_H
  33 #define _NFS_LOG_H
  34 


  35 #ifdef  __cplusplus
  36 extern "C" {
  37 #endif
  38 
  39 #include <nfs/nfs.h>
  40 #include <nfs/export.h>
  41 #include <rpc/rpc.h>
  42 
  43 #define LOG_MODE                0600    /* open log with these permissions */
  44 #define LOG_INPROG_STRING       "_log_in_process"
  45 
  46 /*
  47  * Definition of dummy program for logging special non-nfs reqs
  48  */
  49 #define NFSLOG_PROGRAM          ((rpcprog_t)42)
  50 #define NFSLOG_VERSION          ((rpcvers_t)1)
  51 
  52 #define NFSLOG_VERSMIN          ((rpcvers_t)1)
  53 #define NFSLOG_VERSMAX          ((rpcvers_t)1)
  54 


 640 
 641 /*
 642  * Functions used for interaction with nfs logging
 643  */
 644 extern bool_t   xdr_nfslog_buffer_header(XDR *, nfslog_buffer_header *);
 645 
 646 extern void     nfslog_share_record(struct exportinfo *exi, cred_t *cr);
 647 extern void     nfslog_unshare_record(struct exportinfo *exi, cred_t *cr);
 648 extern void     nfslog_getfh(struct exportinfo *, fhandle *, char *,
 649                 enum uio_seg, cred_t *);
 650 
 651 extern void     nfslog_init();
 652 extern int      nfslog_setup(struct exportinfo *);
 653 extern void     nfslog_disable(struct exportinfo *);
 654 /*PRINTFLIKE2*/
 655 extern void     nfslog_dprint(const int, const char *fmt, ...)
 656         __KPRINTFLIKE(2);
 657 extern void     *nfslog_record_alloc(struct exportinfo *, int,
 658                 void **, int);
 659 extern void     nfslog_record_free(void *, void *, size_t);
 660 extern struct   exportinfo *nfslog_get_exi(nfs_export_t *, struct exportinfo *,
 661                 struct svc_req *, caddr_t, unsigned int *);
 662 extern void     nfslog_write_record(struct exportinfo *, struct svc_req *,
 663                 caddr_t, caddr_t, cred_t *, struct netbuf *, unsigned int,
 664                 unsigned int);
 665 
 666 extern struct log_buffer *nfslog_buffer_list;
 667 
 668 /*
 669  * Logging debug macro; expands to nothing for non-debug kernels.
 670  */
 671 #ifndef DEBUG
 672 #define LOGGING_DPRINT(x)
 673 #else
 674 #define LOGGING_DPRINT(x)       nfslog_dprint x
 675 #endif
 676 
 677 #endif
 678 
 679 #ifdef  __cplusplus
 680 }