[rtems-libbsd commit] Update due to IMFS generic API changes

Sebastian Huber sebh at rtems.org
Tue Jan 27 13:23:22 UTC 2015


Module:    rtems-libbsd
Branch:    master
Commit:    b112710b07e44adeb2e3bcd39086fde3b66e942d
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=b112710b07e44adeb2e3bcd39086fde3b66e942d

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Jan 23 08:32:07 2015 +0100

Update due to IMFS generic API changes

---

 freebsd/sys/kern/uipc_usrreq.c | 34 +++++++++++++---------------------
 freebsd/sys/net/bpf.c          | 10 +++-------
 freebsd/sys/sys/unpcb.h        |  2 +-
 3 files changed, 17 insertions(+), 29 deletions(-)

diff --git a/freebsd/sys/kern/uipc_usrreq.c b/freebsd/sys/kern/uipc_usrreq.c
index eacfc71..9254e9b 100644
--- a/freebsd/sys/kern/uipc_usrreq.c
+++ b/freebsd/sys/kern/uipc_usrreq.c
@@ -472,12 +472,12 @@ uipc_attach(struct socket *so, int proto, struct thread *td)
 
 #ifdef __rtems__
 static IMFS_jnode_t *
-rtems_uipc_imfs_initialize(IMFS_jnode_t *node, const IMFS_types_union *info)
+rtems_uipc_imfs_initialize(IMFS_jnode_t *node, void *arg)
 {
 	struct socket *so;
 	struct unpcb *unp;
 
-	node = IMFS_node_initialize_generic(node, info);
+	node = IMFS_node_initialize_generic(node, arg);
 
 	so = IMFS_generic_get_context_by_node(node);
 	unp = sotounpcb(so);
@@ -487,7 +487,7 @@ rtems_uipc_imfs_initialize(IMFS_jnode_t *node, const IMFS_types_union *info)
 	return node;
 }
 
-static IMFS_jnode_t *
+static void
 rtems_uipc_imfs_destroy(IMFS_jnode_t *node)
 {
 	struct socket *so;
@@ -498,24 +498,16 @@ rtems_uipc_imfs_destroy(IMFS_jnode_t *node)
 
 	unp->unp_vnode = NULL;
 
-	return node;
+	IMFS_node_destroy_default(node);
 }
 
-static const IMFS_node_control rtems_uipc_imfs_control = {
-	.imfs_type = IMFS_GENERIC,
-	.handlers = &socketops,
-	.node_initialize = rtems_uipc_imfs_initialize,
-	.node_remove = IMFS_node_remove_default,
-	.node_destroy = rtems_uipc_imfs_destroy
-};
+static const IMFS_node_control rtems_uipc_imfs_control =
+    IMFS_GENERIC_INITIALIZER(&socketops, rtems_uipc_imfs_initialize,
+    rtems_uipc_imfs_destroy);
 
-static const IMFS_node_control rtems_uipc_imfs_zombi_control = {
-	.imfs_type = IMFS_GENERIC,
-	.handlers = &rtems_filesystem_handlers_default,
-	.node_initialize = NULL,
-	.node_remove = IMFS_node_remove_default,
-	.node_destroy = IMFS_node_destroy_default
-};
+static const IMFS_node_control rtems_uipc_imfs_zombi_control =
+    IMFS_GENERIC_INITIALIZER(&rtems_filesystem_handlers_default, NULL,
+    IMFS_node_destroy_default);
 #endif /* __rtems__ */
 static int
 uipc_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
@@ -718,7 +710,7 @@ uipc_detach(struct socket *so)
 	struct vnode *vp;
 	int freeunp, local_unp_rights;
 #else /* __rtems__ */
-	struct IMFS_jnode_tt *vp;
+	IMFS_generic_t *vp;
 	int freeunp;
 #endif /* __rtems__ */
 
@@ -740,8 +732,8 @@ uipc_detach(struct socket *so)
 #ifndef __rtems__
 		VOP_UNP_DETACH(vp);
 #else /* __rtems__ */
-		vp->control = &rtems_uipc_imfs_zombi_control;
-		vp->info.generic.context = NULL;
+		vp->Node.control = &rtems_uipc_imfs_zombi_control;
+		vp->context = NULL;
 #endif /* __rtems__ */
 		unp->unp_vnode = NULL;
 	}
diff --git a/freebsd/sys/net/bpf.c b/freebsd/sys/net/bpf.c
index 10ad355..4175665 100644
--- a/freebsd/sys/net/bpf.c
+++ b/freebsd/sys/net/bpf.c
@@ -2931,13 +2931,9 @@ static const rtems_filesystem_file_handlers_r bpf_imfs_handlers = {
 	.writev_h = bpf_imfs_writev
 };
 
-static const IMFS_node_control bpf_imfs_control = {
-	.imfs_type = IMFS_GENERIC,
-	.handlers = &bpf_imfs_handlers,
-	.node_initialize = IMFS_node_initialize_default,
-	.node_remove = IMFS_node_remove_default,
-	.node_destroy = IMFS_node_destroy_default
-};
+static const IMFS_node_control bpf_imfs_control = IMFS_GENERIC_INITIALIZER(
+    &bpf_imfs_handlers, IMFS_node_initialize_generic,
+    IMFS_node_destroy_default);
 #endif /* __rtems__ */
 
 static void
diff --git a/freebsd/sys/sys/unpcb.h b/freebsd/sys/sys/unpcb.h
index d141b96..38a2d1f 100644
--- a/freebsd/sys/sys/unpcb.h
+++ b/freebsd/sys/sys/unpcb.h
@@ -71,7 +71,7 @@ struct unpcb {
 #ifndef __rtems__
 	struct	vnode *unp_vnode;	/* if associated with file */
 #else /* __rtems__ */
-	struct	IMFS_jnode_tt *unp_vnode;	/* if associated with file */
+	void *unp_vnode;		/* if associated with file */
 #endif /* __rtems__ */
 	ino_t	unp_ino;		/* fake inode number */
 	struct	unpcb *unp_conn;	/* control block of connected socket */



More information about the vc mailing list