All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <479970EA.2060900@redhat.com>

diff --git a/a/1.txt b/N1/1.txt
index 78315ad..fbf32c4 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -14,10 +14,3 @@ into the list. The maximum size of the list entries is NLM_FO_MAX_GP_CNT
 (1024).
 
 -- Wendy
--------------- next part --------------
-A non-text attachment was scrubbed...
-Name: resume_002.patch
-Type: text/x-patch
-Size: 7606 bytes
-Desc: not available
-URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20080125/dd51e9e7/attachment.bin>
diff --git a/N1/2.hdr b/N1/2.hdr
new file mode 100644
index 0000000..f007eeb
--- /dev/null
+++ b/N1/2.hdr
@@ -0,0 +1,5 @@
+Content-Type: text/x-patch;
+ name="resume_002.patch"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: inline;
+ filename="resume_002.patch"
diff --git a/N1/2.txt b/N1/2.txt
new file mode 100644
index 0000000..34a0793
--- /dev/null
+++ b/N1/2.txt
@@ -0,0 +1,250 @@
+The logic is implemented on top of linux nfsd procfs with core functions
+residing in lockd kernel module. Entry function is nlmsvc_resume_ip() where
+it stores the requested ip interface into a linked-list nlm_failover_list.
+The list entry count is nlm_failover_cnt and access protection is done by
+nlm_failover_mutex. Entry in nlm_failover_ip_list is a "nlm_failover_struct", 
+defined in: include/linux/lockd/lockd.h.
+
+The list is kept in descending order (newer entry first) based on g_expire
+jiffies. For per ip grace period checking, the search goes thru the list.
+As soon as one match ip is found, the search stops. This implies older
+entries will not be used and always expire before new entry. This is to allow 
+multiple entries (for the same ip) to be added into the list. The maximum size 
+of the list entries is NLM_FO_MAX_GP_CNT (1024).
+
+Signed-off-by: S. Wendy Cheng <wcheng@redhat.com>
+Signed-off-by: Lon Hohberger  <lhh@redhat.com>
+
+ fs/lockd/svc.c              |    4 +
+ fs/lockd/svcsubs.c          |  159 +++++++++++++++++++++++++++++++++++++++++++-
+ include/linux/lockd/lockd.h |   14 +++
+ 3 files changed, 174 insertions(+), 3 deletions(-)
+
+--- linux-2/include/linux/lockd/lockd.h	2008-01-24 17:07:21.000000000 -0500
++++ linux-3/include/linux/lockd/lockd.h	2008-01-24 17:09:26.000000000 -0500
+@@ -221,6 +221,20 @@ void		  nlmsvc_invalidate_all(void);
+ int           nlmsvc_failover_path(struct nameidata *nd);
+ int           nlmsvc_failover_ip(__be32 server_addr);
+ int           nlmsvc_failover_setgrace(void *server_ip, int ip_size);
++void          nlmsvc_failover_reset(void);
++
++#define NLM_FO_MAX_GP_CNT	1024
++
++struct nlm_failover_struct {
++	struct list_head	g_list;		/* linked list */
++	unsigned long		g_expire;	/* grace period expire */
++	int			g_size;		/* g_key type: ipv4 or ipv6 */
++	union {
++		__be32		ipv4;		/* ip v4 address */
++		__be32		ipv6[4];	/* ip v6 address */
++	} g_key;
++#define g_ip			g_key.ipv6
++};
+ 
+ static __inline__ struct inode *
+ nlmsvc_file_inode(struct nlm_file *file)
+--- linux-2/fs/lockd/svc.c	2008-01-22 11:44:48.000000000 -0500
++++ linux-3/fs/lockd/svc.c	2008-01-24 17:30:55.000000000 -0500
+@@ -145,6 +145,7 @@ lockd(struct svc_rqst *rqstp)
+ 	nlmsvc_timeout = nlm_timeout * HZ;
+ 
+ 	grace_period_expire = set_grace_period();
++	nlmsvc_failover_reset();
+ 
+ 	/*
+ 	 * The main request loop. We don't terminate until the last
+@@ -160,6 +161,7 @@ lockd(struct svc_rqst *rqstp)
+ 			if (nlmsvc_ops) {
+ 				nlmsvc_invalidate_all();
+ 				grace_period_expire = set_grace_period();
++				nlmsvc_failover_reset();
+ 			}
+ 		}
+ 
+@@ -209,6 +211,8 @@ lockd(struct svc_rqst *rqstp)
+ 	} else
+ 		printk(KERN_DEBUG
+ 			"lockd: new process, skipping host shutdown\n");
++
++	nlmsvc_failover_reset();
+ 	wake_up(&lockd_exit);
+ 
+ 	/* Exit the RPC thread */
+--- linux-2/fs/lockd/svcsubs.c	2008-01-22 11:45:44.000000000 -0500
++++ linux-3/fs/lockd/svcsubs.c	2008-01-24 17:35:30.000000000 -0500
+@@ -23,7 +23,6 @@
+ 
+ #define NLMDBG_FACILITY		NLMDBG_SVCSUBS
+ 
+-
+ /*
+  * Global file hash table
+  */
+@@ -423,11 +422,165 @@ nlmsvc_failover_ip(__be32 server_addr)
+ }
+ EXPORT_SYMBOL_GPL(nlmsvc_failover_ip);
+ 
++static DEFINE_MUTEX(nlm_failover_mutex);
++int nlm_failover_cnt;
++LIST_HEAD(nlm_failover_list);
++
++/* garbage collection */
++static inline
++int __fo_check_expire(struct nlm_failover_struct *e_this, struct list_head *p)
++{
++	if (time_before(e_this->g_expire, jiffies)) {
++		dprintk("lockd: ip=%u.%u.%u.%u grace period expires\n",
++			NIPQUAD(*e_this->g_ip));
++		list_del(p);
++		nlm_failover_cnt--;
++		kfree(e_this);
++		return 1;
++	}
++	return 0;
++}
++
++/*
++ * Add grace period setting into global nlm_failover_struct_list where it
++ * stores the server ip interfaces that should be in grace period.
++ *
++ * It is different from (but not conflict with) system-wide lockd grace
++ * period when lockd is first initialized (see nlmsvc_check_grace_period
++ * for details).
++ *
++ * The list is searched with top-down order (newer entry first). As soon
++ * as one is found, the search stops. This implies older entries will not
++ * be used and always expire before new entry.
++ *
++ * As an admin interface, the list is expected to be short and entries are
++ * purged (expired) quickly.
++ */
++
+ int
+ nlmsvc_failover_setgrace(void *server_ip, int ip_size)
+ {
+-	/* implemented by resume_002.patch */
+-	return ENOSYS;
++	struct list_head *p, *tlist;
++	struct nlm_failover_struct *per_ip, *entry;
++	int done = 0;
++	ulong time_expire;
++
++	/* allocate the entry */
++	per_ip = kzalloc(sizeof(struct nlm_failover_struct), GFP_KERNEL);
++	if (per_ip == NULL) {
++		dprintk("lockd: nlmsvc_fo_setgrace kmalloc fails\n");
++		return(-ENOMEM);
++	}
++
++	/* fill in info */
++	per_ip->g_size = ip_size;
++	memcpy((void *) per_ip->g_ip, (void *) server_ip, ip_size);
++	time_expire = get_nfs_grace_period();
++	per_ip->g_expire = time_expire + jiffies;
++	dprintk("lockd: fo_setgrace ip=%u.%u.%u.%u, ip_size=%d, expire=%lu\n",
++		   NIPQUAD(per_ip->g_ip[0]), ip_size, per_ip->g_expire);
++
++	/* add to the nlm_failover_list*/
++	mutex_lock(&nlm_failover_mutex);
++
++	/* handle special case */
++	if (list_empty(&nlm_failover_list)) {
++		list_add(&per_ip->g_list, &nlm_failover_list);
++		nlm_failover_cnt = 1;
++		done = 1;
++		goto nlmsvc_fo_setgrace_out;
++	}
++
++	/* add to list */
++	list_for_each_safe(p, tlist, &nlm_failover_list) {
++		entry = list_entry(p, struct nlm_failover_struct, g_list);
++		if (!done) {
++			/* add the new ip into the list */
++			if (entry->g_expire <= per_ip->g_expire) {
++				list_add(&per_ip->g_list, &entry->g_list);
++				nlm_failover_cnt++;
++				done = 1;
++			}
++		} else {
++			/* garbage collection:
++			 * we really don't care about duplicate keys
++			 * since the list is inserted in descending order */
++			if (!__fo_check_expire(entry, p))
++				goto nlmsvc_fo_setgrace_out;
++		}
++	}
++
++	/* unlikely event but check for the limit */
++	if (nlm_failover_cnt > NLM_FO_MAX_GP_CNT) {
++		list_del(&per_ip->g_list);
++		nlm_failover_cnt--;
++		kfree(per_ip);
++		done = 0;
++		dprintk("lockd: error fo_setgrace max cnt reached\n");
++	}
++
++nlmsvc_fo_setgrace_out:
++	mutex_unlock(&nlm_failover_mutex);
++	if (done)
++		dprintk("lockd: nlmsvc_failover_list=%p\n", &nlm_failover_list);
++	return 0;
+ }
+ EXPORT_SYMBOL_GPL(nlmsvc_failover_setgrace);
+ 
++/*
++ * Reset global nlm_failover_struct list
++ */
++void
++nlmsvc_failover_reset(void)
++{
++	struct nlm_failover_struct *e_purge;
++	struct list_head *p, *tlist;
++
++	mutex_lock(&nlm_failover_mutex);
++
++	/* nothing to do */
++	if (list_empty(&nlm_failover_list)) {
++		mutex_unlock(&nlm_failover_mutex);
++		return;
++	}
++
++	/* purge the entries */
++	list_for_each_safe(p, tlist, &nlm_failover_list) {
++		e_purge = list_entry(p, struct nlm_failover_struct, g_list);
++		list_del(p);
++		kfree(e_purge);
++	}
++	nlm_failover_cnt = 0;
++
++	mutex_unlock(&nlm_failover_mutex);
++}
++
++/*
++ * Check whether the ip is in the failover list: nlm_failover_list.
++ *	- nlm_failover_mutex taken
++ *	- return TRUE (1) if ip in grace period.
++ */
++int
++nlmsvc_failover_check(struct svc_rqst *rqstp)
++{
++	struct nlm_failover_struct *e_this;
++	struct list_head *p, *tlist;
++	int rc = 0, done = 0;
++	struct in6_addr *addr_u = &rqstp->rq_daddr.addr6;
++
++	mutex_lock(&nlm_failover_mutex);
++
++	/* assume rq_daddr structure is zeroed out upon creation */
++	list_for_each_safe(p, tlist, &nlm_failover_list) {
++		e_this = list_entry(p, struct nlm_failover_struct, g_list);
++		if (!__fo_check_expire(e_this, p)) {
++			if (!done &&
++			    !memcmp((void *) e_this->g_ip, (void *) addr_u,
++					e_this->g_size))
++			    done = rc = 1;
++		}
++	}
++
++	mutex_unlock(&nlm_failover_mutex);
++	return rc;
++}
diff --git a/a/content_digest b/N1/content_digest
index 3bc4fd9..799597e 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -1,8 +1,9 @@
  "From\0Wendy Cheng <wcheng@redhat.com>\0"
