]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xen: Create KABI-compatible version of struct xenbus_watch
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Wed, 31 May 2017 17:49:37 +0000 (13:49 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Wed, 13 Sep 2017 04:37:55 +0000 (21:37 -0700)
Commit 5584ea250ae4 ("xen: modify xenstore watch event interface")
modified definition of struct xenbus_watch, breaking UEK KABI.

The patch introduces compat version of the struct, with callback_
pointing to KABI-compatible definition.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
drivers/net/xen-netback/xenbus.c
drivers/xen/xenbus/xenbus_client.c
drivers/xen/xenbus/xenbus_dev_frontend.c
drivers/xen/xenbus/xenbus_xs.c
include/xen/xenbus.h

index 38db65553f2ee8279e700c380e45bcb2ded95d9a..fd098d362b030dfbd3070b308069b176d4a1bc2f 100644 (file)
@@ -727,6 +727,7 @@ static int xen_register_credit_watch(struct xenbus_device *dev,
        snprintf(node, maxlen, "%s/rate", dev->nodename);
        vif->credit_watch.node = node;
        vif->credit_watch.callback = xen_net_rate_changed;
+       vif->credit_watch.callback_ = NULL;
        err = register_xenbus_watch(&vif->credit_watch);
        if (err) {
                pr_err("Failed to set watcher %s\n", vif->credit_watch.node);
@@ -779,6 +780,7 @@ static int xen_register_mcast_ctrl_watch(struct xenbus_device *dev,
                 dev->otherend);
        vif->mcast_ctrl_watch.node = node;
        vif->mcast_ctrl_watch.callback = xen_mcast_ctrl_changed;
+       vif->mcast_ctrl_watch.callback_ = NULL;
        err = register_xenbus_watch(&vif->mcast_ctrl_watch);
        if (err) {
                pr_err("Failed to set watcher %s\n",
index 82a8866758ee0d5ac235430059f74a7bb56b09f8..b2ea9877536454d06ac0b4611af65f269cdfb79a 100644 (file)
@@ -121,6 +121,7 @@ int xenbus_watch_path(struct xenbus_device *dev, const char *path,
 
        watch->node = path;
        watch->callback = callback;
+       watch->callback_ = NULL;
 
        err = register_xenbus_watch(watch);
 
index 87ac5cab7a45f4b07eec15b4a352786f5e59467a..59eb920203a464a5b8b417e14d19ecf663842b7f 100644 (file)
@@ -481,6 +481,7 @@ static int xenbus_write_watch(unsigned msg_type, struct xenbus_file_priv *u)
                }
 
                watch->watch.callback = watch_fired;
+               watch->watch.callback_ = NULL;
                watch->dev_data = u;
 
                err = register_xenbus_watch(&watch->watch);
index 4c33bd354adc1aca1b1487e12f86e5a5991c49e8..25112faf3d26a14de0301d9b08f894281cb1d60f 100644 (file)
@@ -875,8 +875,16 @@ static int xenwatch_thread(void *unused)
 
                if (ent != &watch_events) {
                        event = list_entry(ent, struct xs_watch_event, list);
-                       event->handle->callback(event->handle, event->path,
-                                               event->token);
+                       if ( !event->handle->callback_)
+                               event->handle->callback(event->handle, event->path,
+                                                       event->token);
+                       else {
+                               const char *vec[2];
+
+                               vec[0] = event->path;
+                               vec[1] = event->token;
+                               event->handle->callback_(event->handle, vec, 2);
+                       }
                        kfree(event);
                }
 
index 869c816d5f8c3097b09298a9d086e7f75fff540e..48dd7c72bc4173710803c01fbe105f221b268cff 100644 (file)
@@ -60,8 +60,21 @@ struct xenbus_watch
        const char *node;
 
        /* Callback (executed in a process context with no locks held). */
+#ifndef __GENKSYMS__
+       void (*callback_)(struct xenbus_watch *,
+                         const char **vec, unsigned int len);
        void (*callback)(struct xenbus_watch *,
                         const char *path, const char *token);
+#else
+       /*
+        * KABI check. We prefer to keep 'callback' name for in-tree code
+        * to avoid code churning when backporting things. 'callback_' 
+        * is used for compat callers. Unfortunately KABI checker doesn't
+        * like the underscored name so we will feed it original name.
+        */
+       void (*callback)(struct xenbus_watch *,
+                        const char **vec, unsigned int len);
+#endif
 };