Module Name:    src
Committed By:   pooka
Date:           Sun Apr 28 10:53:22 UTC 2013

Modified Files:
        src/sys/rump/net/lib/libshmif: if_shmem.c rumpcomp_user.c
            rumpcomp_user.h

Log Message:
* remove the unused "opaque" parameter
* fix some typos in the previous


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/rump/net/lib/libshmif/if_shmem.c
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libshmif/rumpcomp_user.c \
    src/sys/rump/net/lib/libshmif/rumpcomp_user.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.48 src/sys/rump/net/lib/libshmif/if_shmem.c:1.49
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.48	Sun Apr 28 10:43:45 2013
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Sun Apr 28 10:53:21 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.48 2013/04/28 10:43:45 pooka Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.49 2013/04/28 10:53:21 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.48 2013/04/28 10:43:45 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.49 2013/04/28 10:53:21 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -251,7 +251,7 @@ initbackend(struct shmif_sc *sc, int mem
 #endif
 	shmif_unlockbus(sc->sc_busmem);
 
-	sc->sc_kq = rumpcomp_shmif_watchsetup(-1, memfd, 0, &error);
+	sc->sc_kq = rumpcomp_shmif_watchsetup(-1, memfd, &error);
 	if (sc->sc_kq == -1) {
 		rumpuser_unmap(sc->sc_busmem, BUSMEM_SIZE);
 		return error;
@@ -669,7 +669,7 @@ shmif_rcv(void *arg)
 		     == sc->sc_nextpacket) {
 			shmif_unlockbus(busmem);
 			error = 0;
-			rumpcomp_shmif_watchwait(sc->sc_kq, NULL, &error);
+			rumpcomp_shmif_watchwait(sc->sc_kq, &error);
 			if (__predict_false(error))
 				printf("shmif_rcv: wait failed %d\n", error);
 			membar_consumer();

Index: src/sys/rump/net/lib/libshmif/rumpcomp_user.c
diff -u src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.1 src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.2
--- src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.1	Sun Apr 28 10:43:45 2013
+++ src/sys/rump/net/lib/libshmif/rumpcomp_user.c	Sun Apr 28 10:53:22 2013
@@ -1,4 +1,4 @@
-/*      $NetBSD: rumpcomp_user.c,v 1.1 2013/04/28 10:43:45 pooka Exp $	*/
+/*      $NetBSD: rumpcomp_user.c,v 1.2 2013/04/28 10:53:22 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -42,7 +42,7 @@
  */
 #if defined(__NetBSD__)
 int
-rumpcomp_shmif_watchsetup(int kq, int fd, intptr_t opaque, int *error)
+rumpcomp_shmif_watchsetup(int kq, int fd, int *error)
 {
 	struct kevent kev;
 	int rv;
@@ -56,14 +56,16 @@ rumpcomp_shmif_watchsetup(int kq, int fd
 	}
 
 	EV_SET(&kev, fd, EVFILT_VNODE, EV_ADD|EV_ENABLE|EV_CLEAR,
-	    NOTE_WRITE, 0, opaque);
+	    NOTE_WRITE, 0, 0);
 	rv = kevent(kq, &kev, 1, NULL, 0, NULL);
 	*error = errno;
-	return rv;
+	if (rv == -1)
+		return -1;
+	return kq;
 }
 
 int
-rumpcomp_shmif_watchwait(int kq, intptr_t *opaque, int *error)
+rumpcomp_shmif_watchwait(int kq, int *error)
 {
 	void *cookie;
 	struct kevent kev;
@@ -73,10 +75,8 @@ rumpcomp_shmif_watchwait(int kq, intptr_
 	do {
 		rv = kevent(kq, NULL, 0, &kev, 1, NULL);
 	} while (rv == -1 && errno == EINTR);
-
 	*error = errno;
-	if (rv != -1 && opaque)
-		*opaque = kev.udata;
+
 	rumpuser_component_schedule(cookie);
 	return rv;
 }
@@ -85,7 +85,7 @@ rumpcomp_shmif_watchwait(int kq, intptr_
 #include <sys/inotify.h>
 
 int
-rumpcomp_shmif_watchsetup(int inotify, int fd, intptr_t notused, int *error)
+rumpcomp_shmif_watchsetup(int inotify, int fd, int *error)
 {
 	char procbuf[PATH_MAX], linkbuf[PATH_MAX];
 	ssize_t nn;
@@ -122,7 +122,7 @@ rumpcomp_shmif_watchsetup(int inotify, i
 }
 
 int
-rumpcomp_shmif_watchwait(int kq, intptr_t *opaque, int *error)
+rumpcomp_shmif_watchwait(int kq, int *error)
 {
 	struct inotify_event iev;
 	void *cookie;
@@ -145,7 +145,7 @@ rumpcomp_shmif_watchwait(int kq, intptr_
 
 /* a polling default implementation */
 int
-rumpcomp_shmif_watchsetup(int inotify, int fd, intptr_t notused, int *error)
+rumpcomp_shmif_watchsetup(int inotify, int fd, int *error)
 {
 	static int warned = 0;
 
@@ -159,7 +159,7 @@ rumpcomp_shmif_watchsetup(int inotify, i
 }
 
 int
-rumpcomp_shmif_watchwait(int kq, intptr_t *opaque, int *error)
+rumpcomp_shmif_watchwait(int kq, int *error)
 {
 	void *cookie;
 
Index: src/sys/rump/net/lib/libshmif/rumpcomp_user.h
diff -u src/sys/rump/net/lib/libshmif/rumpcomp_user.h:1.1 src/sys/rump/net/lib/libshmif/rumpcomp_user.h:1.2
--- src/sys/rump/net/lib/libshmif/rumpcomp_user.h:1.1	Sun Apr 28 10:43:45 2013
+++ src/sys/rump/net/lib/libshmif/rumpcomp_user.h	Sun Apr 28 10:53:22 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpcomp_user.h,v 1.1 2013/04/28 10:43:45 pooka Exp $	*/
+/*	$NetBSD: rumpcomp_user.h,v 1.2 2013/04/28 10:53:22 pooka Exp $	*/
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -25,5 +25,5 @@
  * SUCH DAMAGE.
  */
 
-int	rumpcomp_shmif_watchsetup(int, int, intptr_t, int *);
-int	rumpcomp_shmif_watchwait(int, intptr_t *, int *);
+int	rumpcomp_shmif_watchsetup(int, int, int *);
+int	rumpcomp_shmif_watchwait(int, int *);

Reply via email to