Commit 9cef0d2f authored by Stephen M. Cameron's avatar Stephen M. Cameron Committed by Jens Axboe

cciss: Dynamically allocate the drive_info_struct for each logical drive.

cciss: Dynamically allocate the drive_info_struct for each logical drive.
This reduces the size of the per-hba ctlr_info structure from 106936
bytes to 8132 bytes.  That's on 32-bit systems.  On 64-bit systems, the
improvement is even bigger.  Without this, the ctlr_info struct is so big
that the driver won't even load on a 64 bit system if CISS_MAX_LUN was
at it's current setting of 1024 logical drives.
Signed-off-by: default avatarStephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent e272afec
This diff is collapsed.
...@@ -45,13 +45,14 @@ typedef struct _drive_info_struct ...@@ -45,13 +45,14 @@ typedef struct _drive_info_struct
* to prevent it from being opened or it's * to prevent it from being opened or it's
* queue from being started. * queue from being started.
*/ */
struct device *dev; struct device dev;
__u8 serial_no[16]; /* from inquiry page 0x83, __u8 serial_no[16]; /* from inquiry page 0x83,
* not necc. null terminated. * not necc. null terminated.
*/ */
char vendor[VENDOR_LEN + 1]; /* SCSI vendor string */ char vendor[VENDOR_LEN + 1]; /* SCSI vendor string */
char model[MODEL_LEN + 1]; /* SCSI model string */ char model[MODEL_LEN + 1]; /* SCSI model string */
char rev[REV_LEN + 1]; /* SCSI revision string */ char rev[REV_LEN + 1]; /* SCSI revision string */
char device_initialized; /* indicates whether dev is initialized */
} drive_info_struct; } drive_info_struct;
struct ctlr_info struct ctlr_info
...@@ -87,7 +88,7 @@ struct ctlr_info ...@@ -87,7 +88,7 @@ struct ctlr_info
BYTE cciss_read_capacity; BYTE cciss_read_capacity;
// information about each logical volume // information about each logical volume
drive_info_struct drv[CISS_MAX_LUN]; drive_info_struct *drv[CISS_MAX_LUN];
struct access_method access; struct access_method access;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment