2 * linux/fs/nfsd/lockd.c
4 * This file contains all the stubs needed when communicating with lockd.
5 * This level of indirection is necessary so we can run nfsd+lockd without
6 * requiring the nfs client to be compiled in/loaded, and vice versa.
8 * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
11 #include <linux/types.h>
12 #include <linux/sunrpc/clnt.h>
13 #include <linux/sunrpc/svc.h>
14 #include <linux/nfsd/nfsd.h>
15 #include <linux/lockd/bind.h>
17 #define NFSDDBG_FACILITY NFSDDBG_LOCKD
20 * Note: we hold the dentry use count while the file is open.
23 nlm_fopen(struct svc_rqst
*rqstp
, struct knfs_fh
*f
, struct file
*filp
)
28 /* must initialize before using! */
33 nfserr
= nfsd_open(rqstp
, &fh
, S_IFREG
, 0, filp
);
41 nlm_fclose(struct file
*filp
)
47 struct nlmsvc_binding nfsd_nlm_ops
= {
48 exp_readlock
, /* lock export table for reading */
49 exp_unlock
, /* unlock export table */
50 exp_getclient
, /* look up NFS client */
51 nlm_fopen
, /* open file for locking */
52 nlm_fclose
, /* close file */
53 exp_nlmdetach
, /* lockd shutdown notification */
57 * When removing an NFS client entry, notify lockd that it is gone.
58 * FIXME: We should do the same when unexporting an NFS volume.
61 nfsd_lockd_unexport(struct svc_client
*clnt
)
63 nlmsvc_invalidate_client(clnt
);
69 dprintk("nfsd: initializing lockd\n");
70 nlmsvc_ops
= &nfsd_nlm_ops
;
74 nfsd_lockd_shutdown(void)