OSDN Git Service

ANDROID: GKI: genhd.h: add Android ABI padding to some structures
authorGreg Kroah-Hartman <gregkh@google.com>
Sat, 2 May 2020 07:37:37 +0000 (09:37 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Sun, 3 May 2020 06:45:31 +0000 (08:45 +0200)
Try to mitigate potential future driver core api changes by adding a
padding to struct hd_struct, struct blk_integrity, and struct gendisk.

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

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5d19bf942fbedc64f705f5d27ae629c57209df27

include/linux/genhd.h

index f13272d..a77a364 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/percpu-refcount.h>
 #include <linux/uuid.h>
 #include <linux/blk_types.h>
+#include <linux/android_kabi.h>
 
 #ifdef CONFIG_BLOCK
 
@@ -130,6 +131,11 @@ struct hd_struct {
 #endif
        struct percpu_ref ref;
        struct rcu_work rcu_work;
+
+       ANDROID_KABI_RESERVE(1);
+       ANDROID_KABI_RESERVE(2);
+       ANDROID_KABI_RESERVE(3);
+       ANDROID_KABI_RESERVE(4);
 };
 
 #define GENHD_FL_REMOVABLE                     1
@@ -167,6 +173,9 @@ struct blk_integrity {
        unsigned char                           tuple_size;
        unsigned char                           interval_exp;
        unsigned char                           tag_size;
+
+       ANDROID_KABI_RESERVE(1);
+       ANDROID_KABI_RESERVE(2);
 };
 
 #endif /* CONFIG_BLK_DEV_INTEGRITY */
@@ -211,6 +220,12 @@ struct gendisk {
        int node_id;
        struct badblocks *bb;
        struct lockdep_map lockdep_map;
+
+       ANDROID_KABI_RESERVE(1);
+       ANDROID_KABI_RESERVE(2);
+       ANDROID_KABI_RESERVE(3);
+       ANDROID_KABI_RESERVE(4);
+
 };
 
 static inline struct gendisk *part_to_disk(struct hd_struct *part)