kernel - Mark kqfilters of several devices MPSAFE
authorSamuel J. Greear <sjg@thesjg.com>
Sun, 12 Dec 2010 23:27:19 +0000 (23:27 +0000)
committerSamuel J. Greear <sjg@thesjg.com>
Sun, 12 Dec 2010 23:27:19 +0000 (23:27 +0000)
* Memory I/O devices, Pipes, TTY's and PTY's

* Also correct MPSAFE'ty comment for kern_close()

sys/kern/kern_descrip.c
sys/kern/kern_memio.c
sys/kern/sys_pipe.c
sys/kern/tty.c
sys/kern/tty_pty.c

index cc6c210..d160e55 100644 (file)
@@ -816,7 +816,7 @@ sys_close(struct close_args *uap)
 }
 
 /*
- * MPALMOSTSAFE - acquires mplock around knote_fdclose() calls
+ * MPSAFE
  */
 int
 kern_close(int fd)
index 9075e3f..37e4032 100644 (file)
@@ -553,14 +553,15 @@ mm_filter_write(struct knote *kn, long hint)
 static void
 dummy_filter_detach(struct knote *kn) {}
 
+/* Implemented in kern_nrandom.c */
 static struct filterops random_read_filtops =
-        { FILTEROP_ISFD, NULL, dummy_filter_detach, random_filter_read };
+        { FILTEROP_ISFD|FILTEROP_MPSAFE, NULL, dummy_filter_detach, random_filter_read };
 
 static struct filterops mm_read_filtops =
-        { FILTEROP_ISFD, NULL, dummy_filter_detach, mm_filter_read };
+        { FILTEROP_ISFD|FILTEROP_MPSAFE, NULL, dummy_filter_detach, mm_filter_read };
 
 static struct filterops mm_write_filtops =
-        { FILTEROP_ISFD, NULL, dummy_filter_detach, mm_filter_write };
+        { FILTEROP_ISFD|FILTEROP_MPSAFE, NULL, dummy_filter_detach, mm_filter_write };
 
 int
 mmkqfilter(struct dev_kqfilter_args *ap)
index 467b95a..7b64efc 100644 (file)
@@ -93,9 +93,9 @@ static int    filt_piperead(struct knote *kn, long hint);
 static int     filt_pipewrite(struct knote *kn, long hint);
 
 static struct filterops pipe_rfiltops =
-       { FILTEROP_ISFD, NULL, filt_pipedetach, filt_piperead };
+       { FILTEROP_ISFD|FILTEROP_MPSAFE, NULL, filt_pipedetach, filt_piperead };
 static struct filterops pipe_wfiltops =
-       { FILTEROP_ISFD, NULL, filt_pipedetach, filt_pipewrite };
+       { FILTEROP_ISFD|FILTEROP_MPSAFE, NULL, filt_pipedetach, filt_pipewrite };
 
 MALLOC_DEFINE(M_PIPE, "pipe", "pipe structures");
 
index 36aef0e..348d770 100644 (file)
@@ -1280,9 +1280,9 @@ ttioctl(struct tty *tp, u_long cmd, void *data, int flag)
 }
 
 static struct filterops ttyread_filtops =
-       { FILTEROP_ISFD, NULL, filt_ttyrdetach, filt_ttyread };
+       { FILTEROP_ISFD|FILTEROP_MPSAFE, NULL, filt_ttyrdetach, filt_ttyread };
 static struct filterops ttywrite_filtops =
-       { FILTEROP_ISFD, NULL, filt_ttywdetach, filt_ttywrite };
+       { FILTEROP_ISFD|FILTEROP_MPSAFE, NULL, filt_ttywdetach, filt_ttywrite };
 
 int
 ttykqfilter(struct dev_kqfilter_args *ap)
index a9e6980..cd553da 100644 (file)
@@ -847,9 +847,9 @@ ptsunhold(struct tty *tp)
  * kqueue ops for pseudo-terminals.
  */
 static struct filterops ptcread_filtops =
-       { FILTEROP_ISFD, NULL, filt_ptcrdetach, filt_ptcread };
+       { FILTEROP_ISFD|FILTEROP_MPSAFE, NULL, filt_ptcrdetach, filt_ptcread };
 static struct filterops ptcwrite_filtops =
-       { FILTEROP_ISFD, NULL, filt_ptcwdetach, filt_ptcwrite };
+       { FILTEROP_ISFD|FILTEROP_MPSAFE, NULL, filt_ptcwdetach, filt_ptcwrite };
 
 static int
 ptckqfilter(struct dev_kqfilter_args *ap)