Skip to contentSkip to conversation

NLM: Introduce completion function to match nlmclnt_init

PATCH In review Chuck Lever 2 participants 4 messages Dec 20, 2007 – Jan 8, 2008 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

---

 fs/lockd/clntlock.c        |   12 ++++++++++++
 include/linux/lockd/bind.h |    1 +
 2 files changed, 13 insertions(+), 0 deletions(-)
fs/lockd/clntlock.c +12 -0
index 9aeea53..0c99aee 100644
@@ -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
  */
include/linux/lockd/bind.h +1 -0
index d8b7149..372c8df 100644
@@ -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);

A message that is not in the archive (sent off-list or not yet received): 20071220200405.3358.54150.stgit-meopP2rzCrTwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org

#2 lore raw
Quoted 3 lines · Chuck Lever

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

A message that is not in the archive (sent off-list or not yet received): 1199397248.1913.15.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org

#4 lore raw

Hi Trond-

Quoted 9 lines · Trond Myklebust
Quoted 3 lines · Chuck Lever

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

#5 lore raw
Quoted 10 lines · Chuck Lever

Hi Trond-

Quoted 7 lines · Trond Myklebust
Quoted 5 lines · Chuck Lever

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.

Quoted 6 lines
Quoted 4 lines

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