From be4347d563ece6ea2a91db1d4377cdfd8abfd220 Mon Sep 17 00:00:00 2001 From: rmacklem Date: Tue, 28 Dec 2010 23:50:13 +0000 Subject: [PATCH] Delete the nfsvno_localconflict() function in the experimental NFS server since it is no longer used and is broken. MFC after: 2 weeks --- sys/fs/nfs/nfs_var.h | 2 -- sys/fs/nfsserver/nfs_nfsdport.c | 60 --------------------------------- 2 files changed, 62 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 6113fb555caa..782630b95214 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -569,8 +569,6 @@ int nfsvno_fhtovp(mount_t, fhandle_t *, NFSSOCKADDR_T, int, int nfsvno_pathconf(vnode_t, int, register_t *, struct ucred *, NFSPROC_T *); vnode_t nfsvno_getvp(fhandle_t *); -int nfsvno_localconflict(vnode_t, int, u_int64_t, u_int64_t, - struct nfslockconflict *, NFSPROC_T *); int nfsvno_advlock(vnode_t, int, u_int64_t, u_int64_t, NFSPROC_T *); void nfsvno_unlockvfs(mount_t); int nfsvno_lockvfs(mount_t); diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index beedfef34d0d..ae4a676de173 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -2780,66 +2780,6 @@ nfsvno_getvp(fhandle_t *fhp) return (vp); } -/* - * Check to see it a byte range lock held by a process running - * locally on the server conflicts with the new lock. - */ -int -nfsvno_localconflict(struct vnode *vp, int ftype, u_int64_t first, - u_int64_t end, struct nfslockconflict *cfp, struct thread *td) -{ - int error; - struct flock fl; - - if (!nfsrv_dolocallocks) - return (0); - fl.l_whence = SEEK_SET; - fl.l_type = ftype; - fl.l_start = (off_t)first; - if (end == NFS64BITSSET) - fl.l_len = 0; - else - fl.l_len = (off_t)(end - first); - /* - * For FreeBSD8, the l_pid and l_sysid must be set to the same - * values for all calls, so that all locks will be held by the - * nfsd server. (The nfsd server handles conflicts between the - * various clients.) - * Since an NFSv4 lockowner is a ClientID plus an array of up to 1024 - * bytes, so it can't be put in l_sysid. - */ - if (nfsv4_sysid == 0) - nfsv4_sysid = nlm_acquire_next_sysid(); - fl.l_pid = (pid_t)0; - fl.l_sysid = (int)nfsv4_sysid; - - NFSVOPUNLOCK(vp, 0, td); - error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_GETLK, &fl, - (F_POSIX | F_REMOTE)); - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, td); - if (error) - return (error); - if (fl.l_type == F_UNLCK) - return (0); - if (cfp != NULL) { - cfp->cl_clientid.lval[0] = cfp->cl_clientid.lval[1] = 0; - cfp->cl_first = (u_int64_t)fl.l_start; - if (fl.l_len == 0) - cfp->cl_end = NFS64BITSSET; - else - cfp->cl_end = (u_int64_t) - (fl.l_start + fl.l_len); - if (fl.l_type == F_WRLCK) - cfp->cl_flags = NFSLCK_WRITE; - else - cfp->cl_flags = NFSLCK_READ; - sprintf(cfp->cl_owner, "LOCALID%d", fl.l_pid); - cfp->cl_ownerlen = strlen(cfp->cl_owner); - return (NFSERR_DENIED); - } - return (NFSERR_INVAL); -} - /* * Do a local VOP_ADVLOCK(). */