All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Christoph Hellwig <hch@lst.de>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	akpm@osdl.org, linus@osdl.org, anton@samba.org, paulus@samba.org,
	axboe@suse.de, piggin@cyberone.com.au,
	viro@parcelfarce.linux.theplanet.co.uk,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iSeries virtual disk
Date: Fri, 27 Feb 2004 13:44:12 +0000	[thread overview]
Message-ID: <20040227134412.A301@infradead.org> (raw)
In-Reply-To: <20040227133717.GA13381@lst.de>; from hch@lst.de on Fri, Feb 27, 2004 at 02:37:17PM +0100

On Fri, Feb 27, 2004 at 02:37:17PM +0100, Christoph Hellwig wrote:
> Here's a totally untested patch to fix it up:

And a better one that makes viodasd_max_disks properly start at 0.


--- 1.1/drivers/block/viodasd.c	Fri Feb 27 06:25:15 2004
+++ edited/drivers/block/viodasd.c	Fri Feb 27 15:44:03 2004
@@ -209,7 +209,6 @@
 				(int)we.rc, we.sub_result, err->msg);
 		return -EIO;
 	}
-	viodasd_max_disk = we.max_disk;
 
 	return 0;
 }
@@ -451,10 +450,9 @@
 }
 
 /*
- * Probe a single disk and fill in the viodasd_device structure
- * for it.
+ * Probe a single disk and fill in the viodasd_device structure for it.
  */
-static void probe_disk(struct viodasd_device *d)
+static void __init probe_disk(struct viodasd_device *d)
 {
 	HvLpEvent_Rc hvrc;
 	struct viodasd_waitevent we;
@@ -483,7 +481,8 @@
 
 	if (we.rc != 0)
 		return;
-	viodasd_max_disk = we.max_disk;
+
+	viodasd_max_disk = min(we.max_disk - 1, MAX_DISKNO);
 
 	/* Send the close event to OS/400.  We DON'T expect a response */
 	hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp,
@@ -744,27 +743,13 @@
 	/* Initialize our request handler */
 	vio_setHandler(viomajorsubtype_blockio, handle_block_event);
 
-	viodasd_max_disk = MAX_DISKNO - 1;
-	for (i = 0; (i <= viodasd_max_disk) && (i < MAX_DISKNO); i++) {
-		/*
-		 * Note that probe_disk has side effects:
-		 *  a) it updates the size of the disk
-		 *  b) it updates viodasd_max_disk
-		 *  c) it registers the disk if it has not done so already
-		 */
+	/* probe_disk updates viodasd_max_disk */
+	for (i = 0; i < viodasd_max_disk; i++)
 		probe_disk(&viodasd_devices[i]);
-	}
-
-	if (viodasd_max_disk > (MAX_DISKNO - 1))
-		printk(VIOD_KERN_INFO
-			"Only examining the first %d of %d disks connected\n",
-			MAX_DISKNO, viodasd_max_disk + 1);
-
 	return 0;
 }
-module_init(viodasd_init);
 
-void viodasd_exit(void)
+static void __exit viodasd_exit(void)
 {
 	int i;
 	struct viodasd_device *d;
@@ -783,4 +768,5 @@
 	viopath_close(viopath_hostLp, viomajorsubtype_blockio, VIOMAXREQ + 2);
 }
 
+module_init(viodasd_init);
 module_exit(viodasd_exit);

  reply	other threads:[~2004-02-27 13:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040123163504.36582570.sfr@canb.auug.org.au>
     [not found] ` <20040122221136.174550c3.akpm@osdl.org>
2004-02-26  6:23   ` [PATCH] iSeries virtual disk Stephen Rothwell
2004-02-26  7:29     ` Jeff Garzik
2004-02-26  7:40       ` Jens Axboe
2004-02-27  0:44         ` Stephen Rothwell
2004-02-26  7:52       ` Stephen Rothwell
2004-02-26  7:58         ` Jeff Garzik
2004-02-27  0:42       ` Stephen Rothwell
2004-02-27  1:50         ` Jeff Garzik
2004-02-27  2:45           ` Stephen Rothwell
2004-02-27  2:50             ` Jeff Garzik
2004-02-26  9:51     ` Christoph Hellwig
2004-02-27  1:04       ` Stephen Rothwell
2004-02-27 11:32         ` Christoph Hellwig
2004-02-27 11:57           ` Stephen Rothwell
2004-02-27 12:13             ` Christoph Hellwig
2004-02-27 13:26               ` Stephen Rothwell
2004-02-27 13:37                 ` Christoph Hellwig
2004-02-27 13:44                   ` Christoph Hellwig [this message]
2004-02-27 23:26                     ` Stephen Rothwell
2004-02-26 17:35     ` Linus Torvalds
2004-02-27  0:45       ` Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040227134412.A301@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@osdl.org \
    --cc=anton@samba.org \
    --cc=axboe@suse.de \
    --cc=hch@lst.de \
    --cc=linus@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=piggin@cyberone.com.au \
    --cc=sfr@canb.auug.org.au \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.