svn commit: r353269 - releng/12.1/sys/contrib/rdma/krping
Hans Petter Selasky
hselasky at FreeBSD.org
Mon Oct 7 12:51:38 UTC 2019
Author: hselasky
Date: Mon Oct 7 12:51:36 2019
New Revision: 353269
URL: https://svnweb.freebsd.org/changeset/base/353269
Log:
MFS r353180:
Notify all sleeping threads of device removal in krping.
Implement d_purge for krping_cdevsw.
Submitted by: slavash@
Sponsored by: Mellanox Technologies
Approved by: re (gjb)
Modified:
releng/12.1/sys/contrib/rdma/krping/krping.c
releng/12.1/sys/contrib/rdma/krping/krping.h
releng/12.1/sys/contrib/rdma/krping/krping_dev.c
Directory Properties:
releng/12.1/ (props changed)
Modified: releng/12.1/sys/contrib/rdma/krping/krping.c
==============================================================================
--- releng/12.1/sys/contrib/rdma/krping/krping.c Mon Oct 7 10:33:32 2019 (r353268)
+++ releng/12.1/sys/contrib/rdma/krping/krping.c Mon Oct 7 12:51:36 2019 (r353269)
@@ -2189,3 +2189,17 @@ krping_walk_cb_list(void (*f)(struct krping_stats *, v
(*f)(cb->pd ? &cb->stats : NULL, arg);
mutex_unlock(&krping_mutex);
}
+
+void
+krping_cancel_all(void)
+{
+ struct krping_cb *cb;
+
+ mutex_lock(&krping_mutex);
+ list_for_each_entry(cb, &krping_cbs, list) {
+ cb->state = ERROR;
+ wake_up_interruptible(&cb->sem);
+ }
+ mutex_unlock(&krping_mutex);
+}
+
Modified: releng/12.1/sys/contrib/rdma/krping/krping.h
==============================================================================
--- releng/12.1/sys/contrib/rdma/krping/krping.h Mon Oct 7 10:33:32 2019 (r353268)
+++ releng/12.1/sys/contrib/rdma/krping/krping.h Mon Oct 7 12:51:36 2019 (r353269)
@@ -17,3 +17,4 @@ struct krping_stats {
int krping_doit(char *);
void krping_walk_cb_list(void (*)(struct krping_stats *, void *), void *);
int krping_sigpending(void);
+void krping_cancel_all(void);
Modified: releng/12.1/sys/contrib/rdma/krping/krping_dev.c
==============================================================================
--- releng/12.1/sys/contrib/rdma/krping/krping_dev.c Mon Oct 7 10:33:32 2019 (r353268)
+++ releng/12.1/sys/contrib/rdma/krping/krping_dev.c Mon Oct 7 12:51:36 2019 (r353269)
@@ -40,6 +40,7 @@ static d_open_t krping_open;
static d_close_t krping_close;
static d_read_t krping_read;
static d_write_t krping_write;
+static d_purge_t krping_purge;
/* Character device entry points */
static struct cdevsw krping_cdevsw = {
@@ -48,6 +49,7 @@ static struct cdevsw krping_cdevsw = {
.d_close = krping_close,
.d_read = krping_read,
.d_write = krping_write,
+ .d_purge = krping_purge,
.d_name = "krping",
};
@@ -208,6 +210,13 @@ krping_write(struct cdev *dev, struct uio *uio, int io
done:
free(krpingmsg, M_DEVBUF);
return(err);
+}
+
+static void
+krping_purge(struct cdev *dev __unused)
+{
+
+ krping_cancel_all();
}
int
More information about the svn-src-all
mailing list