/*
- * Copyright (c) 2000-2013 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2014 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
*/
#define NFSCLNT_LOCKDANS 0x200
#define NFSCLNT_LOCKDNOTIFY 0x400
-
+#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 */
+};
+
/*
* fs.nfs sysctl(3) identifiers
*/
#define R_XID32(x) ((x) & 0xffffffff)
-#define NFSREQNOLIST ((struct nfsreq *)0xdeadbeef) /* sentinel value for nfsreq lists */
+#define NFSNOLIST ((void *)0x0badcafe) /* sentinel value for nfs lists */
+#define NFSREQNOLIST NFSNOLIST /* sentinel value for nfsreq lists */
+#define NFSIODCOMPLETING ((void *)0x10d) /* sentinel value for iod processing
+ async I/O w/callback being completed */
/* Flag values for r_flags */
#define R_TIMING 0x00000001 /* timing request (in mntp) */
#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_SOFT 0x00010000 /* request is soft - don't retry or reconnect */
#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_is_mobile;
+extern int nfs_is_mobile, nfs_readlink_nocache;
extern uint32_t nfs_squishy_flags;
extern uint32_t nfs_debug_ctl;
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 *);
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 nfsrv_write(struct nfsrv_descript *, struct nfsrv_sock *, vfs_context_t, mbuf_t *);
void nfs_interval_timer_start(thread_call_t, int);
+int nfs_use_cache(struct nfsmount *);
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);
#define NFS_FAC_VNOP 0x08
#define NFS_FAC_BIO 0x10
#define NFS_FAC_GSS 0x20
+#define NFS_FAC_VFS 0x40
#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);
+int nfs_mountopts(struct nfsmount *, char *, int);
__END_DECLS