commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 04/10: eth-multiplexer: Simplify device creation.


From: Samuel Thibault
Subject: [hurd] 04/10: eth-multiplexer: Simplify device creation.
Date: Sun, 19 Nov 2017 15:27:17 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit 39a17aa65475b0115d824b99a6b4682cd4214af3
Author: Justus Winter <address@hidden>
Date:   Thu Sep 21 12:25:08 2017 +0200

    eth-multiplexer: Simplify device creation.
    
    * eth-multiplexer/vdev.c (add_vdev): Remove class and bucket parameter.
    * eth-multiplexer/vdev.h (add_vdev): Likewise.
    * eth-multiplexer/device_impl.c (ds_device_open): Update callsite.
---
 eth-multiplexer/device_impl.c | 9 +--------
 eth-multiplexer/vdev.c        | 5 ++---
 eth-multiplexer/vdev.h        | 7 ++++---
 3 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/eth-multiplexer/device_impl.c b/eth-multiplexer/device_impl.c
index d7c8bee..3be4fb5 100644
--- a/eth-multiplexer/device_impl.c
+++ b/eth-multiplexer/device_impl.c
@@ -33,9 +33,6 @@
 #include "netfs_impl.h"
 #include "util.h"
 
-extern struct port_bucket *port_bucket;
-extern struct port_class *vdev_portclass;
-extern struct port_class *other_portclass;
 extern struct port_info *notify_pi;
 
 /* Implementation of device interface */
@@ -60,15 +57,11 @@ ds_device_open (mach_port_t master_port, mach_port_t 
reply_port,
    * create it now. */
   if (pi->po->np->nn->ln == NULL)
     {
-      extern struct port_bucket *port_bucket;
-      extern struct port_class *vdev_portclass;
       extern struct stat underlying_node_stat;
       static int ino_count = 0;
       /* Create a new light node (virtual device). */
       struct lnode *ln = (struct lnode *) add_vdev (pi->po->np->nn->name,
-                                                   sizeof (*ln),
-                                                   vdev_portclass,
-                                                   port_bucket);
+                                                   sizeof (*ln));
       if (ln == NULL)
        {
          ports_port_deref (pi);
diff --git a/eth-multiplexer/vdev.c b/eth-multiplexer/vdev.c
index d6a17fb..7d5390b 100644
--- a/eth-multiplexer/vdev.c
+++ b/eth-multiplexer/vdev.c
@@ -125,8 +125,7 @@ remove_dead_port_from_dev (mach_port_t dead_port)
 
 /* Add a new virtual interface to the multiplexer. */
 struct vether_device *
-add_vdev (char *name, int size,
-         struct port_class *class, struct port_bucket *bucket)
+add_vdev (char *name, size_t size)
 {
   error_t err;
   uint32_t hash;
@@ -134,7 +133,7 @@ add_vdev (char *name, int size,
 
   if (size < sizeof (*vdev))
     size = sizeof (*vdev);
-  err = ports_create_port (class, bucket, size, &vdev);
+  err = ports_create_port (vdev_portclass, port_bucket, size, &vdev);
   if (err)
     return NULL;
 
diff --git a/eth-multiplexer/vdev.h b/eth-multiplexer/vdev.h
index 6affaca..1b263aa 100644
--- a/eth-multiplexer/vdev.h
+++ b/eth-multiplexer/vdev.h
@@ -33,6 +33,9 @@
 #include "queue.h"
 #include "util.h"
 
+struct port_bucket *port_bucket;
+struct port_class *vdev_portclass;
+
 #define MAX_SERVERS 10
 #define ETH_MTU 1500
 
@@ -63,9 +66,7 @@ int serv_connect (mach_port_t port);
 int serv_disconnect ();
 struct vether_device *lookup_dev_by_name (char *name);
 int remove_dead_port_from_dev (mach_port_t dead_port);
-struct vether_device *add_vdev (char *name, int size,
-                               struct port_class *class,
-                               struct port_bucket *bucket);
+struct vether_device *add_vdev (char *name, size_t size);
 void destroy_vdev (void *port);
 int deliver_msg (struct net_rcv_msg *msg, struct vether_device *vdev);
 int deliver_pack (char *data, int datalen, struct vether_device *vdev);

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]