All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org, wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH 14/15] mini-os: eliminate xenbus union member in struct file
Date: Thu,  6 Jan 2022 12:57:40 +0100	[thread overview]
Message-ID: <20220106115741.3219-15-jgross@suse.com> (raw)
In-Reply-To: <20220106115741.3219-1-jgross@suse.com>

Replace the xenbus specific union member in struct file with the
common dev pointer.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 include/lib.h |  7 -------
 lib/sys.c     |  2 +-
 lib/xs.c      | 13 +++++++------
 3 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/include/lib.h b/include/lib.h
index d6a29ba..91364ba 100644
--- a/include/lib.h
+++ b/include/lib.h
@@ -193,13 +193,6 @@ struct file {
 	    struct evtchn_port_list ports;
 	} evtchn;
 	struct gntmap gntmap;
-#ifdef CONFIG_XENBUS
-        struct {
-            /* To each xenbus FD is associated a queue of watch events for this
-             * FD.  */
-            xenbus_event_queue events;
-        } xenbus;
-#endif
     };
 };
 
diff --git a/lib/sys.c b/lib/sys.c
index 96fc769..6f2b026 100644
--- a/lib/sys.c
+++ b/lib/sys.c
@@ -776,7 +776,7 @@ static int select_poll(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exce
 #ifdef CONFIG_XENBUS
 	case FTYPE_XENBUS:
 	    if (FD_ISSET(i, readfds)) {
-                if (files[i].xenbus.events)
+                if (files[i].dev)
 		    n++;
 		else
 		    FD_CLR(i, readfds);
diff --git a/lib/xs.c b/lib/xs.c
index 324bd05..0459f52 100644
--- a/lib/xs.c
+++ b/lib/xs.c
@@ -21,8 +21,8 @@ static inline int _xs_fileno(struct xs_handle *h) {
 struct xs_handle *xs_daemon_open()
 {
     int fd = alloc_fd(FTYPE_XENBUS);
-    files[fd].xenbus.events = NULL;
-    printk("xs_daemon_open -> %d, %p\n", fd, &files[fd].xenbus.events);
+    files[fd].dev = NULL;
+    printk("xs_daemon_open -> %d, %p\n", fd, &files[fd].dev);
     return (void*)(intptr_t) fd;
 }
 
@@ -30,7 +30,7 @@ void xs_daemon_close(struct xs_handle *h)
 {
     int fd = _xs_fileno(h);
     struct xenbus_event *event, *next;
-    for (event = files[fd].xenbus.events; event; event = next)
+    for (event = files[fd].dev; event; event = next)
     {
         next = event->next;
         free(event);
@@ -172,15 +172,16 @@ bool xs_watch(struct xs_handle *h, const char *path, const char *token)
 {
     int fd = _xs_fileno(h);
     printk("xs_watch(%s, %s)\n", path, token);
-    return xs_bool(xenbus_watch_path_token(XBT_NULL, path, token, &files[fd].xenbus.events));
+    return xs_bool(xenbus_watch_path_token(XBT_NULL, path, token,
+                   (xenbus_event_queue *)&files[fd].dev));
 }
 
 char **xs_read_watch(struct xs_handle *h, unsigned int *num)
 {
     int fd = _xs_fileno(h);
     struct xenbus_event *event;
-    event = files[fd].xenbus.events;
-    files[fd].xenbus.events = event->next;
+    event = files[fd].dev;
+    files[fd].dev = event->next;
     printk("xs_read_watch() -> %s %s\n", event->path, event->token);
     *num = 2;
     return (char **) &event->path;
-- 
2.26.2



  parent reply	other threads:[~2022-01-06 11:58 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06 11:57 [PATCH 00/15] mini-os: remove struct file dependency from config Juergen Gross
2022-01-06 11:57 ` [PATCH 01/15] mini-os: split struct file definition from its usage Juergen Gross
2022-01-09  1:17   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 02/15] mini-os: makes file.read bool and move it ahead of device specific part Juergen Gross
2022-01-09  1:18   ` Samuel Thibault
2022-01-09  1:21     ` Samuel Thibault
2022-01-09  6:12       ` Juergen Gross
2022-01-09 10:20         ` Samuel Thibault
2022-01-09 10:28           ` Juergen Gross
2022-01-09 10:33             ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 03/15] mini-os: make offset a common struct file member for all types Juergen Gross
2022-01-09  1:23   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 04/15] mini-os: replace multiple fd elements in struct file by common one Juergen Gross
2022-01-09  1:25   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 05/15] mini-os: introduce a common dev pointer in struct file Juergen Gross
2022-01-09  1:25   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 06/15] mini-os: eliminate blkfront union member " Juergen Gross
2022-01-09  1:26   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 07/15] mini-os: eliminate consfront " Juergen Gross
2022-01-09  1:27   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 08/15] mini-os: eliminate fbfront " Juergen Gross
2022-01-09  1:27   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 09/15] mini-os: eliminate kbdfront " Juergen Gross
2022-01-09  1:28   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 10/15] mini-os: eliminate netfront " Juergen Gross
2022-01-09  1:28   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 11/15] mini-os: move tpm respgot member of struct file to device specific data Juergen Gross
2022-01-09  1:30   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 12/15] mini-os: eliminate tpmfront union member in struct file Juergen Gross
2022-01-09  1:30   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 13/15] mini-os: eliminate tpmtis " Juergen Gross
2022-01-09  1:31   ` Samuel Thibault
2022-01-06 11:57 ` Juergen Gross [this message]
2022-01-09  1:32   ` [PATCH 14/15] mini-os: eliminate xenbus " Samuel Thibault
2022-01-06 11:57 ` [PATCH 15/15] mini-os: introduce get_file_from_fd() Juergen Gross
2022-01-09  1:33   ` Samuel Thibault
2022-01-07  2:39 ` [PATCH 00/15] mini-os: remove struct file dependency from config Samuel Thibault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220106115741.3219-15-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=minios-devel@lists.xenproject.org \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.