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>
re #13613 rb4516 Tunables needs volatile keyword
*** 16,32 ****
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1986, 2010, Oracle and/or its affiliates. All rights reserved.
! *
* Copyright (c) 1983,1984,1985,1986,1987,1988,1989 AT&T.
* All rights reserved.
*/
#include <sys/param.h>
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/thread.h>
#include <sys/t_lock.h>
--- 16,39 ----
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
+
/*
* Copyright (c) 1986, 2010, Oracle and/or its affiliates. All rights reserved.
! */
!
! /*
* Copyright (c) 1983,1984,1985,1986,1987,1988,1989 AT&T.
* All rights reserved.
*/
+ /*
+ * Copyright 2018 Nexenta Systems, Inc.
+ */
+
#include <sys/param.h>
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/thread.h>
#include <sys/t_lock.h>
*** 58,67 ****
--- 65,75 ----
#include <rpc/auth.h>
#include <rpc/clnt.h>
#include <nfs/nfs.h>
#include <nfs/nfs_clnt.h>
+ #include <nfs/nfs_cmd.h>
#include <nfs/rnode.h>
#include <nfs/nfs_acl.h>
#include <nfs/lm.h>
*** 1179,1189 ****
* nfs_async_timeout is the amount of time a thread will live after it
* becomes idle, unless new I/O requests are received before the thread
* dies. See nfs_async_putpage and nfs_async_start.
*/
! int nfs_async_timeout = -1; /* uninitialized */
static void nfs_async_start(struct vfs *);
static void nfs_async_pgops_start(struct vfs *);
static void nfs_async_common_start(struct vfs *, int);
--- 1187,1197 ----
* nfs_async_timeout is the amount of time a thread will live after it
* becomes idle, unless new I/O requests are received before the thread
* dies. See nfs_async_putpage and nfs_async_start.
*/
! volatile int nfs_async_timeout = -1; /* uninitialized */
static void nfs_async_start(struct vfs *);
static void nfs_async_pgops_start(struct vfs *);
static void nfs_async_common_start(struct vfs *, int);
*** 1352,1363 ****
mutex_exit(&mi->mi_async_lock);
}
int
nfs_async_readahead(vnode_t *vp, u_offset_t blkoff, caddr_t addr,
! struct seg *seg, cred_t *cr, void (*readahead)(vnode_t *,
! u_offset_t, caddr_t, struct seg *, cred_t *))
{
rnode_t *rp;
mntinfo_t *mi;
struct nfs_async_reqs *args;
--- 1360,1371 ----
mutex_exit(&mi->mi_async_lock);
}
int
nfs_async_readahead(vnode_t *vp, u_offset_t blkoff, caddr_t addr,
! struct seg *seg, cred_t *cr, void (*readahead)(vnode_t *, u_offset_t,
! caddr_t, struct seg *, cred_t *))
{
rnode_t *rp;
mntinfo_t *mi;
struct nfs_async_reqs *args;
*** 1452,1463 ****
return (-1);
}
int
nfs_async_putapage(vnode_t *vp, page_t *pp, u_offset_t off, size_t len,
! int flags, cred_t *cr, int (*putapage)(vnode_t *, page_t *,
! u_offset_t, size_t, int, cred_t *))
{
rnode_t *rp;
mntinfo_t *mi;
struct nfs_async_reqs *args;
--- 1460,1471 ----
return (-1);
}
int
nfs_async_putapage(vnode_t *vp, page_t *pp, u_offset_t off, size_t len,
! int flags, cred_t *cr, int (*putapage)(vnode_t *, page_t *, u_offset_t,
! size_t, int, cred_t *))
{
rnode_t *rp;
mntinfo_t *mi;
struct nfs_async_reqs *args;
*** 1804,1815 ****
rddir_cache_rele(rdc);
}
void
nfs_async_commit(vnode_t *vp, page_t *plist, offset3 offset, count3 count,
! cred_t *cr, void (*commit)(vnode_t *, page_t *, offset3, count3,
! cred_t *))
{
rnode_t *rp;
mntinfo_t *mi;
struct nfs_async_reqs *args;
page_t *pp;
--- 1812,1822 ----
rddir_cache_rele(rdc);
}
void
nfs_async_commit(vnode_t *vp, page_t *plist, offset3 offset, count3 count,
! cred_t *cr, void (*commit)(vnode_t *, page_t *, offset3, count3, cred_t *))
{
rnode_t *rp;
mntinfo_t *mi;
struct nfs_async_reqs *args;
page_t *pp;
*** 2542,2552 ****
rp->r_flags &= ~RTRUNCATE;
cv_broadcast(&rp->r_cv);
mutex_exit(&rp->r_statelock);
}
! static int nfs_write_error_to_cons_only = 0;
#define MSG(x) (nfs_write_error_to_cons_only ? (x) : (x) + 1)
/*
* Print a file handle
*/
--- 2549,2559 ----
rp->r_flags &= ~RTRUNCATE;
cv_broadcast(&rp->r_cv);
mutex_exit(&rp->r_statelock);
}
! volatile int nfs_write_error_to_cons_only = 0;
#define MSG(x) (nfs_write_error_to_cons_only ? (x) : (x) + 1)
/*
* Print a file handle
*/
*** 2592,2602 ****
* Notify the system administrator that an NFS write error has
* occurred.
*/
/* seconds between ENOSPC/EDQUOT messages */
! clock_t nfs_write_error_interval = 5;
void
nfs_write_error(vnode_t *vp, int error, cred_t *cr)
{
mntinfo_t *mi;
--- 2599,2609 ----
* Notify the system administrator that an NFS write error has
* occurred.
*/
/* seconds between ENOSPC/EDQUOT messages */
! volatile clock_t nfs_write_error_interval = 5;
void
nfs_write_error(vnode_t *vp, int error, cred_t *cr)
{
mntinfo_t *mi;
*** 2826,2835 ****
--- 2833,2844 ----
zone_key_create(&mi_list_key, nfs_mi_init, nfs_mi_shutdown,
nfs_mi_destroy);
nfs4_clnt_init();
+ nfscmd_init();
+
#ifdef DEBUG
nfs_clntup = B_TRUE;
#endif
return (0);
*** 2845,2854 ****
--- 2854,2864 ----
{
(void) zone_key_delete(mi_list_key);
nfs_subrfini();
nfs_vfsfini();
nfs4_clnt_fini();
+ nfscmd_fini();
}
/*
* nfs_lockrelease:
*