diff for duplicates of <46045AD5.9010702@redhat.com> diff --git a/a/1.txt b/N1/1.txt index 538f4c7..a5d77b8 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,5 +1,5 @@ Neil Brown wrote: -> On Thursday September 14, wcheng at redhat.com wrote: +> On Thursday September 14, wcheng@redhat.com wrote: > >> By writing exported filesytem id into /proc/fs/nfsd/nlm_unlock, this >> patch walks thru lockd's global nlm_files list to release all the locks @@ -31,11 +31,3 @@ requests from our distribution to ask for this function in a single server (no cluster) environment. -- Wendy - --------------- next part -------------- -A non-text attachment was scrubbed... -Name: nlm_unlock.patch -Type: text/x-patch -Size: 8956 bytes -Desc: not available -URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070323/c90f29b2/attachment.bin> diff --git a/N1/2.hdr b/N1/2.hdr new file mode 100644 index 0000000..407e0c8 --- /dev/null +++ b/N1/2.hdr @@ -0,0 +1,5 @@ +Content-Type: text/x-patch; + name="nlm_unlock.patch" +Content-Transfer-Encoding: 7bit +Content-Disposition: inline; + filename="nlm_unlock.patch" diff --git a/N1/2.txt b/N1/2.txt new file mode 100644 index 0000000..3920f9f --- /dev/null +++ b/N1/2.txt @@ -0,0 +1,270 @@ + Signed-off-by: S. Wendy Cheng <wcheng@redhat.com> + Signed-off-by: Lon Hohberger <lhh@redhat.com> + + fs/lockd/svcsubs.c | 64 ++++++++++++++++++++++++++++++++++++++++++-- + fs/nfsd/nfsctl.c | 28 +++++++++++++++++++ + include/linux/lockd/bind.h | 1 + include/linux/lockd/lockd.h | 4 ++ + include/linux/nfsd/nfsfh.h | 29 +++++++++++++++++++ + 5 files changed, 124 insertions(+), 2 deletions(-) + +--- gfs2-nmw/include/linux/nfsd/nfsfh.h 2007-03-19 14:18:53.000000000 -0400 ++++ linux/include/linux/nfsd/nfsfh.h 2007-03-20 15:45:29.000000000 -0400 +@@ -254,6 +254,35 @@ static inline int key_len(int type) + } + } + ++/* ++ * Used by lockd to get FSID_NUM fsid from nfs_fh, logic based on fh_verify ++ * return 0 if not found ++ * 1 if *fsid contain a valid fsid ++ */ ++static inline int get_fsid(struct nfs_fh *fh, unsigned int *fsid) ++{ ++ struct nfs_fhbase_new *fh_base = (struct nfs_fhbase_new *) fh->data; ++ int data_left = fh->size/4; ++ ++ /* From fb_version to fb_auth - at least two u32 */ ++ if (data_left < 2) ++ return 0; ++ ++ /* For various types, check out ++ * inlcude/linux/nfsd/nfsfsh.h ++ */ ++ if ((fh_base->fb_version != 1) || ++ (fh_base->fb_auth_type != 0) || ++ (fh_base->fb_fsid_type != FSID_NUM)) ++ return 0; ++ ++ /* The fb_auth is 0 bytes long - imply fb_auth[0] has ++ * fsid value. ++ */ ++ *fsid = (int) fh_base->fb_auth[0]; ++ return 1; ++} ++ + /* + * Shorthand for dprintk()'s + */ +--- gfs2-nmw/include/linux/lockd/lockd.h 2007-03-19 14:18:42.000000000 -0400 ++++ linux/include/linux/lockd/lockd.h 2007-03-21 15:01:57.000000000 -0400 +@@ -202,6 +202,8 @@ void nlm_release_file(struct nlm_file + void nlmsvc_mark_resources(void); + void nlmsvc_free_host_resources(struct nlm_host *); + void nlmsvc_invalidate_all(void); ++int nlmsvc_same_fsid(struct nlm_host *, struct nlm_host *); ++int nlmsvc_fo_unlock(int *fsid); + + static __inline__ struct inode * + nlmsvc_file_inode(struct nlm_file *file) +--- gfs2-nmw/fs/lockd/svcsubs.c 2007-03-19 14:17:52.000000000 -0400 ++++ linux/fs/lockd/svcsubs.c 2007-03-23 17:46:10.000000000 -0400 +@@ -18,6 +18,7 @@ + #include <linux/lockd/lockd.h> + #include <linux/lockd/share.h> + #include <linux/lockd/sm_inter.h> ++#include <linux/module.h> /* EXPORT_SYMBOL */ + + #define NLMDBG_FACILITY NLMDBG_SVCSUBS + +@@ -179,6 +180,7 @@ again: + if (match(lockhost, host)) { + struct file_lock lock = *fl; + ++ dprintk("nlm_traverse_locks: match-delete the lock\n"); + lock.fl_type = F_UNLCK; + lock.fl_start = 0; + lock.fl_end = OFFSET_MAX; +@@ -194,12 +196,41 @@ again: + return 0; + } + ++static inline int ++nlm_fo_fsid_match(struct nlm_host *host, struct nlm_file *file) ++{ ++ struct nfs_fh *fh = &file->f_handle; ++ unsigned int fsid_found, fsid_passed = *((unsigned int *)host); ++ ++ nlm_debug_print_fh("nlm_fo_check_fsid", fh); ++ ++ /* yank fsid out of file handle */ ++ if (get_fsid(fh, &fsid_found) && (fsid_found == fsid_passed)) ++ return 1; ++ ++ /* no match */ ++ return 0; ++} ++ + /* + * Inspect a single file + */ + static inline int + nlm_inspect_file(struct nlm_host *host, struct nlm_file *file, nlm_host_match_fn_t match) + { ++ /* Cluster failover has timing constraints. There is a slight ++ * performance hit if nlm_fo_check_fsid()is implemented as a match ++ * fn (since it will be invoked multiple times later). Instead, we ++ * we add fsid-matching logic into the following clause. ++ * If fsid matches, nlmsvc_same_fsid will always return true. ++ */ ++ dprintk("nlm_inspect_files: file=%p\n", file); ++ if (unlikely(match == nlmsvc_same_fsid)) { ++ if (!nlm_fo_fsid_match(host, file)) ++ return 0; ++ dprintk("nlm_fo fsid matches\n"); ++ } ++ + nlmsvc_traverse_blocks(host, file, match); + nlmsvc_traverse_shares(host, file, match); + return nlm_traverse_locks(host, file, match); +@@ -250,8 +281,7 @@ nlm_traverse_files(struct nlm_host *host + mutex_lock(&nlm_file_mutex); + file->f_count--; + /* No more references to this file. Let go of it. */ +- if (list_empty(&file->f_blocks) && !file->f_locks +- && !file->f_shares && !file->f_count) { ++ if (!nlm_file_inuse(file)) { + hlist_del(&file->f_list); + nlmsvc_ops->fclose(file->f_file); + kfree(file); +@@ -301,7 +331,14 @@ nlm_release_file(struct nlm_file *file) + * nlmsvc_is_client: + * returns 1 iff the host is a client. + * Used by nlmsvc_invalidate_all ++ * ++ * nlmsvc_same_fsid: ++ * always returns 1 if invoked. The real job is done by ++ * nlm_fo_check_fsid(). It should release all resources ++ * bound to a specific nfs export, identified by exported ++ * fsid. + */ ++ + static int + nlmsvc_mark_host(struct nlm_host *host, struct nlm_host *dummy) + { +@@ -330,6 +367,15 @@ nlmsvc_is_client(struct nlm_host *host, + return 0; + } + ++/* To fit the logic into current lockd code structure, we add a ++ * little wrapper function here. The real matching task should be ++ * carried out by nlm_fo_check_fsid(). ++ */ ++int nlmsvc_same_fsid(struct nlm_host *dummy1, struct nlm_host *dummy2) ++{ ++ return 1; ++} ++ + /* + * Mark all hosts that still hold resources + */ +@@ -370,3 +416,17 @@ nlmsvc_invalidate_all(void) + */ + nlm_traverse_files(NULL, nlmsvc_is_client); + } ++ ++EXPORT_SYMBOL(nlmsvc_fo_unlock); ++ ++/* ++ * Release locks associated with an export fsid upon failover ++ * invoked via nfsd nfsctl call (write_fo_unlock). ++ */ ++int ++nlmsvc_fo_unlock(int *fsid) ++{ ++ return (nlm_traverse_files((struct nlm_host*)fsid, nlmsvc_same_fsid)); ++} ++ ++ +--- gfs2-nmw/fs/nfsd/nfsctl.c 2007-03-19 14:18:04.000000000 -0400 ++++ linux/fs/nfsd/nfsctl.c 2007-03-23 18:24:47.000000000 -0400 +@@ -36,6 +36,7 @@ + #include <linux/nfsd/xdr.h> + #include <linux/nfsd/syscall.h> + #include <linux/nfsd/interface.h> ++#include <linux/lockd/bind.h> + + #include <asm/uaccess.h> + +@@ -53,6 +54,7 @@ enum { + NFSD_Getfs, + NFSD_List, + NFSD_Fh, ++ NFSD_NlmUnlock, + NFSD_Threads, + NFSD_Pool_Threads, + NFSD_Versions, +@@ -79,6 +81,7 @@ static ssize_t write_unexport(struct fil + static ssize_t write_getfd(struct file *file, char *buf, size_t size); + static ssize_t write_getfs(struct file *file, char *buf, size_t size); + static ssize_t write_filehandle(struct file *file, char *buf, size_t size); ++static ssize_t write_fo_unlock(struct file *file, char *buf, size_t size); + static ssize_t write_threads(struct file *file, char *buf, size_t size); + static ssize_t write_pool_threads(struct file *file, char *buf, size_t size); + static ssize_t write_versions(struct file *file, char *buf, size_t size); +@@ -98,6 +101,7 @@ static ssize_t (*write_op[])(struct file + [NFSD_Getfd] = write_getfd, + [NFSD_Getfs] = write_getfs, + [NFSD_Fh] = write_filehandle, ++ [NFSD_NlmUnlock] = write_fo_unlock, + [NFSD_Threads] = write_threads, + [NFSD_Pool_Threads] = write_pool_threads, + [NFSD_Versions] = write_versions, +@@ -345,6 +349,29 @@ static ssize_t write_filehandle(struct f + return mesg - buf; + } + ++static ssize_t write_fo_unlock(struct file *file, char *buf, size_t size) ++{ ++ char *mesg = buf; ++ int fsid, rc; ++ ++ if (size <= 0) return -EINVAL; ++ ++ /* convert string into a valid fsid */ ++ rc = get_int(&mesg, &fsid); ++ if (rc) ++ return rc; ++ ++ /* call nlm to release the locks - fsid is passed by reference ++ * to allow other routine uses NULL pointer. */ ++ rc = nlmsvc_fo_unlock(&fsid); ++ if (rc) ++ return rc; ++ ++ /* done */ ++ sprintf(buf, "nlm_fo fsid=%d released locks\n", fsid); ++ return strlen(buf); ++} ++ + extern int nfsd_nrthreads(void); + + static ssize_t write_threads(struct file *file, char *buf, size_t size) +@@ -648,6 +675,7 @@ static int nfsd_fill_super(struct super_ + [NFSD_Getfs] = {".getfs", &transaction_ops, S_IWUSR|S_IRUSR}, + [NFSD_List] = {"exports", &exports_operations, S_IRUGO}, + [NFSD_Fh] = {"filehandle", &transaction_ops, S_IWUSR|S_IRUSR}, ++ [NFSD_NlmUnlock] = {"nlm_unlock", &transaction_ops, S_IWUSR|S_IRUSR}, + [NFSD_Threads] = {"threads", &transaction_ops, S_IWUSR|S_IRUSR}, + [NFSD_Pool_Threads] = {"pool_threads", &transaction_ops, S_IWUSR|S_IRUSR}, + [NFSD_Versions] = {"versions", &transaction_ops, S_IWUSR|S_IRUSR}, +--- gfs2-nmw/include/linux/lockd/bind.h 2007-03-19 14:18:42.000000000 -0400 ++++ linux/include/linux/lockd/bind.h 2007-03-21 14:54:07.000000000 -0400 +@@ -37,5 +37,6 @@ extern struct nlmsvc_binding * nlmsvc_op + extern int nlmclnt_proc(struct inode *, int, struct file_lock *); + extern int lockd_up(int proto); + extern void lockd_down(void); ++extern int nlmsvc_fo_unlock(int *fsid); + + #endif /* LINUX_LOCKD_BIND_H */ +--- gfs2-nmw/include/linux/lockd/lockd.h 2007-03-19 14:18:42.000000000 -0400 ++++ linux/include/linux/lockd/lockd.h 2007-03-21 15:01:57.000000000 -0400 +@@ -202,6 +202,8 @@ void nlm_release_file(struct nlm_file + void nlmsvc_mark_resources(void); + void nlmsvc_free_host_resources(struct nlm_host *); + void nlmsvc_invalidate_all(void); ++int nlmsvc_same_fsid(struct nlm_host *, struct nlm_host *); ++int nlmsvc_fo_unlock(int *fsid); + + static __inline__ struct inode * + nlmsvc_file_inode(struct nlm_file *file) diff --git a/N1/3.hdr b/N1/3.hdr new file mode 100644 index 0000000..4b86001 --- /dev/null +++ b/N1/3.hdr @@ -0,0 +1,4 @@ +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline diff --git a/N1/3.txt b/N1/3.txt new file mode 100644 index 0000000..f9179f9 --- /dev/null +++ b/N1/3.txt @@ -0,0 +1,5 @@ +------------------------------------------------------------------------- +Take Surveys. Earn Cash. Influence the Future of IT +Join SourceForge.net's Techsay panel and you'll get the chance to share your +opinions on IT & business topics through brief surveys-and earn cash +http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV diff --git a/N1/4.hdr b/N1/4.hdr new file mode 100644 index 0000000..4b86001 --- /dev/null +++ b/N1/4.hdr @@ -0,0 +1,4 @@ +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline diff --git a/N1/4.txt b/N1/4.txt new file mode 100644 index 0000000..5264bf8 --- /dev/null +++ b/N1/4.txt @@ -0,0 +1,3 @@ +_______________________________________________ +NFS maillist - NFS@lists.sourceforge.net +https://lists.sourceforge.net/lists/listinfo/nfs diff --git a/a/content_digest b/N1/content_digest index f142d7a..d6cfea8 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,13 +1,16 @@ "ref\04508DE13.6030705@redhat.com\0" "ref\017688.30411.484871.224188@cse.unsw.edu.au\0" "From\0Wendy Cheng <wcheng@redhat.com>\0" - "Subject\0[Cluster-devel] Re: [NFS] [PATCH 1/4 Revised] NLM failover - nlm_unlock\0" + "Subject\0Re: [PATCH 1/4 Revised] NLM failover - nlm_unlock\0" "Date\0Fri, 23 Mar 2007 18:55:17 -0400\0" - "To\0cluster-devel.redhat.com\0" - "\00:1\0" + "To\0Neil Brown <neilb@suse.de>\0" + "Cc\0cluster-devel@redhat.com" + lhh@redhat.com + " nfs@lists.sourceforge.net\0" + "\01:1\0" "b\0" "Neil Brown wrote:\n" - "> On Thursday September 14, wcheng at redhat.com wrote:\n" + "> On Thursday September 14, wcheng@redhat.com wrote:\n" "> \n" ">> By writing exported filesytem id into /proc/fs/nfsd/nlm_unlock, this \n" ">> patch walks thru lockd's global nlm_files list to release all the locks \n" @@ -38,14 +41,291 @@ "requests from our distribution to ask for this function in a single \n" "server (no cluster) environment.\n" "\n" - "-- Wendy\n" + -- Wendy + "\01:2\0" + "fn\0nlm_unlock.patch\0" + "b\0" + " Signed-off-by: S. Wendy Cheng <wcheng@redhat.com>\n" + " Signed-off-by: Lon Hohberger <lhh@redhat.com>\n" + " \n" + " fs/lockd/svcsubs.c | 64 ++++++++++++++++++++++++++++++++++++++++++--\n" + " fs/nfsd/nfsctl.c | 28 +++++++++++++++++++\n" + " include/linux/lockd/bind.h | 1\n" + " include/linux/lockd/lockd.h | 4 ++\n" + " include/linux/nfsd/nfsfh.h | 29 +++++++++++++++++++\n" + " 5 files changed, 124 insertions(+), 2 deletions(-)\n" "\n" - "-------------- next part --------------\n" - "A non-text attachment was scrubbed...\n" - "Name: nlm_unlock.patch\n" - "Type: text/x-patch\n" - "Size: 8956 bytes\n" - "Desc: not available\n" - URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070323/c90f29b2/attachment.bin> + "--- gfs2-nmw/include/linux/nfsd/nfsfh.h\t2007-03-19 14:18:53.000000000 -0400\n" + "+++ linux/include/linux/nfsd/nfsfh.h\t2007-03-20 15:45:29.000000000 -0400\n" + "@@ -254,6 +254,35 @@ static inline int key_len(int type)\n" + " \t}\n" + " }\n" + " \n" + "+/* \n" + "+ * Used by lockd to get FSID_NUM fsid from nfs_fh, logic based on fh_verify\n" + "+ * return 0 if not found\n" + "+ * 1 if *fsid contain a valid fsid\n" + "+ */\t\n" + "+static inline int get_fsid(struct nfs_fh *fh, unsigned int *fsid)\n" + "+{\n" + "+\tstruct nfs_fhbase_new *fh_base = (struct nfs_fhbase_new *) fh->data;\n" + "+\tint data_left = fh->size/4;\n" + "+\n" + "+\t/* From fb_version to fb_auth - at least two u32 */\n" + "+\tif (data_left < 2)\t\t\n" + "+\t\treturn 0;\n" + "+\n" + "+\t/* For various types, check out \n" + "+\t * inlcude/linux/nfsd/nfsfsh.h\n" + "+\t */\n" + "+\tif ((fh_base->fb_version != 1) || \n" + "+\t\t(fh_base->fb_auth_type != 0) ||\n" + "+\t\t(fh_base->fb_fsid_type != FSID_NUM))\n" + "+\t\treturn 0;\n" + "+ \n" + "+\t/* The fb_auth is 0 bytes long - imply fb_auth[0] has\n" + "+\t * fsid value.\n" + "+\t */\n" + "+\t*fsid = (int) fh_base->fb_auth[0];\n" + "+\treturn 1;\n" + "+}\n" + "+\n" + " /*\n" + " * Shorthand for dprintk()'s\n" + " */\n" + "--- gfs2-nmw/include/linux/lockd/lockd.h\t2007-03-19 14:18:42.000000000 -0400\n" + "+++ linux/include/linux/lockd/lockd.h\t2007-03-21 15:01:57.000000000 -0400\n" + "@@ -202,6 +202,8 @@ void\t\t nlm_release_file(struct nlm_file\n" + " void\t\t nlmsvc_mark_resources(void);\n" + " void\t\t nlmsvc_free_host_resources(struct nlm_host *);\n" + " void\t\t nlmsvc_invalidate_all(void);\n" + "+int\t\t nlmsvc_same_fsid(struct nlm_host *, struct nlm_host *);\n" + "+int\t\t nlmsvc_fo_unlock(int *fsid);\n" + " \n" + " static __inline__ struct inode *\n" + " nlmsvc_file_inode(struct nlm_file *file)\n" + "--- gfs2-nmw/fs/lockd/svcsubs.c\t2007-03-19 14:17:52.000000000 -0400\n" + "+++ linux/fs/lockd/svcsubs.c\t2007-03-23 17:46:10.000000000 -0400\n" + "@@ -18,6 +18,7 @@\n" + " #include <linux/lockd/lockd.h>\n" + " #include <linux/lockd/share.h>\n" + " #include <linux/lockd/sm_inter.h>\n" + "+#include <linux/module.h>\t/* EXPORT_SYMBOL */\n" + " \n" + " #define NLMDBG_FACILITY\t\tNLMDBG_SVCSUBS\n" + " \n" + "@@ -179,6 +180,7 @@ again:\n" + " \t\tif (match(lockhost, host)) {\n" + " \t\t\tstruct file_lock lock = *fl;\n" + " \n" + "+\t\t\tdprintk(\"nlm_traverse_locks: match-delete the lock\\n\");\n" + " \t\t\tlock.fl_type = F_UNLCK;\n" + " \t\t\tlock.fl_start = 0;\n" + " \t\t\tlock.fl_end = OFFSET_MAX;\n" + "@@ -194,12 +196,41 @@ again:\n" + " \treturn 0;\n" + " }\n" + " \n" + "+static inline int\n" + "+nlm_fo_fsid_match(struct nlm_host *host, struct nlm_file *file)\n" + "+{\n" + "+\tstruct nfs_fh *fh = &file->f_handle;\n" + "+\tunsigned int fsid_found, fsid_passed = *((unsigned int *)host);\n" + "+ \n" + "+\tnlm_debug_print_fh(\"nlm_fo_check_fsid\", fh);\n" + "+\n" + "+\t/* yank fsid out of file handle */\n" + "+\tif (get_fsid(fh, &fsid_found) && (fsid_found == fsid_passed))\n" + "+\t\treturn 1;\n" + "+\n" + "+\t/* no match */\n" + "+\treturn 0;\n" + "+}\n" + "+\n" + " /*\n" + " * Inspect a single file\n" + " */\n" + " static inline int\n" + " nlm_inspect_file(struct nlm_host *host, struct nlm_file *file, nlm_host_match_fn_t match)\n" + " {\n" + "+\t/* Cluster failover has timing constraints. There is a slight\n" + "+\t * performance hit if nlm_fo_check_fsid()is implemented as a match \n" + "+\t * fn (since it will be invoked multiple times later). Instead, we\n" + "+\t * we add fsid-matching logic into the following clause.\n" + "+\t * If fsid matches, nlmsvc_same_fsid will always return true.\n" + "+\t */\n" + "+\tdprintk(\"nlm_inspect_files: file=%p\\n\", file);\n" + "+\tif (unlikely(match == nlmsvc_same_fsid)) {\n" + "+\t\tif (!nlm_fo_fsid_match(host, file))\n" + "+\t\t\treturn 0;\n" + "+\t\tdprintk(\"nlm_fo fsid matches\\n\");\n" + "+\t}\n" + "+\n" + " \tnlmsvc_traverse_blocks(host, file, match);\n" + " \tnlmsvc_traverse_shares(host, file, match);\n" + " \treturn nlm_traverse_locks(host, file, match);\n" + "@@ -250,8 +281,7 @@ nlm_traverse_files(struct nlm_host *host\n" + " \t\t\tmutex_lock(&nlm_file_mutex);\n" + " \t\t\tfile->f_count--;\n" + " \t\t\t/* No more references to this file. Let go of it. */\n" + "-\t\t\tif (list_empty(&file->f_blocks) && !file->f_locks\n" + "-\t\t\t && !file->f_shares && !file->f_count) {\n" + "+\t\t\tif (!nlm_file_inuse(file)) {\n" + " \t\t\t\thlist_del(&file->f_list);\n" + " \t\t\t\tnlmsvc_ops->fclose(file->f_file);\n" + " \t\t\t\tkfree(file);\n" + "@@ -301,7 +331,14 @@ nlm_release_file(struct nlm_file *file)\n" + " * nlmsvc_is_client:\n" + " *\treturns 1 iff the host is a client.\n" + " *\tUsed by nlmsvc_invalidate_all\n" + "+ *\n" + "+ * nlmsvc_same_fsid:\n" + "+ *\talways returns 1 if invoked. The real job is done by\n" + "+ *\tnlm_fo_check_fsid(). It should release all resources \n" + "+ *\tbound to a specific nfs export, identified by exported \n" + "+ *\tfsid.\n" + " */\n" + "+\n" + " static int\n" + " nlmsvc_mark_host(struct nlm_host *host, struct nlm_host *dummy)\n" + " {\n" + "@@ -330,6 +367,15 @@ nlmsvc_is_client(struct nlm_host *host, \n" + " \t\treturn 0;\n" + " }\n" + " \n" + "+/* To fit the logic into current lockd code structure, we add a \n" + "+ * little wrapper function here. The real matching task should be\n" + "+ * carried out by nlm_fo_check_fsid().\n" + "+ */\n" + "+int nlmsvc_same_fsid(struct nlm_host *dummy1, struct nlm_host *dummy2)\n" + "+{\n" + "+\treturn 1;\n" + "+}\n" + "+\n" + " /*\n" + " * Mark all hosts that still hold resources\n" + " */\n" + "@@ -370,3 +416,17 @@ nlmsvc_invalidate_all(void)\n" + " \t */\n" + " \tnlm_traverse_files(NULL, nlmsvc_is_client);\n" + " }\n" + "+\n" + "+EXPORT_SYMBOL(nlmsvc_fo_unlock);\n" + "+\n" + "+/*\n" + "+ * Release locks associated with an export fsid upon failover\n" + "+ * \tinvoked via nfsd nfsctl call (write_fo_unlock).\n" + "+ */\n" + "+int\n" + "+nlmsvc_fo_unlock(int *fsid)\n" + "+{\n" + "+\treturn (nlm_traverse_files((struct nlm_host*)fsid, nlmsvc_same_fsid));\n" + "+}\n" + "+\n" + "+\n" + "--- gfs2-nmw/fs/nfsd/nfsctl.c\t2007-03-19 14:18:04.000000000 -0400\n" + "+++ linux/fs/nfsd/nfsctl.c\t2007-03-23 18:24:47.000000000 -0400\n" + "@@ -36,6 +36,7 @@\n" + " #include <linux/nfsd/xdr.h>\n" + " #include <linux/nfsd/syscall.h>\n" + " #include <linux/nfsd/interface.h>\n" + "+#include <linux/lockd/bind.h>\n" + " \n" + " #include <asm/uaccess.h>\n" + " \n" + "@@ -53,6 +54,7 @@ enum {\n" + " \tNFSD_Getfs,\n" + " \tNFSD_List,\n" + " \tNFSD_Fh,\n" + "+\tNFSD_NlmUnlock,\n" + " \tNFSD_Threads,\n" + " \tNFSD_Pool_Threads,\n" + " \tNFSD_Versions,\n" + "@@ -79,6 +81,7 @@ static ssize_t write_unexport(struct fil\n" + " static ssize_t write_getfd(struct file *file, char *buf, size_t size);\n" + " static ssize_t write_getfs(struct file *file, char *buf, size_t size);\n" + " static ssize_t write_filehandle(struct file *file, char *buf, size_t size);\n" + "+static ssize_t write_fo_unlock(struct file *file, char *buf, size_t size);\n" + " static ssize_t write_threads(struct file *file, char *buf, size_t size);\n" + " static ssize_t write_pool_threads(struct file *file, char *buf, size_t size);\n" + " static ssize_t write_versions(struct file *file, char *buf, size_t size);\n" + "@@ -98,6 +101,7 @@ static ssize_t (*write_op[])(struct file\n" + " \t[NFSD_Getfd] = write_getfd,\n" + " \t[NFSD_Getfs] = write_getfs,\n" + " \t[NFSD_Fh] = write_filehandle,\n" + "+\t[NFSD_NlmUnlock] = write_fo_unlock,\n" + " \t[NFSD_Threads] = write_threads,\n" + " \t[NFSD_Pool_Threads] = write_pool_threads,\n" + " \t[NFSD_Versions] = write_versions,\n" + "@@ -345,6 +349,29 @@ static ssize_t write_filehandle(struct f\n" + " \treturn mesg - buf;\t\n" + " }\n" + " \n" + "+static ssize_t write_fo_unlock(struct file *file, char *buf, size_t size)\n" + "+{\n" + "+\tchar *mesg = buf;\n" + "+\tint fsid, rc;\n" + "+\n" + "+\tif (size <= 0) return -EINVAL;\n" + "+\n" + "+\t/* convert string into a valid fsid */\n" + "+\trc = get_int(&mesg, &fsid);\n" + "+\tif (rc) \n" + "+\t\treturn rc;\n" + "+\n" + "+\t/* call nlm to release the locks - fsid is passed by reference \n" + "+\t * to allow other routine uses NULL pointer. */\n" + "+\trc = nlmsvc_fo_unlock(&fsid);\n" + "+\tif (rc) \n" + "+\t\treturn rc;\n" + "+\n" + "+\t/* done */\n" + "+\tsprintf(buf, \"nlm_fo fsid=%d released locks\\n\", fsid);\n" + "+\treturn strlen(buf);\n" + "+}\n" + "+\n" + " extern int nfsd_nrthreads(void);\n" + " \n" + " static ssize_t write_threads(struct file *file, char *buf, size_t size)\n" + "@@ -648,6 +675,7 @@ static int nfsd_fill_super(struct super_\n" + " \t\t[NFSD_Getfs] = {\".getfs\", &transaction_ops, S_IWUSR|S_IRUSR},\n" + " \t\t[NFSD_List] = {\"exports\", &exports_operations, S_IRUGO},\n" + " \t\t[NFSD_Fh] = {\"filehandle\", &transaction_ops, S_IWUSR|S_IRUSR},\n" + "+\t\t[NFSD_NlmUnlock] = {\"nlm_unlock\", &transaction_ops, S_IWUSR|S_IRUSR},\n" + " \t\t[NFSD_Threads] = {\"threads\", &transaction_ops, S_IWUSR|S_IRUSR},\n" + " \t\t[NFSD_Pool_Threads] = {\"pool_threads\", &transaction_ops, S_IWUSR|S_IRUSR},\n" + " \t\t[NFSD_Versions] = {\"versions\", &transaction_ops, S_IWUSR|S_IRUSR},\n" + "--- gfs2-nmw/include/linux/lockd/bind.h\t2007-03-19 14:18:42.000000000 -0400\n" + "+++ linux/include/linux/lockd/bind.h\t2007-03-21 14:54:07.000000000 -0400\n" + "@@ -37,5 +37,6 @@ extern struct nlmsvc_binding *\tnlmsvc_op\n" + " extern int\tnlmclnt_proc(struct inode *, int, struct file_lock *);\n" + " extern int\tlockd_up(int proto);\n" + " extern void\tlockd_down(void);\n" + "+extern int\tnlmsvc_fo_unlock(int *fsid);\n" + " \n" + " #endif /* LINUX_LOCKD_BIND_H */\n" + "--- gfs2-nmw/include/linux/lockd/lockd.h\t2007-03-19 14:18:42.000000000 -0400\n" + "+++ linux/include/linux/lockd/lockd.h\t2007-03-21 15:01:57.000000000 -0400\n" + "@@ -202,6 +202,8 @@ void\t\t nlm_release_file(struct nlm_file\n" + " void\t\t nlmsvc_mark_resources(void);\n" + " void\t\t nlmsvc_free_host_resources(struct nlm_host *);\n" + " void\t\t nlmsvc_invalidate_all(void);\n" + "+int\t\t nlmsvc_same_fsid(struct nlm_host *, struct nlm_host *);\n" + "+int\t\t nlmsvc_fo_unlock(int *fsid);\n" + " \n" + " static __inline__ struct inode *\n" + nlmsvc_file_inode(struct nlm_file *file) + "\01:3\0" + "b\0" + "-------------------------------------------------------------------------\n" + "Take Surveys. Earn Cash. Influence the Future of IT\n" + "Join SourceForge.net's Techsay panel and you'll get the chance to share your\n" + "opinions on IT & business topics through brief surveys-and earn cash\n" + http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV + "\01:4\0" + "b\0" + "_______________________________________________\n" + "NFS maillist - NFS@lists.sourceforge.net\n" + https://lists.sourceforge.net/lists/listinfo/nfs -2ad5e7b38cc00278434c8ca87b19dc58e25cc30940c5b94e051806c732741a90 +e03c854319143f446f32abafbe78d93c5e2199cb4ddf75343c13745f404d3df5
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.