[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
- [hurd] branch upstream updated (796f878 -> 83fef6c), Samuel Thibault, 2017/11/19
- [hurd] 02/10: libdiskfs: Improve error message., Samuel Thibault, 2017/11/19
- [hurd] 03/10: eth-multiplexer: Remove unused function., Samuel Thibault, 2017/11/19
- [hurd] 06/10: eth-multiplexer: Remove unused macro., Samuel Thibault, 2017/11/19
- [hurd] 09/10: pfinet: Fix array size hardcoded value, Samuel Thibault, 2017/11/19
- [hurd] 01/10: fshelp: Fix fetching control ports., Samuel Thibault, 2017/11/19
- [hurd] 08/10: pfinet: Avoid returning udp errors unless requested, Samuel Thibault, 2017/11/19
- [hurd] 10/10: Make devprobe able to talk with userland drivers, Samuel Thibault, 2017/11/19
- [hurd] 05/10: eth-multiplexer: Fix debug macro., Samuel Thibault, 2017/11/19
- [hurd] 04/10: eth-multiplexer: Simplify device creation.,
Samuel Thibault <=
- [hurd] 07/10: eth-multiplexer: Avoid copying data multiple times., Samuel Thibault, 2017/11/19