MFC: revision 197730
unifdef NFSCLIENT because the nlm depends on the nfsclient even if NFSCLIENT is not defined. Now the nfslockd module works with the nfsclient module. Reviewed by: kib Approved by: re (kensmith)
This commit is contained in:
parent
a3cd0ffc70
commit
8fe1fb2047
@ -14,18 +14,12 @@ SRCS+= opt_inet6.h opt_nfs.h
|
|||||||
|
|
||||||
.if !defined(KERNBUILDDIR)
|
.if !defined(KERNBUILDDIR)
|
||||||
NFS_INET6?= 1 # 0/1 - requires INET6 to be configured in kernel
|
NFS_INET6?= 1 # 0/1 - requires INET6 to be configured in kernel
|
||||||
NFSCLIENT?= 1 # 0/1 - requires NFSCLIENT to be configured in kernel
|
|
||||||
|
|
||||||
.if ${NFS_INET6} > 0
|
.if ${NFS_INET6} > 0
|
||||||
opt_inet6.h:
|
opt_inet6.h:
|
||||||
echo "#define INET6 1" > ${.TARGET}
|
echo "#define INET6 1" > ${.TARGET}
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
.if ${NFSCLIENT} > 0
|
|
||||||
opt_nfs.h:
|
|
||||||
echo "#define NFSCLIENT 1" > ${.TARGET}
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
.include <bsd.kmod.mk>
|
.include <bsd.kmod.mk>
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "opt_inet6.h"
|
#include "opt_inet6.h"
|
||||||
#include "opt_nfs.h"
|
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
@ -671,8 +670,6 @@ nlm_host_destroy(struct nlm_host *host)
|
|||||||
free(host, M_NLM);
|
free(host, M_NLM);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NFSCLIENT
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Thread start callback for client lock recovery
|
* Thread start callback for client lock recovery
|
||||||
*/
|
*/
|
||||||
@ -695,8 +692,6 @@ nlm_client_recovery_start(void *arg)
|
|||||||
kthread_exit();
|
kthread_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is called when we receive a host state change notification. We
|
* This is called when we receive a host state change notification. We
|
||||||
* unlock any active locks owned by the host. When rpc.lockd is
|
* unlock any active locks owned by the host. When rpc.lockd is
|
||||||
@ -735,7 +730,6 @@ nlm_host_notify(struct nlm_host *host, int newstate)
|
|||||||
lf_clearremotesys(host->nh_sysid);
|
lf_clearremotesys(host->nh_sysid);
|
||||||
host->nh_state = newstate;
|
host->nh_state = newstate;
|
||||||
|
|
||||||
#ifdef NFSCLIENT
|
|
||||||
/*
|
/*
|
||||||
* If we have any remote locks for this host (i.e. it
|
* If we have any remote locks for this host (i.e. it
|
||||||
* represents a remote NFS server that our local NFS client
|
* represents a remote NFS server that our local NFS client
|
||||||
@ -750,7 +744,6 @@ nlm_host_notify(struct nlm_host *host, int newstate)
|
|||||||
kthread_add(nlm_client_recovery_start, host, curproc, &td, 0, 0,
|
kthread_add(nlm_client_recovery_start, host, curproc, &td, 0, 0,
|
||||||
"NFS lock recovery for %s", host->nh_caller_name);
|
"NFS lock recovery for %s", host->nh_caller_name);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1479,10 +1472,8 @@ nlm_server_main(int addr_count, char **addrs)
|
|||||||
enum clnt_stat stat;
|
enum clnt_stat stat;
|
||||||
struct nlm_host *host, *nhost;
|
struct nlm_host *host, *nhost;
|
||||||
struct nlm_waiting_lock *nw;
|
struct nlm_waiting_lock *nw;
|
||||||
#ifdef NFSCLIENT
|
|
||||||
vop_advlock_t *old_nfs_advlock;
|
vop_advlock_t *old_nfs_advlock;
|
||||||
vop_reclaim_t *old_nfs_reclaim;
|
vop_reclaim_t *old_nfs_reclaim;
|
||||||
#endif
|
|
||||||
int v4_used;
|
int v4_used;
|
||||||
#ifdef INET6
|
#ifdef INET6
|
||||||
int v6_used;
|
int v6_used;
|
||||||
@ -1583,20 +1574,16 @@ nlm_server_main(int addr_count, char **addrs)
|
|||||||
NLM_DEBUG(1, "NLM: local NSM state is %d\n", smstat.state);
|
NLM_DEBUG(1, "NLM: local NSM state is %d\n", smstat.state);
|
||||||
nlm_nsm_state = smstat.state;
|
nlm_nsm_state = smstat.state;
|
||||||
|
|
||||||
#ifdef NFSCLIENT
|
|
||||||
old_nfs_advlock = nfs_advlock_p;
|
old_nfs_advlock = nfs_advlock_p;
|
||||||
nfs_advlock_p = nlm_advlock;
|
nfs_advlock_p = nlm_advlock;
|
||||||
old_nfs_reclaim = nfs_reclaim_p;
|
old_nfs_reclaim = nfs_reclaim_p;
|
||||||
nfs_reclaim_p = nlm_reclaim;
|
nfs_reclaim_p = nlm_reclaim;
|
||||||
#endif
|
|
||||||
|
|
||||||
svc_run(pool);
|
svc_run(pool);
|
||||||
error = 0;
|
error = 0;
|
||||||
|
|
||||||
#ifdef NFSCLIENT
|
|
||||||
nfs_advlock_p = old_nfs_advlock;
|
nfs_advlock_p = old_nfs_advlock;
|
||||||
nfs_reclaim_p = old_nfs_reclaim;
|
nfs_reclaim_p = old_nfs_reclaim;
|
||||||
#endif
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (pool)
|
if (pool)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user