rpms/iscsitarget-kmod/devel iscsitarget-0.4.15-2.6.28.patch, NONE, 1.1 iscsitarget-kmod.spec, 1.13, 1.14

Hans de Goede jwrdegoede at rpmfusion.org
Sat Dec 27 22:20:49 CET 2008


Author: jwrdegoede

Update of /cvs/free/rpms/iscsitarget-kmod/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv4643

Modified Files:
	iscsitarget-kmod.spec 
Added Files:
	iscsitarget-0.4.15-2.6.28.patch 
Log Message:
* Sat Dec 27 2008 Hans de Goede <hdegoede at redhat.com> - 1:0.4.15-42.svn147.1
- Fix compilation with 2.6.28 kernel


iscsitarget-0.4.15-2.6.28.patch:

--- NEW FILE iscsitarget-0.4.15-2.6.28.patch ---
diff -up iscsitarget-0.4.15/kernel/block-io.c.orig iscsitarget-0.4.15/kernel/block-io.c
--- iscsitarget-0.4.15/kernel/block-io.c.orig	2008-12-27 22:14:48.000000000 +0100
+++ iscsitarget-0.4.15/kernel/block-io.c	2008-12-27 22:15:49.000000000 +0100
@@ -13,6 +13,7 @@
 #include <linux/parser.h>
 #include <linux/blkdev.h>
 #include <linux/buffer_head.h>
+#include <linux/version.h>
 
 #include "iscsi.h"
 #include "iscsi_dbg.h"
@@ -154,14 +155,27 @@ blockio_open_path(struct iet_volume *vol
 {
 	struct blockio_data *bio_data = volume->private;
 	struct block_device *bdev;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
+	fmode_t flags = FMODE_READ;
+#else
 	int flags = LUReadonly(volume) ? MS_RDONLY : 0;
+#endif
 	int err = 0;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
+	if (!LUReadonly(volume))
+		flags |= FMODE_WRITE;
+#endif
+
 	bio_data->path = kstrdup(path, GFP_KERNEL);
 	if (!bio_data->path)
 		return -ENOMEM;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
+	bdev = open_bdev_exclusive(path, flags, THIS_MODULE);
+#else
 	bdev = open_bdev_excl(path, flags, THIS_MODULE);
+#endif
 	if (IS_ERR(bdev)) {
 		err = PTR_ERR(bdev);
 		eprintk("Can't open device %s, error %d\n", path, err);
@@ -310,9 +324,19 @@ static void
 blockio_detach(struct iet_volume *volume)
 {
 	struct blockio_data *bio_data = volume->private;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
+	fmode_t flags = FMODE_READ;
+
+	if (!LUReadonly(volume))
+		flags |= FMODE_WRITE;
+#endif
 
 	if (bio_data->bdev)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
+		close_bdev_exclusive(bio_data->bdev, flags);
+#else
 		close_bdev_excl(bio_data->bdev);
+#endif
 	kfree(bio_data->path);
 
 	kfree(volume->private);


Index: iscsitarget-kmod.spec
===================================================================
RCS file: /cvs/free/rpms/iscsitarget-kmod/devel/iscsitarget-kmod.spec,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- iscsitarget-kmod.spec	21 Dec 2008 14:21:18 -0000	1.13
+++ iscsitarget-kmod.spec	27 Dec 2008 21:20:49 -0000	1.14
@@ -10,7 +10,7 @@
 
 Name:           iscsitarget-kmod
 Version:        0.4.15
-Release:        41.%{patchlevel}%{?dist}.11
+Release:        42.%{patchlevel}%{?dist}.1
 Epoch:          1
 Summary:        iscsitarget kernel modules
 
@@ -23,6 +23,7 @@
 #       http://svn.berlios.de/svnroot/repos/iscsitarget/trunk/@147
 Patch0:         iscsitarget-0.4.15-%{patchlevel}.patch
 Patch1:         iscsitarget-0.4.15-types.h.patch
+Patch2:         iscsitarget-0.4.15-2.6.28.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 # needed for plague to make sure it builds for i586 and i686
@@ -49,6 +50,7 @@
 pushd iscsitarget-%{version}
 %patch0 -p0
 %patch1 -p1
+%patch2 -p1
 #%patch0 -p0 -b .svn142
 # -b creates empty mode 000 file that cannot be copied with cp -a
 popd
@@ -81,6 +83,9 @@
 
 
 %changelog
+* Sat Dec 27 2008 Hans de Goede <hdegoede at redhat.com> - 1:0.4.15-42.svn147.1
+- Fix compilation with 2.6.28 kernel
+
 * Sun Dec 21 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 1:0.4.15-41.svn147.11
 - rebuild for latest Fedora kernel;
 



More information about the rpmfusion-commits mailing list