#define NFS_ASYNCTHREADMAXIDLE 60 /* Seconds before idle nfsiods are reaped */
#define NFS_DEFSTATFSRATELIMIT 10 /* Def. max # statfs RPCs per second */
#define NFS_REQUESTDELAY 10 /* ms interval to check request queue */
#define NFS_ASYNCTHREADMAXIDLE 60 /* Seconds before idle nfsiods are reaped */
#define NFS_DEFSTATFSRATELIMIT 10 /* Def. max # statfs RPCs per second */
#define NFS_REQUESTDELAY 10 /* ms interval to check request queue */
#define NFSRV_MAXWGATHERDELAY 100 /* Max. write gather delay (msec) */
#ifndef NFSRV_WGATHERDELAY
#define NFSRV_WGATHERDELAY 1 /* Default write gather delay (msec) */
#define NFSRV_MAXWGATHERDELAY 100 /* Max. write gather delay (msec) */
#ifndef NFSRV_WGATHERDELAY
#define NFSRV_WGATHERDELAY 1 /* Default write gather delay (msec) */
#define NFS_MATTR_REALM 24 /* Realm to authenticate with */
#define NFS_MATTR_PRINCIPAL 25 /* GSS principal to authenticate with */
#define NFS_MATTR_SVCPRINCIPAL 26 /* GSS principal to authenticate to, the server principal */
#define NFS_MATTR_REALM 24 /* Realm to authenticate with */
#define NFS_MATTR_PRINCIPAL 25 /* GSS principal to authenticate with */
#define NFS_MATTR_SVCPRINCIPAL 26 /* GSS principal to authenticate to, the server principal */
#define NFS_MFLAG_MNTUDP 16 /* MOUNT protocol should use UDP */
#define NFS_MFLAG_MNTQUICK 17 /* use short timeouts while mounting */
#define NFS_MFLAG_MNTUDP 16 /* MOUNT protocol should use UDP */
#define NFS_MFLAG_MNTQUICK 17 /* use short timeouts while mounting */
+/* Macros for packing and unpacking packed versions */
+#define PVER2MAJOR(M) ((uint32_t)(((M) >> 16) & 0xffff))
+#define PVER2MINOR(m) ((uint32_t)((m) & 0xffff))
+#define VER2PVER(M, m) ((uint32_t)((M) << 16) | ((m) & 0xffff))
+
/* NFS advisory file locking modes */
#define NFS_LOCK_MODE_ENABLED 0 /* advisory file locking enabled */
#define NFS_LOCK_MODE_DISABLED 1 /* do not support advisory file locking */
/* NFS advisory file locking modes */
#define NFS_LOCK_MODE_ENABLED 0 /* advisory file locking enabled */
#define NFS_LOCK_MODE_DISABLED 1 /* do not support advisory file locking */
+#define NFSCLNT_TESTIDMAP 0x001
+
+#include <sys/_types/_guid_t.h> /* for guid_t below */
+#define MAXIDNAMELEN 1024
+struct nfs_testmapid {
+ uint32_t ntm_name2id; /* lookup name 2 id or id 2 name */
+ uint32_t ntm_grpflag; /* Is this a group or user maping */
+ uint32_t ntm_id; /* id to map or return */
+ uint32_t pad;
+ guid_t ntm_guid; /* intermidiate guid used in conversion */
+ char ntm_name[MAXIDNAMELEN]; /* name to map or return */
+};
+
#define R_ASYNCWAIT 0x00002000 /* async request now being waited on */
#define R_RESENDQ 0x00004000 /* async request currently on resendq */
#define R_SENDING 0x00008000 /* request currently being sent */
#define R_ASYNCWAIT 0x00002000 /* async request now being waited on */
#define R_RESENDQ 0x00004000 /* async request currently on resendq */
#define R_SENDING 0x00008000 /* request currently being sent */
#define R_NOINTR 0x20000000 /* request should not be interupted by a signal */
#define R_RECOVER 0x40000000 /* a state recovery RPC - during NFSSTA_RECOVER */
#define R_NOINTR 0x20000000 /* request should not be interupted by a signal */
#define R_RECOVER 0x40000000 /* a state recovery RPC - during NFSSTA_RECOVER */
extern int nfs_tprintf_initial_delay, nfs_tprintf_delay;
extern int nfsiod_thread_count, nfsiod_thread_max, nfs_max_async_writes;
extern int nfs_idmap_ctrl, nfs_callback_port;
extern int nfs_tprintf_initial_delay, nfs_tprintf_delay;
extern int nfsiod_thread_count, nfsiod_thread_max, nfs_max_async_writes;
extern int nfs_idmap_ctrl, nfs_callback_port;
* nfsrv_sockwork - sockets being worked on which may have more work to do (ns_svcq)
* nfsrv_sockwg - sockets with pending write gather input (ns_wgq)
*/
* nfsrv_sockwork - sockets being worked on which may have more work to do (ns_svcq)
* nfsrv_sockwg - sockets with pending write gather input (ns_wgq)
*/
-extern TAILQ_HEAD(nfsrv_sockhead, nfsrv_sock) nfsrv_socklist, nfsrv_deadsocklist,
- nfsrv_sockwg, nfsrv_sockwait, nfsrv_sockwork;
+extern TAILQ_HEAD(nfsrv_sockhead, nfsrv_sock) nfsrv_socklist, nfsrv_sockwg,
+ nfsrv_sockwait, nfsrv_sockwork;
extern thread_call_t nfs_request_timer_call;
extern thread_call_t nfs_buf_timer_call;
extern thread_call_t nfs4_callback_timer_call;
extern thread_call_t nfs_request_timer_call;
extern thread_call_t nfs_buf_timer_call;
extern thread_call_t nfs4_callback_timer_call;
void nfs_disconnect(struct nfsmount *);
void nfs_need_reconnect(struct nfsmount *);
void nfs_mount_sock_thread_wake(struct nfsmount *);
void nfs_disconnect(struct nfsmount *);
void nfs_need_reconnect(struct nfsmount *);
void nfs_mount_sock_thread_wake(struct nfsmount *);
-void nfs_mount_check_dead_timeout(struct nfsmount *);
+int nfs_mount_check_dead_timeout(struct nfsmount *);
+int nfs_mount_gone(struct nfsmount *);
+void nfs_mount_rele(struct nfsmount *);
+void nfs_mount_zombie(struct nfsmount *, int);
+void nfs_mount_make_zombie(struct nfsmount *);
+
void nfs_rpc_record_state_init(struct nfs_rpc_record_state *);
void nfs_rpc_record_state_cleanup(struct nfs_rpc_record_state *);
int nfs_rpc_record_read(socket_t, struct nfs_rpc_record_state *, int, int *, mbuf_t *);
void nfs_rpc_record_state_init(struct nfs_rpc_record_state *);
void nfs_rpc_record_state_cleanup(struct nfs_rpc_record_state *);
int nfs_rpc_record_read(socket_t, struct nfs_rpc_record_state *, int, int *, mbuf_t *);
int nfs_write_rpc(nfsnode_t, uio_t, vfs_context_t, int *, uint64_t *);
int nfs_write_rpc2(nfsnode_t, uio_t, thread_t, kauth_cred_t, int *, uint64_t *);
int nfs_write_rpc(nfsnode_t, uio_t, vfs_context_t, int *, uint64_t *);
int nfs_write_rpc2(nfsnode_t, uio_t, thread_t, kauth_cred_t, int *, uint64_t *);
-int nfs3_access_rpc(nfsnode_t, u_int32_t *, vfs_context_t);
-int nfs4_access_rpc(nfsnode_t, u_int32_t *, vfs_context_t);
+int nfs3_access_rpc(nfsnode_t, u_int32_t *, int, vfs_context_t);
+int nfs4_access_rpc(nfsnode_t, u_int32_t *, int, vfs_context_t);
int nfs3_getattr_rpc(nfsnode_t, mount_t, u_char *, size_t, int, vfs_context_t, struct nfs_vattr *, u_int64_t *);
int nfs4_getattr_rpc(nfsnode_t, mount_t, u_char *, size_t, int, vfs_context_t, struct nfs_vattr *, u_int64_t *);
int nfs3_setattr_rpc(nfsnode_t, struct vnode_attr *, vfs_context_t);
int nfs3_getattr_rpc(nfsnode_t, mount_t, u_char *, size_t, int, vfs_context_t, struct nfs_vattr *, u_int64_t *);
int nfs4_getattr_rpc(nfsnode_t, mount_t, u_char *, size_t, int, vfs_context_t, struct nfs_vattr *, u_int64_t *);
int nfs3_setattr_rpc(nfsnode_t, struct vnode_attr *, vfs_context_t);
void nfsrv_cleanup(void);
int nfsrv_credcheck(struct nfsrv_descript *, vfs_context_t, struct nfs_export *,
struct nfs_export_options *);
void nfsrv_cleanup(void);
int nfsrv_credcheck(struct nfsrv_descript *, vfs_context_t, struct nfs_export *,
struct nfs_export_options *);
int nfsrv_dorec(struct nfsrv_sock *, struct nfsd *, struct nfsrv_descript **);
int nfsrv_errmap(struct nfsrv_descript *, int);
int nfsrv_export(struct user_nfs_export_args *, vfs_context_t);
int nfsrv_fhmatch(struct nfs_filehandle *, struct nfs_filehandle *);
int nfsrv_fhtovp(struct nfs_filehandle *, struct nfsrv_descript *, vnode_t *,
struct nfs_export **, struct nfs_export_options **);
int nfsrv_dorec(struct nfsrv_sock *, struct nfsd *, struct nfsrv_descript **);
int nfsrv_errmap(struct nfsrv_descript *, int);
int nfsrv_export(struct user_nfs_export_args *, vfs_context_t);
int nfsrv_fhmatch(struct nfs_filehandle *, struct nfs_filehandle *);
int nfsrv_fhtovp(struct nfs_filehandle *, struct nfsrv_descript *, vnode_t *,
struct nfs_export **, struct nfs_export_options **);
int nfsrv_write(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
void nfs_interval_timer_start(thread_call_t, int);
int nfsrv_write(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
void nfs_interval_timer_start(thread_call_t, int);
void nfs_up(struct nfsmount *, thread_t, int, const char *);
void nfs_up(struct nfsmount *, thread_t, int, const char *);
-void nfs_down(struct nfsmount *, thread_t, int, int, const char *);
+void nfs_down(struct nfsmount *, thread_t, int, int, const char *, int);
int nfs_msg(thread_t, const char *, const char *, int);
int nfs_mountroot(void);
int nfs_msg(thread_t, const char *, const char *, int);
int nfs_mountroot(void);
#define NFS_DBG(fac, lev, fmt, ...) \
if (__builtin_expect(NFS_DEBUG_LEVEL, 0)) nfs_printf(fac, lev, "%s: %d: " fmt, __func__, __LINE__, ## __VA_ARGS__)
void nfs_printf(int, int, const char *, ...) __printflike(3,4);
#define NFS_DBG(fac, lev, fmt, ...) \
if (__builtin_expect(NFS_DEBUG_LEVEL, 0)) nfs_printf(fac, lev, "%s: %d: " fmt, __func__, __LINE__, ## __VA_ARGS__)
void nfs_printf(int, int, const char *, ...) __printflike(3,4);