Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 869ab90f authored by Eric Biggers's avatar Eric Biggers Committed by Jens Axboe
Browse files

block: constify struct blk_integrity_profile



blk_integrity_profile's are never modified, so mark them 'const' so that
they are placed in .rodata and benefit from memory protection.

Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 1be7d207
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -389,7 +389,7 @@ static int blk_integrity_nop_fn(struct blk_integrity_iter *iter)
	return 0;
}

static struct blk_integrity_profile nop_profile = {
static const struct blk_integrity_profile nop_profile = {
	.name = "nop",
	.generate_fn = blk_integrity_nop_fn,
	.verify_fn = blk_integrity_nop_fn,
+4 −4
Original line number Diff line number Diff line
@@ -160,28 +160,28 @@ static int t10_pi_type3_verify_ip(struct blk_integrity_iter *iter)
	return t10_pi_verify(iter, t10_pi_ip_fn, 3);
}

struct blk_integrity_profile t10_pi_type1_crc = {
const struct blk_integrity_profile t10_pi_type1_crc = {
	.name			= "T10-DIF-TYPE1-CRC",
	.generate_fn		= t10_pi_type1_generate_crc,
	.verify_fn		= t10_pi_type1_verify_crc,
};
EXPORT_SYMBOL(t10_pi_type1_crc);

struct blk_integrity_profile t10_pi_type1_ip = {
const struct blk_integrity_profile t10_pi_type1_ip = {
	.name			= "T10-DIF-TYPE1-IP",
	.generate_fn		= t10_pi_type1_generate_ip,
	.verify_fn		= t10_pi_type1_verify_ip,
};
EXPORT_SYMBOL(t10_pi_type1_ip);

struct blk_integrity_profile t10_pi_type3_crc = {
const struct blk_integrity_profile t10_pi_type3_crc = {
	.name			= "T10-DIF-TYPE3-CRC",
	.generate_fn		= t10_pi_type3_generate_crc,
	.verify_fn		= t10_pi_type3_verify_crc,
};
EXPORT_SYMBOL(t10_pi_type3_crc);

struct blk_integrity_profile t10_pi_type3_ip = {
const struct blk_integrity_profile t10_pi_type3_ip = {
	.name			= "T10-DIF-TYPE3-IP",
	.generate_fn		= t10_pi_type3_generate_ip,
	.verify_fn		= t10_pi_type3_verify_ip,
+5 −5
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ struct badblocks;
#if defined(CONFIG_BLK_DEV_INTEGRITY)

struct blk_integrity {
	struct blk_integrity_profile	*profile;
	const struct blk_integrity_profile	*profile;
	unsigned char				flags;
	unsigned char				tuple_size;
	unsigned char				interval_exp;
+4 −4
Original line number Diff line number Diff line
@@ -34,9 +34,9 @@ struct t10_pi_tuple {
};


extern struct blk_integrity_profile t10_pi_type1_crc;
extern struct blk_integrity_profile t10_pi_type1_ip;
extern struct blk_integrity_profile t10_pi_type3_crc;
extern struct blk_integrity_profile t10_pi_type3_ip;
extern const struct blk_integrity_profile t10_pi_type1_crc;
extern const struct blk_integrity_profile t10_pi_type1_ip;
extern const struct blk_integrity_profile t10_pi_type3_crc;
extern const struct blk_integrity_profile t10_pi_type3_ip;

#endif