nfs_lock.h (75631) | nfs_lock.h (83651) |
---|---|
1/*- 2 * Copyright (c) 1998 Berkeley Software Design, Inc. All rights reserved. 3 * Redistribution and use in source and binary forms, with or without 4 * modification, are permitted provided that the following conditions 5 * are met: 6 * 1. Redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer. 8 * 2. Redistributions in binary form must reproduce the above copyright --- 11 unchanged lines hidden (view full) --- 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 * from nfs_lock.h,v 2.2 1998/04/28 19:38:41 don Exp | 1/*- 2 * Copyright (c) 1998 Berkeley Software Design, Inc. All rights reserved. 3 * Redistribution and use in source and binary forms, with or without 4 * modification, are permitted provided that the following conditions 5 * are met: 6 * 1. Redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer. 8 * 2. Redistributions in binary form must reproduce the above copyright --- 11 unchanged lines hidden (view full) --- 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 * from nfs_lock.h,v 2.2 1998/04/28 19:38:41 don Exp |
28 * $FreeBSD: head/sys/nfsclient/nfs_lock.h 75631 2001-04-17 20:45:23Z alfred $ | 28 * $FreeBSD: head/sys/nfsclient/nfs_lock.h 83651 2001-09-18 23:32:09Z peter $ |
29 */ 30 31/* 32 * lockd uses the nfssvc system call to get the unique kernel services it needs. 33 * It passes in a request structure with a version number at the start. | 29 */ 30 31/* 32 * lockd uses the nfssvc system call to get the unique kernel services it needs. 33 * It passes in a request structure with a version number at the start. |
34 * This prevents libc from needing to change if the information passed | 34 * This prevents libc from needing to change if the information passed |
35 * between lockd and the kernel needs to change. 36 * 37 * If a structure changes, you must bump the version number. 38 */ 39 40#include <nfs/nfsproto.h> 41 | 35 * between lockd and the kernel needs to change. 36 * 37 * If a structure changes, you must bump the version number. 38 */ 39 40#include <nfs/nfsproto.h> 41 |
42 43#define LOCKD_REQ_VERSION 1 44 45struct lockd_req { 46 int vers; /* keep in sync with kernel please */ 47 int op; /* F_GETLK | F_SETLK | F_UNLCK */ 48 int owner; /* owner of lock, -1 to allocate one */ 49 int owner_rel_ok; /* release owner if no locks left ? */ 50 int *owner_ret; /* owner alloc/free result target */ 51 void *fh; /* NFS file handle */ 52 size_t fh_len; /* NFS file handle length */ 53 u_quad_t offset; /* offset of where to start lock */ 54 u_quad_t len; /* length of range to lock */ 55 int type; /* F_RDLCK | F_WRLCK | F_UNLCK */ 56 struct ucred cred; /* user credentials to use for lock */ 57 struct sockaddr saddr; /* XXX how about non AF_INET ?? */ 58 int pid; /* pid of lock requester */ 59}; 60 61/* | 42/* |
62 * The fifo where the kernel writes requests for locks on remote NFS files, 63 * and where lockd reads these requests. 64 * 65 */ 66#define _PATH_LCKFIFO "/var/run/lock" 67 68/* 69 * This structure is used to uniquely identify the process which originated --- 32 unchanged lines hidden (view full) --- 102 struct lockd_msg_ident la_msg_ident; /* originator of the message */ 103 int la_errno; 104 int la_set_getlk_pid; /* use returned pid */ 105 int la_getlk_pid; /* returned pid for F_GETLK */ 106}; 107 108#ifdef _KERNEL 109int nfs_dolock(struct vop_advlock_args *ap); | 43 * The fifo where the kernel writes requests for locks on remote NFS files, 44 * and where lockd reads these requests. 45 * 46 */ 47#define _PATH_LCKFIFO "/var/run/lock" 48 49/* 50 * This structure is used to uniquely identify the process which originated --- 32 unchanged lines hidden (view full) --- 83 struct lockd_msg_ident la_msg_ident; /* originator of the message */ 84 int la_errno; 85 int la_set_getlk_pid; /* use returned pid */ 86 int la_getlk_pid; /* returned pid for F_GETLK */ 87}; 88 89#ifdef _KERNEL 90int nfs_dolock(struct vop_advlock_args *ap); |
110int nfslockdans(struct proc *p, struct lockd_ans *ansp); 111int nfslockdreq(struct proc *p, struct lockd_req *reqp); | 91int nfslockdans(struct proc *p, struct lockd_ans *ansp); |
112#endif | 92#endif |