summaryrefslogtreecommitdiff
path: root/freebsd/sys/nfs
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/nfs')
-rw-r--r--freebsd/sys/nfs/bootp_subr.c8
-rw-r--r--freebsd/sys/nfs/krpc_subr.c2
-rw-r--r--freebsd/sys/nfs/nfs_fha.c2
-rw-r--r--freebsd/sys/nfs/nfs_lock.c14
-rw-r--r--freebsd/sys/nfs/nfs_nfssvc.c13
5 files changed, 33 insertions, 6 deletions
diff --git a/freebsd/sys/nfs/bootp_subr.c b/freebsd/sys/nfs/bootp_subr.c
index 07418aff..d5c44ba8 100644
--- a/freebsd/sys/nfs/bootp_subr.c
+++ b/freebsd/sys/nfs/bootp_subr.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
/*-
* SPDX-License-Identifier: BSD-4-Clause
*
@@ -45,9 +47,9 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include "opt_bootp.h"
-#include "opt_nfs.h"
-#include "opt_rootdevname.h"
+#include <rtems/bsd/local/opt_bootp.h>
+#include <rtems/bsd/local/opt_nfs.h>
+#include <rtems/bsd/local/opt_rootdevname.h>
#include <sys/param.h>
#include <sys/systm.h>
diff --git a/freebsd/sys/nfs/krpc_subr.c b/freebsd/sys/nfs/krpc_subr.c
index 21e8e3ad..16fb6ac6 100644
--- a/freebsd/sys/nfs/krpc_subr.c
+++ b/freebsd/sys/nfs/krpc_subr.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
/* $NetBSD: krpc_subr.c,v 1.12.4.1 1996/06/07 00:52:26 cgd Exp $ */
/*-
diff --git a/freebsd/sys/nfs/nfs_fha.c b/freebsd/sys/nfs/nfs_fha.c
index 8c5c144d..ac4d7f14 100644
--- a/freebsd/sys/nfs/nfs_fha.c
+++ b/freebsd/sys/nfs/nfs_fha.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
diff --git a/freebsd/sys/nfs/nfs_lock.c b/freebsd/sys/nfs/nfs_lock.c
index efa1e80b..e1d04336 100644
--- a/freebsd/sys/nfs/nfs_lock.c
+++ b/freebsd/sys/nfs/nfs_lock.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -41,7 +43,9 @@ __FBSDID("$FreeBSD$");
#include <sys/limits.h>
#include <sys/lock.h>
#include <sys/malloc.h>
+#ifndef __rtems__
#include <sys/lockf.h> /* for hz */ /* Must come after sys/malloc.h */
+#endif /* __rtems__ */
#include <sys/mbuf.h>
#include <sys/mount.h>
#include <sys/namei.h>
@@ -50,7 +54,7 @@ __FBSDID("$FreeBSD$");
#include <sys/resourcevar.h>
#include <sys/socket.h>
#include <sys/socket.h>
-#include <sys/unistd.h>
+#include <rtems/bsd/sys/unistd.h>
#include <sys/vnode.h>
#include <net/if.h>
@@ -286,7 +290,9 @@ nfs_dolock(struct vop_advlock_args *ap)
if (p->p_nlminfo == NULL) {
p->p_nlminfo = malloc(sizeof(struct nlminfo),
M_NLMINFO, M_WAITOK | M_ZERO);
+#ifndef __rtems__
p->p_nlminfo->pid_start = p->p_stats->p_start;
+#endif /* __rtems__ */
getboottime(&boottime);
timevaladd(&p->p_nlminfo->pid_start, &boottime);
}
@@ -337,7 +343,9 @@ nfs_dolock(struct vop_advlock_args *ap)
if (msg.lm_getlk && p->p_nlminfo->retcode == 0) {
if (p->p_nlminfo->set_getlk_pid) {
+#ifndef __rtems__
fl->l_sysid = 0; /* XXX */
+#endif /* __rtems__ */
fl->l_pid = p->p_nlminfo->getlk_pid;
} else {
fl->l_type = F_UNLCK;
@@ -364,9 +372,13 @@ nfslockdans(struct thread *td, struct lockd_ans *ansp)
if (ansp->la_vers != LOCKD_ANS_VERSION)
return (EINVAL);
+#ifndef __rtems__
/* Find the process, set its return errno and wake it up. */
if ((targetp = pfind(ansp->la_msg_ident.pid)) == NULL)
return (ESRCH);
+#else /* __rtems__ */
+ targetp = td->td_proc;
+#endif /* __rtems__ */
/* verify the pid hasn't been reused (if we can), and it isn't waiting
* for an answer from a more recent request. We return an EPIPE if
diff --git a/freebsd/sys/nfs/nfs_nfssvc.c b/freebsd/sys/nfs/nfs_nfssvc.c
index 19ac16a9..ce03773a 100644
--- a/freebsd/sys/nfs/nfs_nfssvc.c
+++ b/freebsd/sys/nfs/nfs_nfssvc.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-kernel-space.h>
+
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -36,7 +38,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include "opt_nfs.h"
+#include <rtems/bsd/local/opt_nfs.h>
#include <sys/param.h>
#include <sys/systm.h>
@@ -49,17 +51,21 @@ __FBSDID("$FreeBSD$");
#include <sys/mutex.h>
#include <sys/module.h>
#include <sys/sysent.h>
+#ifndef __rtems__
#include <sys/syscall.h>
+#endif /* __rtems__ */
#include <sys/sysproto.h>
#include <security/audit/audit.h>
#include <nfs/nfssvc.h>
+#ifndef __rtems__
static struct syscall_helper_data nfssvc_syscalls[] = {
SYSCALL_INIT_HELPER(nfssvc),
SYSCALL_INIT_LAST
};
+#endif /* __rtems__ */
/*
* This tiny module simply handles the nfssvc() system call. The other
@@ -124,8 +130,10 @@ nfssvc_modevent(module_t mod, int type, void *data)
switch (type) {
case MOD_LOAD:
+#ifndef __rtems__
error = syscall_helper_register(nfssvc_syscalls,
SY_THR_STATIC_KLD);
+#endif /* __rtems__ */
break;
case MOD_UNLOAD:
@@ -134,7 +142,9 @@ nfssvc_modevent(module_t mod, int type, void *data)
error = EBUSY;
break;
}
+#ifndef __rtems__
syscall_helper_unregister(nfssvc_syscalls);
+#endif /* __rtems__ */
break;
default:
error = EOPNOTSUPP;
@@ -151,4 +161,3 @@ DECLARE_MODULE(nfssvc, nfssvc_mod, SI_SUB_VFS, SI_ORDER_ANY);
/* So that loader and kldload(2) can find us, wherever we are.. */
MODULE_VERSION(nfssvc, 1);
-