WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] netfront: Add kref support for legacy

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] netfront: Add kref support for legacy Linux kernels.
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 07 Sep 2007 09:10:34 -0700
Delivery-date: Fri, 07 Sep 2007 09:14:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1188487419 -3600
# Node ID 720571c2139e66aecb2552a59be897fda40238fa
# Parent  7419a3be82737bc2de83749030759e104c92e1ea
netfront: Add kref support for legacy Linux kernels.

In kernels <= 2.6.5 kref_init, and kref_put had a different interface.
This patch allows for older kernels to compile with the older
interface.

Signed-off-by: Ben Guthro <bguthro@xxxxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 drivers/xen/netfront/accel.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff -r 7419a3be8273 -r 720571c2139e drivers/xen/netfront/accel.c
--- a/drivers/xen/netfront/accel.c      Tue Aug 28 15:33:15 2007 +0100
+++ b/drivers/xen/netfront/accel.c      Thu Aug 30 16:23:39 2007 +0100
@@ -45,6 +45,14 @@
 #define WPRINTK(fmt, args...)                          \
        printk(KERN_WARNING "netfront/accel: " fmt, ##args)
 
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 5)
+#define kref_init(x,y) kref_init(x,y)
+#define kref_put(x,y)  kref_put(x)
+#else
+#define kref_init(x,y) kref_init(x)
+#define kref_put(x,y)  kref_put(x,y)
+#endif
+
 /*
  * List of all netfront accelerator plugin modules available.  Each
  * list entry is of type struct netfront_accelerator.
@@ -176,7 +184,7 @@ accelerator_set_vif_state_hooks(struct n
         */
        kref_get(&vif_state->np->accelerator->accel_kref);
        /* This persists until vif_state->hooks are cleared */
-       kref_init(&vif_state->vif_kref);
+       kref_init(&vif_state->vif_kref, vif_kref_release);
 
        /* Make sure there are no data path operations going on */
        netif_poll_disable(vif_state->np->netdev);
@@ -318,7 +326,7 @@ accelerator_probe_vifs(struct netfront_a
         * persist until the accelerator hooks are removed (e.g. by
         * accelerator module unload)
         */
-       kref_init(&accelerator->accel_kref);
+       kref_init(&accelerator->accel_kref, accel_kref_release);
 
        /* 
         * Store the hooks for future calls to probe a new device, and

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] netfront: Add kref support for legacy Linux kernels., Xen patchbot-linux-2.6.18-xen <=