summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Zoffoli <xmerlin@gentoo.org>2008-03-21 01:52:13 +0000
committerChristian Zoffoli <xmerlin@gentoo.org>2008-03-21 01:52:13 +0000
commit023759983dd41ff822faf85035ce1d6cabb9698b (patch)
tree876884d934927e4e569ccad1d6de47b27aebe7c2 /sys-cluster
parentAdded a missing patch. (diff)
downloadgentoo-2-023759983dd41ff822faf85035ce1d6cabb9698b.tar.gz
gentoo-2-023759983dd41ff822faf85035ce1d6cabb9698b.tar.bz2
gentoo-2-023759983dd41ff822faf85035ce1d6cabb9698b.zip
Patched gnbd to compile also with kernel >= 2.6.20.
(Portage version: 2.1.4.4)
Diffstat (limited to 'sys-cluster')
-rw-r--r--sys-cluster/gnbd-kernel/ChangeLog7
-rw-r--r--sys-cluster/gnbd-kernel/files/gnbd-kernel-2.02.00-compile-fix-kernel-pre-2.6.24.diff118
-rw-r--r--sys-cluster/gnbd-kernel/gnbd-kernel-2.02.00.ebuild12
3 files changed, 132 insertions, 5 deletions
diff --git a/sys-cluster/gnbd-kernel/ChangeLog b/sys-cluster/gnbd-kernel/ChangeLog
index e51baf23f3f5..35c547e040e3 100644
--- a/sys-cluster/gnbd-kernel/ChangeLog
+++ b/sys-cluster/gnbd-kernel/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-cluster/gnbd-kernel
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/gnbd-kernel/ChangeLog,v 1.24 2008/03/17 17:05:35 xmerlin Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/gnbd-kernel/ChangeLog,v 1.25 2008/03/21 01:52:13 xmerlin Exp $
+
+ 21 Mar 2008; Christian Zoffoli <xmerlin@gentoo.org>
+ +files/gnbd-kernel-2.02.00-compile-fix-kernel-pre-2.6.24.diff,
+ gnbd-kernel-2.02.00.ebuild:
+ Patched gnbd to compile also with kernel >= 2.6.20.
*gnbd-kernel-2.02.00 (17 Mar 2008)
diff --git a/sys-cluster/gnbd-kernel/files/gnbd-kernel-2.02.00-compile-fix-kernel-pre-2.6.24.diff b/sys-cluster/gnbd-kernel/files/gnbd-kernel-2.02.00-compile-fix-kernel-pre-2.6.24.diff
new file mode 100644
index 000000000000..8cd1fc77c227
--- /dev/null
+++ b/sys-cluster/gnbd-kernel/files/gnbd-kernel-2.02.00-compile-fix-kernel-pre-2.6.24.diff
@@ -0,0 +1,118 @@
+diff -uNr cluster-2.02.00.orig/gnbd-kernel/src/gnbd.c cluster-2.02.00/gnbd-kernel/src/gnbd.c
+--- cluster-2.02.00.orig/gnbd-kernel/src/gnbd.c 2008-02-26 16:37:43.000000000 +0100
++++ cluster-2.02.00/gnbd-kernel/src/gnbd.c 2008-03-21 02:40:52.000000000 +0100
+@@ -168,7 +168,7 @@
+
+ if (down_trylock(&dev->do_it_lock))
+ return -EBUSY;
+- res = sscanf(buf, "%Lu\n", (unsigned long long int *)&size);
++ res = sscanf(buf, "%Lu\n", &size);
+ if (res != 1){
+ up(&dev->do_it_lock);
+ return -EINVAL;
+@@ -267,7 +267,7 @@
+ static void gnbd_end_request(struct request *req)
+ {
+ int uptodate = (req->errors == 0) ? 1 : 0;
+- struct request_queue *q = req->q;
++ request_queue_t *q = req->q;
+ unsigned long flags;
+
+ dprintk(DBG_BLKDEV, "%s: request %p: %s\n", req->rq_disk->disk_name,
+@@ -369,7 +369,7 @@
+ int __gnbd_send_req(struct gnbd_device *dev, struct socket *sock,
+ struct request *req, int can_signal)
+ {
+- int result, flags;
++ int result, i, flags;
+ struct gnbd_request request;
+ unsigned long size = req->nr_sectors << 9;
+
+@@ -403,26 +403,28 @@
+ }
+
+ if (gnbd_cmd(req) == GNBD_CMD_WRITE) {
+- struct req_iterator iter;
+- struct bio_vec *bvec;
++ struct bio *bio;
+ /*
+ * we are really probing at internals to determine
+ * whether to set MSG_MORE or not...
+ */
+- rq_for_each_segment(bvec, req, iter) {
+- flags = 0;
+- if (!rq_iter_last(req, iter))
+- flags = MSG_MORE;
+- dprintk(DBG_TX, "%s: request %p: sending %d bytes data\n",
+- dev->disk->disk_name, req,
+- bvec->bv_len);
+- result = sock_send_bvec(sock, bvec, flags,
+- can_signal);
+- if (result < 0) {
+- printk(KERN_ERR "%s: Send data failed (result %d)\n",
+- dev->disk->disk_name,
+- result);
+- goto error_out;
++ rq_for_each_bio(bio, req) {
++ struct bio_vec *bvec;
++ bio_for_each_segment(bvec, bio, i) {
++ flags = 0;
++ if ((i < (bio->bi_vcnt - 1)) || bio->bi_next)
++ flags = MSG_MORE;
++ dprintk(DBG_TX, "%s: request %p: sending %d bytes data\n",
++ dev->disk->disk_name, req,
++ bvec->bv_len);
++ result = sock_send_bvec(sock, bvec, flags,
++ can_signal);
++ if (result < 0) {
++ printk(KERN_ERR "%s: Send data failed (result %d)\n",
++ dev->disk->disk_name,
++ result);
++ goto error_out;
++ }
+ }
+ }
+ }
+@@ -462,19 +464,21 @@
+ int gnbd_recv_req(struct gnbd_device *dev, struct request *req)
+ {
+ int result;
+- struct bio_vec *bvec;
+- struct req_iterator iter;
+-
+- rq_for_each_segment(bvec, req, iter) {
+- result = sock_recv_bvec(dev->sock, bvec);
+- if (result < 0) {
+- printk(KERN_ERR "%s: Receive data failed (result %d)\n",
+- dev->disk->disk_name,
+- result);
+- return result;
++ int i;
++ struct bio *bio;
++ rq_for_each_bio(bio, req) {
++ struct bio_vec *bvec;
++ bio_for_each_segment(bvec, bio, i) {
++ result = sock_recv_bvec(dev->sock, bvec);
++ if (result < 0) {
++ printk(KERN_ERR "%s: Receive data failed (result %d)\n",
++ dev->disk->disk_name,
++ result);
++ return result;
++ }
++ dprintk(DBG_RX, "%s: request %p: got %d bytes data\n",
++ dev->disk->disk_name, req, bvec->bv_len);
+ }
+- dprintk(DBG_RX, "%s: request %p: got %d bytes data\n",
+- dev->disk->disk_name, req, bvec->bv_len);
+ }
+ return 0;
+ }
+@@ -561,7 +565,7 @@
+ * { printk( "Warning: Ignoring result!\n"); gnbd_end_request( req ); }
+ */
+
+-static void do_gnbd_request(struct request_queue *q)
++static void do_gnbd_request(request_queue_t * q)
+ {
+ int err;
+ struct request *req;
diff --git a/sys-cluster/gnbd-kernel/gnbd-kernel-2.02.00.ebuild b/sys-cluster/gnbd-kernel/gnbd-kernel-2.02.00.ebuild
index 9b964b9ffc39..a6ace8d7129b 100644
--- a/sys-cluster/gnbd-kernel/gnbd-kernel-2.02.00.ebuild
+++ b/sys-cluster/gnbd-kernel/gnbd-kernel-2.02.00.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/gnbd-kernel/gnbd-kernel-2.02.00.ebuild,v 1.1 2008/03/17 17:05:35 xmerlin Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/gnbd-kernel/gnbd-kernel-2.02.00.ebuild,v 1.2 2008/03/21 01:52:13 xmerlin Exp $
inherit eutils linux-mod linux-info versionator
@@ -19,7 +19,7 @@ SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
-DEPEND="=virtual/linux-sources-2.6.23*"
+DEPEND=">=virtual/linux-sources-2.6.20"
RDEPEND="${DEPEND}"
S="${WORKDIR}/${MY_P}/${PN}"
@@ -35,7 +35,11 @@ src_unpack() {
unpack ${A}
cd "${S}"
-# epatch "${FILESDIR}"/${P}-to-cvs-20080217.patch || die
+ if kernel_is 2 6; then
+ if [ "$KV_PATCH" -lt "24" ] ; then
+ epatch "${FILESDIR}"/${P}-compile-fix-kernel-pre-2.6.24.diff || die
+ fi
+ fi
}
src_compile() {
@@ -52,7 +56,7 @@ src_compile() {
) || die "configure problem"
(cd "${S}"/src;
- emake \
+ emake clean all \
) || die "compile problem"
}