lkml.org 
[lkml]   [2002]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Patch - SCSI host numbers - please apply
> Comment/motivation:
> This keeps max_scsi_host coherent with the length of the list
> scsi_host_no_list. Since we never shorten the list
> we should never decrement max_scsi_host.

I vote for Itai's patch going into both trees. Attached without
MIME is a version which applies with -p1 and inline.

-- Pete

--- linux/drivers/scsi/hosts.c Mon Feb 25 21:38:04 2002
+++ linux-p3/drivers/scsi/hosts.c Wed Apr 17 01:42:47 2002
@@ -81,8 +81,8 @@
struct Scsi_Host * scsi_hostlist;
struct Scsi_Device_Template * scsi_devicelist;

-int max_scsi_hosts;
-int next_scsi_host;
+int max_scsi_hosts; /* host_no for next new host */
+int next_scsi_host; /* count of registered scsi hosts */

void
scsi_unregister(struct Scsi_Host * sh){
@@ -107,21 +107,8 @@
if (shn) shn->host_registered = 0;
/* else {} : This should not happen, we should panic here... */

- /* If we are removing the last host registered, it is safe to reuse
- * its host number (this avoids "holes" at boot time) (DB)
- * It is also safe to reuse those of numbers directly below which have
- * been released earlier (to avoid some holes in numbering).
- */
- if(sh->host_no == max_scsi_hosts - 1) {
- while(--max_scsi_hosts >= next_scsi_host) {
- shpnt = scsi_hostlist;
- while(shpnt && shpnt->host_no != max_scsi_hosts - 1)
- shpnt = shpnt->next;
- if(shpnt)
- break;
- }
- }
next_scsi_host--;
+
kfree((char *) sh);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:22    [W:0.026 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site