X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/8f6c56a50524aa785f7e596d52dddfb331e18961..15129b1c8dbb3650c63b70adb1cad9af601c6c17:/bsd/nfs/nfs_lock.h?ds=sidebyside diff --git a/bsd/nfs/nfs_lock.h b/bsd/nfs/nfs_lock.h index df690f82b..5a5efe3e4 100644 --- a/bsd/nfs/nfs_lock.h +++ b/bsd/nfs/nfs_lock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2005 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2002-2010 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -68,14 +68,7 @@ * If a structure changes, you must bump the version number. */ -#include - -/* - * The fifo where the kernel writes requests for locks on remote NFS files, - * and where lockd reads these requests. Note this is no longer hardwired - * in the kernel binary - lockd passes the file descriptor down via nfsclnt() - */ -#define _PATH_LCKFIFO "/var/run/nfslockd" +#include /* * The structure that the kernel hands lockd for each lock request. @@ -89,7 +82,7 @@ typedef struct nfs_lock_msg { struct sockaddr_storage lm_addr; /* The address. */ int lm_fh_len; /* The file handle length. */ struct xucred lm_cred; /* user cred for lock req */ - u_int8_t lm_fh[NFS_SMALLFH]; /* The file handle. */ + u_int8_t lm_fh[NFSV3_MAX_FH_SIZE]; /* The file handle. */ } LOCKD_MSG; /* lm_flags */ @@ -97,6 +90,9 @@ typedef struct nfs_lock_msg { #define LOCKD_MSG_TEST 0x0002 /* just a lock test */ #define LOCKD_MSG_NFSV3 0x0004 /* NFSv3 request */ #define LOCKD_MSG_CANCEL 0x0008 /* cancelling blocked request */ +#define LOCKD_MSG_DENIED_GRACE 0x0010 /* lock denied due to grace period */ +#define LOCKD_MSG_RECLAIM 0x0020 /* lock reclaim request */ +#define LOCKD_MSG_TCP 0x0040 /* (try to) use TCP for request */ /* The structure used to maintain the pending request queue */ typedef struct nfs_lock_msg_request { @@ -124,23 +120,36 @@ struct lockd_ans { off_t la_start; /* lock starting offset */ off_t la_len; /* lock length */ int la_fh_len; /* The file handle length. */ - u_int8_t la_fh[NFS_SMALLFH]; /* The file handle. */ + u_int8_t la_fh[NFSV3_MAX_FH_SIZE];/* The file handle. */ }; /* la_flags */ #define LOCKD_ANS_GRANTED 0x0001 /* NLM_GRANTED request */ #define LOCKD_ANS_LOCK_INFO 0x0002 /* lock info valid */ #define LOCKD_ANS_LOCK_EXCL 0x0004 /* lock is exclusive */ +#define LOCKD_ANS_DENIED_GRACE 0x0008 /* lock denied due to grace period */ + + +/* + * The structure that lockd hands the kernel for each notify. + */ +#define LOCKD_NOTIFY_VERSION 1 +struct lockd_notify { + int ln_version; /* lockd_notify version */ + int ln_flags; /* notify flags */ + int ln_pad; /* (for alignment) */ + int ln_addrcount; /* # of addresss */ + struct sockaddr_storage ln_addr[1]; /* List of addresses. */ +}; #ifdef KERNEL void nfs_lockinit(void); -int nfs_dolock(struct vnop_advlock_args *ap); +void nfs_lockd_mount_register(struct nfsmount *); +void nfs_lockd_mount_unregister(struct nfsmount *); +int nfs3_lockd_request(nfsnode_t, int, LOCKD_MSG_REQUEST *, int, thread_t); int nfslockdans(proc_t p, struct lockd_ans *ansp); -int nfslockdfd(proc_t p, int fd); -int nfslockdwait(proc_t p); +int nfslockdnotify(proc_t p, user_addr_t argp); -extern vnode_t nfslockdvnode; -extern int nfslockdwaiting; #endif #endif /* __APPLE_API_PRIVATE */