ANDROID: GKI: scsi: add Android ABI padding to some structures

Try to mitigate potential future driver core api changes by adding a
padding to struct scsi_cmnd, struct scsi_device, and struct
scsi_host_template.

Based on a change made to the RHEL/CENTOS 8 kernel.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ie6a2b91970e8f9063bf00e96a0dff661f77b8e8d
This commit is contained in:
Greg Kroah-Hartman 2020-04-22 15:35:08 +02:00 committed by Todd Kjos
parent 0f2bfefeca
commit 2d9161d8b1
3 changed files with 19 additions and 0 deletions

View File

@ -12,6 +12,7 @@
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_request.h>
#include <linux/android_kabi.h>
struct Scsi_Host;
struct scsi_driver;
@ -140,6 +141,11 @@ struct scsi_cmnd {
unsigned long state; /* Command completion state */
unsigned int extra_len; /* length of alignment and padding */
ANDROID_KABI_RESERVE(1);
ANDROID_KABI_RESERVE(2);
ANDROID_KABI_RESERVE(3);
ANDROID_KABI_RESERVE(4);
};
/* Variant of blk_mq_rq_from_pdu() that verifies the type of its argument. */

View File

@ -9,6 +9,7 @@
#include <scsi/scsi.h>
#include <linux/atomic.h>
#include <linux/sbitmap.h>
#include <linux/android_kabi.h>
struct bsg_device;
struct device;
@ -244,6 +245,12 @@ struct scsi_device {
struct mutex state_mutex;
enum scsi_device_state sdev_state;
struct task_struct *quiesced_by;
ANDROID_KABI_RESERVE(1);
ANDROID_KABI_RESERVE(2);
ANDROID_KABI_RESERVE(3);
ANDROID_KABI_RESERVE(4);
unsigned long sdev_data[];
} __attribute__((aligned(sizeof(unsigned long))));

View File

@ -10,6 +10,7 @@
#include <linux/seq_file.h>
#include <linux/blk-mq.h>
#include <scsi/scsi.h>
#include <linux/android_kabi.h>
struct block_device;
struct completion;
@ -502,6 +503,11 @@ struct scsi_host_template {
/* Delay for runtime autosuspend */
int rpm_autosuspend_delay;
ANDROID_KABI_RESERVE(1);
ANDROID_KABI_RESERVE(2);
ANDROID_KABI_RESERVE(3);
ANDROID_KABI_RESERVE(4);
};
/*