summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Black <dragonheart@gentoo.org>2009-02-02 12:24:10 +0000
committerDaniel Black <dragonheart@gentoo.org>2009-02-02 12:24:10 +0000
commit5fa2becf6c0b58d67448d3caf24976ce7445c3a0 (patch)
tree43589581bea5d92da6990acb1878547171df1d37 /sys-fs/cowloop
parentAdded fix for python-2.6, re-use autotools, removed older versions (diff)
downloadgentoo-2-5fa2becf6c0b58d67448d3caf24976ce7445c3a0.tar.gz
gentoo-2-5fa2becf6c0b58d67448d3caf24976ce7445c3a0.tar.bz2
gentoo-2-5fa2becf6c0b58d67448d3caf24976ce7445c3a0.zip
patch for 2.6.28 thanks to Jérôme Poulin in bug #257335
(Portage version: 2.2_rc23/cvs/Linux x86_64)
Diffstat (limited to 'sys-fs/cowloop')
-rw-r--r--sys-fs/cowloop/ChangeLog10
-rw-r--r--sys-fs/cowloop/cowloop-3.0-r3.ebuild3
-rw-r--r--sys-fs/cowloop/files/cowloop-3.0-2.6.28.patch152
3 files changed, 161 insertions, 4 deletions
diff --git a/sys-fs/cowloop/ChangeLog b/sys-fs/cowloop/ChangeLog
index 953905c7b478..e444d27f46b6 100644
--- a/sys-fs/cowloop/ChangeLog
+++ b/sys-fs/cowloop/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-fs/cowloop
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/cowloop/ChangeLog,v 1.23 2009/01/30 21:04:05 dragonheart Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/cowloop/ChangeLog,v 1.24 2009/02/02 12:24:09 dragonheart Exp $
+
+ 02 Feb 2009; Daniel Black <dragonheart@gentoo.org>
+ +files/cowloop-3.0-2.6.28.patch, cowloop-3.0-r3.ebuild:
+ patch for 2.6.28 thanks to Jerome Poulin in bug #257335
30 Jan 2009; Daniel Black <dragonheart@gentoo.org>
+files/cowloop-3.0-request_queue_t.patch,
@@ -15,7 +19,7 @@
01 Apr 2008; Daniel Black <dragonheart@gentoo.org>
+files/cowloop-3.0-kern-2.6.23.patch, +cowloop-3.0-r3.ebuild:
introduced 2.6.23+ compatibility as per bug #208059. Patches by Jouni
- Kosonen and bug written by Jérôme Poulin
+ Kosonen and bug written by Jérôme Poulin
02 May 2007; Robin H. Johnson <robbat2@gentoo.org> cowloop-3.0-r2.ebuild:
Add ~amd64 after some quick testing.
@@ -68,7 +72,7 @@
04 Aug 2005; Daniel Black <dragonheart@gentoo.org> -cowloop-2.11.ebuild,
-cowloop-2.15.ebuild, +cowloop-2.15-r1.ebuild:
- added cowmerge thanks to bug #101159 by Jérôme Poulin
+ added cowmerge thanks to bug #101159 by Jérôme Poulin
26 Jun 2005; David Holm <dholm@gentoo.org> cowloop-2.15.ebuild:
Added to ~ppc.
diff --git a/sys-fs/cowloop/cowloop-3.0-r3.ebuild b/sys-fs/cowloop/cowloop-3.0-r3.ebuild
index 2fbd21d079ef..ad8eb18dfd6f 100644
--- a/sys-fs/cowloop/cowloop-3.0-r3.ebuild
+++ b/sys-fs/cowloop/cowloop-3.0-r3.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/cowloop/cowloop-3.0-r3.ebuild,v 1.3 2009/01/30 21:13:43 dragonheart Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/cowloop/cowloop-3.0-r3.ebuild,v 1.4 2009/02/02 12:24:09 dragonheart Exp $
EAPI=2
inherit linux-mod toolchain-funcs
@@ -38,6 +38,7 @@ src_prepare() {
epatch "${FILESDIR}"/${P}-kern-2.6.23.patch
epatch "${FILESDIR}"/${P}-semaphore_h.patch
epatch "${FILESDIR}"/${P}-request_queue_t.patch
+ epatch "${FILESDIR}"/${P}-2.6.28.patch
}
src_compile() {
diff --git a/sys-fs/cowloop/files/cowloop-3.0-2.6.28.patch b/sys-fs/cowloop/files/cowloop-3.0-2.6.28.patch
new file mode 100644
index 000000000000..23e1573bb8e7
--- /dev/null
+++ b/sys-fs/cowloop/files/cowloop-3.0-2.6.28.patch
@@ -0,0 +1,152 @@
+diff -pur /tmp/cowloop-3.0/src/cowdev.c cowloop-3.0/src/cowdev.c
+--- /tmp/cowloop-3.0/src/cowdev.c 2006-12-12 10:28:17.000000000 +1100
++++ cowloop-3.0/src/cowdev.c 2009-02-02 23:04:45.000000000 +1100
+@@ -198,8 +198,8 @@ pairadd (char *rdopath, char *cowpath, c
+ /*
+ ** fill structure info for ioctl COWMKPAIR
+ */
+- cowpair.rdofile = rdopath;
+- cowpair.cowfile = cowpath;
++ cowpair.rdofile = (u_char*) rdopath;
++ cowpair.cowfile = (u_char*) cowpath;
+
+ cowpair.rdoflen = strlen(rdopath);
+ cowpair.cowflen = strlen(cowpath);
+Only in cowloop-3.0/src: cowdev.c.orig
+Only in cowloop-3.0/src: cowdev.c.rej
+diff -pur /tmp/cowloop-3.0/src/cowloop.c cowloop-3.0/src/cowloop.c
+--- /tmp/cowloop-3.0/src/cowloop.c 2006-12-12 10:28:17.000000000 +1100
++++ cowloop-3.0/src/cowloop.c 2009-02-02 23:15:25.000000000 +1100
+@@ -408,8 +408,13 @@ static long int cowlo_readcowraw (struct
+ static long int cowlo_writecow (struct cowloop_device *, void *, int, loff_t);
+ static long int cowlo_writecowraw(struct cowloop_device *, void *, int, loff_t);
+
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28))
+ static int cowlo_ioctl (struct inode *, struct file *,
+ unsigned int, unsigned long);
++#else
++static int cowlo_ioctl (struct block_device *, fmode_t,
++ unsigned int, unsigned long);
++#endif
+
+ static int cowlo_makepair (struct cowpair __user *);
+ static int cowlo_removepair (unsigned long __user *);
+@@ -434,8 +439,15 @@ static void cowlo_undo_opencow(struct co
+ ** < 0 - error value
+ */
+ static int
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28))
+ cowlo_open(struct inode *inode, struct file *file)
+-{
++#else
++cowlo_open(struct block_device *bdev, fmode_t mode)
++#endif
++{
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28))
++ struct inode *inode = bdev->bd_inode;
++#endif
+ if (!inode)
+ return -EINVAL;
+
+@@ -474,9 +486,20 @@ cowlo_open(struct inode *inode, struct f
+ ** < 0 - error value
+ */
+ static int
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28))
+ cowlo_release(struct inode *inode, struct file *file)
++#else
++cowlo_release(struct gendisk *gd, fmode_t mode)
++#endif
+ {
+ int err = 0;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28))
++ struct block_device *bdev;
++ struct inode *inode;
++
++ bdev = bdget_disk(gd, 0);
++ inode = bdev->bd_inode;
++#endif
+
+ if (!inode)
+ return 0;
+@@ -497,10 +520,18 @@ cowlo_release(struct inode *inode, struc
+ ** < 0 - error value
+ */
+ static int
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28))
+ cowlo_ioctl(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg)
++#else
++cowlo_ioctl(struct block_device *bdev, fmode_t mode,
++ unsigned int cmd, unsigned long arg)
++#endif
+ {
+ struct hd_geometry geo;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28))
++ struct inode *inode = bdev->bd_inode;
++#endif
+
+ DEBUGP(DCOW "cowloop - ioctl cmd %x\n", cmd);
+
+@@ -2067,7 +2098,11 @@ cowlo_openrdo(struct cowloop_device *cow
+ cowdev->belowq = cowdev->belowgd->queue;
+
+ if (cowdev->numblocks == 0)
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28))
+ cowdev->numblocks = cowdev->belowgd->capacity
++#else
++ cowdev->numblocks = get_capacity(cowdev->belowgd)
++#endif
+ / (MAPUNIT/512);
+ }
+
+@@ -2637,6 +2672,9 @@ cowlo_sync(void)
+ static int __init
+ cowlo_init_module(void)
+ {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28))
++ spinlock_t ilock; /* Initial lock for the default queue assigned on load */
++#endif
+ int rv;
+ int minor, uptocows;
+
+@@ -2748,7 +2786,7 @@ cowlo_init_module(void)
+ ** allocate fake disk as control channel to handle the requests
+ ** to activate and deactivate cowdevices dynamically
+ */
+- if ((cowctlgd = alloc_disk(1)) == NULL) {
++ if (!(cowctlgd = alloc_disk(1))) {
+ printk(KERN_WARNING
+ "cowloop - unable to alloc_disk for cowctl\n");
+
+@@ -2759,11 +2797,19 @@ cowlo_init_module(void)
+ goto error_out;
+ }
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28))
++ spin_lock_init(&ilock);
++#endif
++
+ cowctlgd->major = COWMAJOR;
+ cowctlgd->first_minor = COWCTL;
+ cowctlgd->minors = 1;
+ cowctlgd->fops = &cowlo_fops;
+ cowctlgd->private_data = NULL;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28))
++ /* The device is of capacity 0, so there won't be any queue request */
++ cowctlgd->queue = blk_init_queue(NULL, &ilock);
++#endif
+ sprintf(cowctlgd->disk_name, "cowctl");
+ set_capacity(cowctlgd, 0);
+
+@@ -2816,7 +2862,9 @@ cowlo_cleanup_module(void)
+ kfree(cowdevall[minor]);
+ }
+ kfree(cowdevall);
+-
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28))
++ blk_cleanup_queue(cowctlgd->queue); /* cleanup the empty queue */
++#endif
+ del_gendisk(cowctlgd); /* revert the alloc_disk() */
+ put_disk (cowctlgd); /* revert the add_disk() */
+