2007-12-20 20:04:19

by Chuck Lever

[permalink] [raw]
Subject: [PATCH 2/4] NLM: Introduce completion function to match nlmclnt_init

Introduce the other book-end for nlmclnt_init(). This function is invoked
by the NFS client during unmount processing to release the nlm_host struct
that was pinned by nlmclnt_init() during mount processing.

Signed-off-by: Chuck Lever <[email protected]>
---

fs/lockd/clntlock.c | 12 ++++++++++++
include/linux/lockd/bind.h | 1 +
2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c
index 9aeea53..0c99aee 100644
--- a/fs/lockd/clntlock.c
+++ b/fs/lockd/clntlock.c
@@ -86,6 +86,18 @@ struct nlm_host *nlmclnt_init(struct sockaddr *server_address,
}
EXPORT_SYMBOL(nlmclnt_init);

+/**
+ * nlmclnt_done - Release resources allocated by nlmclnt_init()
+ * @host: nlm_host structure reserved by nlmclnt_init()
+ *
+ */
+void nlmclnt_done(struct nlm_host *host)
+{
+ nlm_release_host(host);
+ lockd_down();
+}
+EXPORT_SYMBOL(nlmclnt_done);
+
/*
* Queue up a lock for blocking so that the GRANTED request can see it
*/
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h
index d8b7149..372c8df 100644
--- a/include/linux/lockd/bind.h
+++ b/include/linux/lockd/bind.h
@@ -40,6 +40,7 @@ extern struct nlm_host *nlmclnt_init(struct sockaddr *server_address,
char *server_name,
u32 nfs_version,
unsigned short protocol);
+extern void nlmclnt_done(struct nlm_host *host);

extern int nlmclnt_proc(struct inode *, int, struct file_lock *);
extern int lockd_up(int proto);



2008-01-07 23:04:56

by Chuck Lever

[permalink] [raw]
Subject: Re: [PATCH 2/4] NLM: Introduce completion function to match nlmclnt_init

Hi Trond-

On Jan 3, 2008, at 4:54 PM, Trond Myklebust wrote:
> On Thu, 2007-12-20 at 15:04 -0500, Chuck Lever wrote:
>> Introduce the other book-end for nlmclnt_init(). This function is
>> invoked
>> by the NFS client during unmount processing to release the
>> nlm_host struct
>> that was pinned by nlmclnt_init() during mount processing.
>
> Does this really need to be a separate patch from the nlmclnt_init?
>
> Furthermore, those EXPORT_SYMBOL() should really be EXPORT_SYMBOL_GPL.
> We don't want to make this an official ABI.

Should I change nlmclnt_proc() to use EXPORT_SYMBOL_GPL then?

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

2008-01-08 02:04:20

by Trond Myklebust

[permalink] [raw]
Subject: Re: [PATCH 2/4] NLM: Introduce completion function to match nlmclnt_init


On Mon, 2008-01-07 at 18:04 -0500, Chuck Lever wrote:
> Hi Trond-
>
> On Jan 3, 2008, at 4:54 PM, Trond Myklebust wrote:
> > On Thu, 2007-12-20 at 15:04 -0500, Chuck Lever wrote:
> >> Introduce the other book-end for nlmclnt_init(). This function is
> >> invoked
> >> by the NFS client during unmount processing to release the
> >> nlm_host struct
> >> that was pinned by nlmclnt_init() during mount processing.
> >
> > Does this really need to be a separate patch from the nlmclnt_init?
> >
> > Furthermore, those EXPORT_SYMBOL() should really be EXPORT_SYMBOL_GPL.
> > We don't want to make this an official ABI.
>
> Should I change nlmclnt_proc() to use EXPORT_SYMBOL_GPL then?

Please do, yes. As you can see from the git tree and latest NFS_ALL, I'm
also restricting the sunrpc interfaces to _GPL-only. We don't want these
interfaces to be used by out-of-tree modules.

Cheers
Trond


2008-01-03 21:54:12

by Trond Myklebust

[permalink] [raw]
Subject: Re: [PATCH 2/4] NLM: Introduce completion function to match nlmclnt_init


On Thu, 2007-12-20 at 15:04 -0500, Chuck Lever wrote:
> Introduce the other book-end for nlmclnt_init(). This function is invoked
> by the NFS client during unmount processing to release the nlm_host struct
> that was pinned by nlmclnt_init() during mount processing.

Does this really need to be a separate patch from the nlmclnt_init?

Furthermore, those EXPORT_SYMBOL() should really be EXPORT_SYMBOL_GPL.
We don't want to make this an official ABI.

Trond