summaryrefslogtreecommitdiffstats
path: root/sys/nlm
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>2008-03-28 09:50:32 +0000
committerdfr <dfr@FreeBSD.org>2008-03-28 09:50:32 +0000
commit3d7f9d1b14e3b0a60532dcf7644a09862d4af9ed (patch)
treed3579f170201616b3e238acc235c4af58fa15f75 /sys/nlm
parent5e4993bfe38386869516af500973095a384d683e (diff)
downloadFreeBSD-src-3d7f9d1b14e3b0a60532dcf7644a09862d4af9ed.zip
FreeBSD-src-3d7f9d1b14e3b0a60532dcf7644a09862d4af9ed.tar.gz
Minor changes to improve compatibility with older FreeBSD releases.
Diffstat (limited to 'sys/nlm')
-rw-r--r--sys/nlm/nlm_prot_clnt.c2
-rw-r--r--sys/nlm/nlm_prot_impl.c19
-rw-r--r--sys/nlm/nlm_prot_server.c4
-rw-r--r--sys/nlm/nlm_prot_svc.c4
-rw-r--r--sys/nlm/nlm_prot_xdr.c2
-rw-r--r--sys/nlm/sm_inter_xdr.c2
6 files changed, 23 insertions, 10 deletions
diff --git a/sys/nlm/nlm_prot_clnt.c b/sys/nlm/nlm_prot_clnt.c
index b3ae5d8..9a16e32 100644
--- a/sys/nlm/nlm_prot_clnt.c
+++ b/sys/nlm/nlm_prot_clnt.c
@@ -8,7 +8,7 @@
#include <sys/mutex.h>
#include <sys/systm.h>
-#include "nlm_prot.h"
+#include <nlm/nlm_prot.h>
#include <sys/cdefs.h>
#ifndef lint
/*static char sccsid[] = "from: @(#)nlm_prot.x 1.8 87/09/21 Copyr 1987 Sun Micro";*/
diff --git a/sys/nlm/nlm_prot_impl.c b/sys/nlm/nlm_prot_impl.c
index 528f8a0..a799414 100644
--- a/sys/nlm/nlm_prot_impl.c
+++ b/sys/nlm/nlm_prot_impl.c
@@ -36,7 +36,9 @@ __FBSDID("$FreeBSD$");
#include <sys/lockf.h>
#include <sys/malloc.h>
#include <sys/mount.h>
+#if __FreeBSD_version >= 700000
#include <sys/priv.h>
+#endif
#include <sys/proc.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
@@ -49,9 +51,9 @@ __FBSDID("$FreeBSD$");
#include <sys/unistd.h>
#include <sys/vnode.h>
-#include "nlm_prot.h"
-#include "sm_inter.h"
-#include "nlm.h"
+#include <nlm/nlm_prot.h>
+#include <nlm/sm_inter.h>
+#include <nlm/nlm.h>
#include <rpc/rpc_com.h>
#include <rpc/rpcb_prot.h>
@@ -79,7 +81,14 @@ SYSCTL_NODE(_vfs_nlm, OID_AUTO, sysid, CTLFLAG_RW, NULL, "");
*/
static int nlm_syscall_offset = SYS_nlm_syscall;
static struct sysent nlm_syscall_prev_sysent;
+#if __FreeBSD_version < 700000
+static struct sysent nlm_syscall_sysent = {
+ (sizeof(struct nlm_syscall_args) / sizeof(register_t)) | SYF_MPSAFE,
+ (sy_call_t *) nlm_syscall
+};
+#else
MAKE_SYSENT(nlm_syscall);
+#endif
static bool_t nlm_syscall_registered = FALSE;
/*
@@ -1209,7 +1218,11 @@ nlm_syscall(struct thread *td, struct nlm_syscall_args *uap)
{
int error;
+#if __FreeBSD_version >= 700000
error = priv_check(td, PRIV_NFS_LOCKD);
+#else
+ error = suser(td);
+#endif
if (error)
return (error);
diff --git a/sys/nlm/nlm_prot_server.c b/sys/nlm/nlm_prot_server.c
index 3e4499d..320680a 100644
--- a/sys/nlm/nlm_prot_server.c
+++ b/sys/nlm/nlm_prot_server.c
@@ -37,8 +37,8 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/systm.h>
-#include "nlm_prot.h"
-#include "nlm.h"
+#include <nlm/nlm_prot.h>
+#include <nlm/nlm.h>
/**********************************************************************/
diff --git a/sys/nlm/nlm_prot_svc.c b/sys/nlm/nlm_prot_svc.c
index eca6d86..3b1a140 100644
--- a/sys/nlm/nlm_prot_svc.c
+++ b/sys/nlm/nlm_prot_svc.c
@@ -28,8 +28,8 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include "nlm_prot.h"
-#include "nlm.h"
+#include <nlm/nlm_prot.h>
+#include <nlm/nlm.h>
#include <sys/cdefs.h>
#ifndef lint
diff --git a/sys/nlm/nlm_prot_xdr.c b/sys/nlm/nlm_prot_xdr.c
index 034cbbc..d0a6c89 100644
--- a/sys/nlm/nlm_prot_xdr.c
+++ b/sys/nlm/nlm_prot_xdr.c
@@ -3,7 +3,7 @@
* It was generated using rpcgen.
*/
-#include "nlm_prot.h"
+#include <nlm/nlm_prot.h>
#include <sys/cdefs.h>
#ifndef lint
/*static char sccsid[] = "from: @(#)nlm_prot.x 1.8 87/09/21 Copyr 1987 Sun Micro";*/
diff --git a/sys/nlm/sm_inter_xdr.c b/sys/nlm/sm_inter_xdr.c
index 5f75432..b225078 100644
--- a/sys/nlm/sm_inter_xdr.c
+++ b/sys/nlm/sm_inter_xdr.c
@@ -3,7 +3,7 @@
* It was generated using rpcgen.
*/
-#include "sm_inter.h"
+#include <nlm/sm_inter.h>
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
OpenPOWER on IntegriCloud