public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in sys-block/iscsitarget/files: iscsitarget-0.4.17+linux-2.6.28.patch
@ 2009-01-15  1:28 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 2+ messages in thread
From: Diego Petteno (flameeyes) @ 2009-01-15  1:28 UTC (permalink / raw
  To: gentoo-commits

flameeyes    09/01/15 01:28:21

  Modified:             iscsitarget-0.4.17+linux-2.6.28.patch
  Log:
  Fix patch to build properly.
  (Portage version: 2.2_rc22/cvs/Linux 2.6.28-gentoo x86_64)

Revision  Changes    Path
1.2                  sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.28.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.28.patch?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.28.patch?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.28.patch?r1=1.1&r2=1.2

Index: iscsitarget-0.4.17+linux-2.6.28.patch
===================================================================
RCS file: /var/cvsroot/gentoo-x86/sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.28.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- iscsitarget-0.4.17+linux-2.6.28.patch	2 Jan 2009 23:21:17 -0000	1.1
+++ iscsitarget-0.4.17+linux-2.6.28.patch	15 Jan 2009 01:28:21 -0000	1.2
@@ -18,10 +18,12 @@
 index e4a25f7..2c5f6f6 100644
 --- a/kernel/block-io.c
 +++ b/kernel/block-io.c
-@@ -18,6 +18,12 @@
+@@ -18,6 +18,14 @@
  #include "iscsi_dbg.h"
  #include "iotype.h"
  
++#include <linux/version.h>
++
 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
 +# define HAVE_OPEN_BDEV_EXCLUSIVE 1
 +#else






^ permalink raw reply	[flat|nested] 2+ messages in thread
* [gentoo-commits] gentoo-x86 commit in sys-block/iscsitarget/files: iscsitarget-0.4.17+linux-2.6.28.patch
@ 2009-01-02 23:21 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 2+ messages in thread
From: Diego Petteno (flameeyes) @ 2009-01-02 23:21 UTC (permalink / raw
  To: gentoo-commits

flameeyes    09/01/02 23:21:17

  Added:                iscsitarget-0.4.17+linux-2.6.28.patch
  Log:
  Add patch to fix bug #252608 (failure to build on kernel 2.6.28 and later).
  (Portage version: 2.2_rc20/cvs/Linux 2.6.28-gentoo x86_64)

Revision  Changes    Path
1.1                  sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.28.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.28.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-block/iscsitarget/files/iscsitarget-0.4.17+linux-2.6.28.patch?rev=1.1&content-type=text/plain

Index: iscsitarget-0.4.17+linux-2.6.28.patch
===================================================================
From c5e70fc826aad5efb786c47d294e3c0c76246d63 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Diego=20E.=20'Flameeyes'=20Petten=C3=B2?= <flameeyes@gmail.com>
Date: Sat, 3 Jan 2009 00:09:43 +0100
Subject: [PATCH] Fix building with Linux kernel 2.6.28 and later.

With changeset 30c40d2c01f68c7eb1a41ab3552bdaf5dbf300d4 of the Linux
kernel, the functions open_bdev_excl and close_bdev_excl were replaced with
functionally-equivalent open_bdev_exclusive and close_bdev_exclusive.

The new interface uses fmode_t instead of integer flags to carry on the
opening mode for a block device, thus require some minor changes in the
calls.
---
 kernel/block-io.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/kernel/block-io.c b/kernel/block-io.c
index e4a25f7..2c5f6f6 100644
--- a/kernel/block-io.c
+++ b/kernel/block-io.c
@@ -18,6 +18,12 @@
 #include "iscsi_dbg.h"
 #include "iotype.h"
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
+# define HAVE_OPEN_BDEV_EXCLUSIVE 1
+#else
+# define HAVE_OPEN_BDEV_EXCLUSIVE 0
+#endif
+
 struct blockio_data {
 	char *path;
 	struct block_device *bdev;
@@ -154,14 +160,22 @@ blockio_open_path(struct iet_volume *volume, const char *path)
 {
 	struct blockio_data *bio_data = volume->private;
 	struct block_device *bdev;
+#if HAVE_OPEN_BDEV_EXCLUSIVE
+	fmode_t mode = FMODE_READ | ( LUReadonly(volume) ? 0 : FMODE_WRITE );
+#else
 	int flags = LUReadonly(volume) ? MS_RDONLY : 0;
+#endif
 	int err = 0;
 
 	bio_data->path = kstrdup(path, GFP_KERNEL);
 	if (!bio_data->path)
 		return -ENOMEM;
 
+#if HAVE_OPEN_BDEV_EXCLUSIVE
+	bdev = open_bdev_exclusive(path, mode, 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);
@@ -323,9 +337,16 @@ static void
 blockio_detach(struct iet_volume *volume)
 {
 	struct blockio_data *bio_data = volume->private;
+#if HAVE_OPEN_BDEV_EXCLUSIVE
+	fmode_t mode = FMODE_READ | ( LUReadonly(volume) ? 0 : FMODE_WRITE );
+#endif
 
 	if (bio_data->bdev)
+#if HAVE_OPEN_BDEV_EXCLUSIVE
+		close_bdev_exclusive(bio_data->bdev, mode);
+#else
 		close_bdev_excl(bio_data->bdev);
+#endif
 	kfree(bio_data->path);
 
 	kfree(volume->private);
-- 
1.6.0.6







^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-15  1:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-15  1:28 [gentoo-commits] gentoo-x86 commit in sys-block/iscsitarget/files: iscsitarget-0.4.17+linux-2.6.28.patch Diego Petteno (flameeyes)
  -- strict thread matches above, loose matches on Subject: below --
2009-01-02 23:21 Diego Petteno (flameeyes)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox