aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-12-13 09:29:52 +0100
committerTakashi Iwai <tiwai@suse.de>2010-12-13 09:29:52 +0100
commit354d14b3f53cc749c5d26d4ba7280d1e931d6bc4 (patch)
tree59b597e44902d8db8bde7deac1e7e707327c6fe6 /include/linux/sunrpc
parentALSA: aoa: Remove wrong i2c_set_clientdata in onyx_i2c_remove() (diff)
parentsound: don't use flush_scheduled_work() (diff)
downloadlinux-dev-354d14b3f53cc749c5d26d4ba7280d1e931d6bc4.tar.xz
linux-dev-354d14b3f53cc749c5d26d4ba7280d1e931d6bc4.zip
Merge branch 'topic/workq-update' into topic/misc
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r--include/linux/sunrpc/svc_xprt.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index bbdb680ffbe9..aea0d438e3c7 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -82,18 +82,28 @@ struct svc_xprt {
struct net *xpt_net;
};
-static inline void register_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u)
+static inline void unregister_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u)
{
spin_lock(&xpt->xpt_lock);
- list_add(&u->list, &xpt->xpt_users);
+ list_del_init(&u->list);
spin_unlock(&xpt->xpt_lock);
}
-static inline void unregister_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u)
+static inline int register_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u)
{
spin_lock(&xpt->xpt_lock);
- list_del_init(&u->list);
+ if (test_bit(XPT_CLOSE, &xpt->xpt_flags)) {
+ /*
+ * The connection is about to be deleted soon (or,
+ * worse, may already be deleted--in which case we've
+ * already notified the xpt_users).
+ */
+ spin_unlock(&xpt->xpt_lock);
+ return -ENOTCONN;
+ }
+ list_add(&u->list, &xpt->xpt_users);
spin_unlock(&xpt->xpt_lock);
+ return 0;
}
int svc_reg_xprt_class(struct svc_xprt_class *);