- "Subject\0[Cluster-devel] [PATCH 2/3] NLM per-ip grace period - core\0"
+ "Subject\0[PATCH 2/3] NLM per-ip grace period - core\0"
  "Date\0Fri, 25 Jan 2008 00:17:30 -0500\0"
- "To\0cluster-devel.redhat.com\0"
- "\00:1\0"
+ "To\0NFS list <linux-nfs@vger.kernel.org>"
+ " cluster-devel@redhat.com\0"
+ "\01:1\0"
  "b\0"
  "The logic is implemented on top of linux nfsd procfs with core functions \n"
  "residing in lockd kernel module. Entry function is nlmsvc_resume_ip() \n"
@@ -19,13 +20,259 @@
  "into the list. The maximum size of the list entries is NLM_FO_MAX_GP_CNT \n"
  "(1024).\n"
  "\n"
- "-- Wendy\n"
- "-------------- next part --------------\n"
- "A non-text attachment was scrubbed...\n"
- "Name: resume_002.patch\n"
- "Type: text/x-patch\n"
- "Size: 7606 bytes\n"
- "Desc: not available\n"
- URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20080125/dd51e9e7/attachment.bin>
+ -- Wendy
+ "\01:2\0"
+ "fn\0resume_002.patch\0"
+ "b\0"
+ "The logic is implemented on top of linux nfsd procfs with core functions\n"
+ "residing in lockd kernel module. Entry function is nlmsvc_resume_ip() where\n"
+ "it stores the requested ip interface into a linked-list nlm_failover_list.\n"
+ "The list entry count is nlm_failover_cnt and access protection is done by\n"
+ "nlm_failover_mutex. Entry in nlm_failover_ip_list is a \"nlm_failover_struct\", \n"
+ "defined in: include/linux/lockd/lockd.h.\n"
+ "\n"
+ "The list is kept in descending order (newer entry first) based on g_expire\n"
+ "jiffies. For per ip grace period checking, the search goes thru the list.\n"
+ "As soon as one match ip is found, the search stops. This implies older\n"
+ "entries will not be used and always expire before new entry. This is to allow \n"
+ "multiple entries (for the same ip) to be added into the list. The maximum size \n"
+ "of the list entries is NLM_FO_MAX_GP_CNT (1024).\n"
+ "\n"
+ "Signed-off-by: S. Wendy Cheng <wcheng@redhat.com>\n"
+ "Signed-off-by: Lon Hohberger  <lhh@redhat.com>\n"
+ "\n"
+ " fs/lockd/svc.c              |    4 +\n"
+ " fs/lockd/svcsubs.c          |  159 +++++++++++++++++++++++++++++++++++++++++++-\n"
+ " include/linux/lockd/lockd.h |   14 +++\n"
+ " 3 files changed, 174 insertions(+), 3 deletions(-)\n"
+ "\n"
+ "--- linux-2/include/linux/lockd/lockd.h\t2008-01-24 17:07:21.000000000 -0500\n"
+ "+++ linux-3/include/linux/lockd/lockd.h\t2008-01-24 17:09:26.000000000 -0500\n"
+ "@@ -221,6 +221,20 @@ void\t\t  nlmsvc_invalidate_all(void);\n"
+ " int           nlmsvc_failover_path(struct nameidata *nd);\n"
+ " int           nlmsvc_failover_ip(__be32 server_addr);\n"
+ " int           nlmsvc_failover_setgrace(void *server_ip, int ip_size);\n"
+ "+void          nlmsvc_failover_reset(void);\n"
+ "+\n"
+ "+#define NLM_FO_MAX_GP_CNT\t1024\n"
+ "+\n"
+ "+struct nlm_failover_struct {\n"
+ "+\tstruct list_head\tg_list;\t\t/* linked list */\n"
+ "+\tunsigned long\t\tg_expire;\t/* grace period expire */\n"
+ "+\tint\t\t\tg_size;\t\t/* g_key type: ipv4 or ipv6 */\n"
+ "+\tunion {\n"
+ "+\t\t__be32\t\tipv4;\t\t/* ip v4 address */\n"
+ "+\t\t__be32\t\tipv6[4];\t/* ip v6 address */\n"
+ "+\t} g_key;\n"
+ "+#define g_ip\t\t\tg_key.ipv6\n"
+ "+};\n"
+ " \n"
+ " static __inline__ struct inode *\n"
+ " nlmsvc_file_inode(struct nlm_file *file)\n"
+ "--- linux-2/fs/lockd/svc.c\t2008-01-22 11:44:48.000000000 -0500\n"
+ "+++ linux-3/fs/lockd/svc.c\t2008-01-24 17:30:55.000000000 -0500\n"
+ "@@ -145,6 +145,7 @@ lockd(struct svc_rqst *rqstp)\n"
+ " \tnlmsvc_timeout = nlm_timeout * HZ;\n"
+ " \n"
+ " \tgrace_period_expire = set_grace_period();\n"
+ "+\tnlmsvc_failover_reset();\n"
+ " \n"
+ " \t/*\n"
+ " \t * The main request loop. We don't terminate until the last\n"
+ "@@ -160,6 +161,7 @@ lockd(struct svc_rqst *rqstp)\n"
+ " \t\t\tif (nlmsvc_ops) {\n"
+ " \t\t\t\tnlmsvc_invalidate_all();\n"
+ " \t\t\t\tgrace_period_expire = set_grace_period();\n"
+ "+\t\t\t\tnlmsvc_failover_reset();\n"
+ " \t\t\t}\n"
+ " \t\t}\n"
+ " \n"
+ "@@ -209,6 +211,8 @@ lockd(struct svc_rqst *rqstp)\n"
+ " \t} else\n"
+ " \t\tprintk(KERN_DEBUG\n"
+ " \t\t\t\"lockd: new process, skipping host shutdown\\n\");\n"
+ "+\n"
+ "+\tnlmsvc_failover_reset();\n"
+ " \twake_up(&lockd_exit);\n"
+ " \n"
+ " \t/* Exit the RPC thread */\n"
+ "--- linux-2/fs/lockd/svcsubs.c\t2008-01-22 11:45:44.000000000 -0500\n"
+ "+++ linux-3/fs/lockd/svcsubs.c\t2008-01-24 17:35:30.000000000 -0500\n"
+ "@@ -23,7 +23,6 @@\n"
+ " \n"
+ " #define NLMDBG_FACILITY\t\tNLMDBG_SVCSUBS\n"
+ " \n"
+ "-\n"
+ " /*\n"
+ "  * Global file hash table\n"
+ "  */\n"
+ "@@ -423,11 +422,165 @@ nlmsvc_failover_ip(__be32 server_addr)\n"
+ " }\n"
+ " EXPORT_SYMBOL_GPL(nlmsvc_failover_ip);\n"
+ " \n"
+ "+static DEFINE_MUTEX(nlm_failover_mutex);\n"
+ "+int nlm_failover_cnt;\n"
+ "+LIST_HEAD(nlm_failover_list);\n"
+ "+\n"
+ "+/* garbage collection */\n"
+ "+static inline\n"
+ "+int __fo_check_expire(struct nlm_failover_struct *e_this, struct list_head *p)\n"
+ "+{\n"
+ "+\tif (time_before(e_this->g_expire, jiffies)) {\n"
+ "+\t\tdprintk(\"lockd: ip=%u.%u.%u.%u grace period expires\\n\",\n"
+ "+\t\t\tNIPQUAD(*e_this->g_ip));\n"
+ "+\t\tlist_del(p);\n"
+ "+\t\tnlm_failover_cnt--;\n"
+ "+\t\tkfree(e_this);\n"
+ "+\t\treturn 1;\n"
+ "+\t}\n"
+ "+\treturn 0;\n"
+ "+}\n"
+ "+\n"
+ "+/*\n"
+ "+ * Add grace period setting into global nlm_failover_struct_list where it\n"
+ "+ * stores the server ip interfaces that should be in grace period.\n"
+ "+ *\n"
+ "+ * It is different from (but not conflict with) system-wide lockd grace\n"
+ "+ * period when lockd is first initialized (see nlmsvc_check_grace_period\n"
+ "+ * for details).\n"
+ "+ *\n"
+ "+ * The list is searched with top-down order (newer entry first). As soon\n"
+ "+ * as one is found, the search stops. This implies older entries will not\n"
+ "+ * be used and always expire before new entry.\n"
+ "+ *\n"
+ "+ * As an admin interface, the list is expected to be short and entries are\n"
+ "+ * purged (expired) quickly.\n"
+ "+ */\n"
+ "+\n"
+ " int\n"
+ " nlmsvc_failover_setgrace(void *server_ip, int ip_size)\n"
+ " {\n"
+ "-\t/* implemented by resume_002.patch */\n"
+ "-\treturn ENOSYS;\n"
+ "+\tstruct list_head *p, *tlist;\n"
+ "+\tstruct nlm_failover_struct *per_ip, *entry;\n"
+ "+\tint done = 0;\n"
+ "+\tulong time_expire;\n"
+ "+\n"
+ "+\t/* allocate the entry */\n"
+ "+\tper_ip = kzalloc(sizeof(struct nlm_failover_struct), GFP_KERNEL);\n"
+ "+\tif (per_ip == NULL) {\n"
+ "+\t\tdprintk(\"lockd: nlmsvc_fo_setgrace kmalloc fails\\n\");\n"
+ "+\t\treturn(-ENOMEM);\n"
+ "+\t}\n"
+ "+\n"
+ "+\t/* fill in info */\n"
+ "+\tper_ip->g_size = ip_size;\n"
+ "+\tmemcpy((void *) per_ip->g_ip, (void *) server_ip, ip_size);\n"
+ "+\ttime_expire = get_nfs_grace_period();\n"
+ "+\tper_ip->g_expire = time_expire + jiffies;\n"
+ "+\tdprintk(\"lockd: fo_setgrace ip=%u.%u.%u.%u, ip_size=%d, expire=%lu\\n\",\n"
+ "+\t\t   NIPQUAD(per_ip->g_ip[0]), ip_size, per_ip->g_expire);\n"
+ "+\n"
+ "+\t/* add to the nlm_failover_list*/\n"
+ "+\tmutex_lock(&nlm_failover_mutex);\n"
+ "+\n"
+ "+\t/* handle special case */\n"
+ "+\tif (list_empty(&nlm_failover_list)) {\n"
+ "+\t\tlist_add(&per_ip->g_list, &nlm_failover_list);\n"
+ "+\t\tnlm_failover_cnt = 1;\n"
+ "+\t\tdone = 1;\n"
+ "+\t\tgoto nlmsvc_fo_setgrace_out;\n"
+ "+\t}\n"
+ "+\n"
+ "+\t/* add to list */\n"
+ "+\tlist_for_each_safe(p, tlist, &nlm_failover_list) {\n"
+ "+\t\tentry = list_entry(p, struct nlm_failover_struct, g_list);\n"
+ "+\t\tif (!done) {\n"
+ "+\t\t\t/* add the new ip into the list */\n"
+ "+\t\t\tif (entry->g_expire <= per_ip->g_expire) {\n"
+ "+\t\t\t\tlist_add(&per_ip->g_list, &entry->g_list);\n"
+ "+\t\t\t\tnlm_failover_cnt++;\n"
+ "+\t\t\t\tdone = 1;\n"
+ "+\t\t\t}\n"
+ "+\t\t} else {\n"
+ "+\t\t\t/* garbage collection:\n"
+ "+\t\t\t * we really don't care about duplicate keys\n"
+ "+\t\t\t * since the list is inserted in descending order */\n"
+ "+\t\t\tif (!__fo_check_expire(entry, p))\n"
+ "+\t\t\t\tgoto nlmsvc_fo_setgrace_out;\n"
+ "+\t\t}\n"
+ "+\t}\n"
+ "+\n"
+ "+\t/* unlikely event but check for the limit */\n"
+ "+\tif (nlm_failover_cnt > NLM_FO_MAX_GP_CNT) {\n"
+ "+\t\tlist_del(&per_ip->g_list);\n"
+ "+\t\tnlm_failover_cnt--;\n"
+ "+\t\tkfree(per_ip);\n"
+ "+\t\tdone = 0;\n"
+ "+\t\tdprintk(\"lockd: error fo_setgrace max cnt reached\\n\");\n"
+ "+\t}\n"
+ "+\n"
+ "+nlmsvc_fo_setgrace_out:\n"
+ "+\tmutex_unlock(&nlm_failover_mutex);\n"
+ "+\tif (done)\n"
+ "+\t\tdprintk(\"lockd: nlmsvc_failover_list=%p\\n\", &nlm_failover_list);\n"
+ "+\treturn 0;\n"
+ " }\n"
+ " EXPORT_SYMBOL_GPL(nlmsvc_failover_setgrace);\n"
+ " \n"
+ "+/*\n"
+ "+ * Reset global nlm_failover_struct list\n"
+ "+ */\n"
+ "+void\n"
+ "+nlmsvc_failover_reset(void)\n"
+ "+{\n"
+ "+\tstruct nlm_failover_struct *e_purge;\n"
+ "+\tstruct list_head *p, *tlist;\n"
+ "+\n"
+ "+\tmutex_lock(&nlm_failover_mutex);\n"
+ "+\n"
+ "+\t/* nothing to do */\n"
+ "+\tif (list_empty(&nlm_failover_list)) {\n"
+ "+\t\tmutex_unlock(&nlm_failover_mutex);\n"
+ "+\t\treturn;\n"
+ "+\t}\n"
+ "+\n"
+ "+\t/* purge the entries */\n"
+ "+\tlist_for_each_safe(p, tlist, &nlm_failover_list) {\n"
+ "+\t\te_purge = list_entry(p, struct nlm_failover_struct, g_list);\n"
+ "+\t\tlist_del(p);\n"
+ "+\t\tkfree(e_purge);\n"
+ "+\t}\n"
+ "+\tnlm_failover_cnt = 0;\n"
+ "+\n"
+ "+\tmutex_unlock(&nlm_failover_mutex);\n"
+ "+}\n"
+ "+\n"
+ "+/*\n"
+ "+ * Check whether the ip is in the failover list: nlm_failover_list.\n"
+ "+ *\t- nlm_failover_mutex taken\n"
+ "+ *\t- return TRUE (1) if ip in grace period.\n"
+ "+ */\n"
+ "+int\n"
+ "+nlmsvc_failover_check(struct svc_rqst *rqstp)\n"
+ "+{\n"
+ "+\tstruct nlm_failover_struct *e_this;\n"
+ "+\tstruct list_head *p, *tlist;\n"
+ "+\tint rc = 0, done = 0;\n"
+ "+\tstruct in6_addr *addr_u = &rqstp->rq_daddr.addr6;\n"
+ "+\n"
+ "+\tmutex_lock(&nlm_failover_mutex);\n"
+ "+\n"
+ "+\t/* assume rq_daddr structure is zeroed out upon creation */\n"
+ "+\tlist_for_each_safe(p, tlist, &nlm_failover_list) {\n"
+ "+\t\te_this = list_entry(p, struct nlm_failover_struct, g_list);\n"
+ "+\t\tif (!__fo_check_expire(e_this, p)) {\n"
+ "+\t\t\tif (!done &&\n"
+ "+\t\t\t    !memcmp((void *) e_this->g_ip, (void *) addr_u,\n"
+ "+\t\t\t\t\te_this->g_size))\n"
+ "+\t\t\t    done = rc = 1;\n"
+ "+\t\t}\n"
+ "+\t}\n"
+ "+\n"
+ "+\tmutex_unlock(&nlm_failover_mutex);\n"
+ "+\treturn rc;\n"
+ +}
 
-9e342f5e2085a1c96e24ce1f0150788347e44e32285f3356591ac9fdee7a92cc
+8420b6059721efbfab917dd4d71a0b0790f1fb060a341a5aa962736cdff5107f

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.