dm-verity: make verity_fec_is_enabled() an inline function
verity_fec_is_enabled() is very short and is called in quite a few places, so make it an inline function. Reviewed-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>master
parent
fa3d53140d
commit
1a257c5fd3
|
|
@ -22,14 +22,6 @@ static inline unsigned int fec_max_nbufs(struct dm_verity *v)
|
|||
return 1 << (v->data_dev_block_bits - DM_VERITY_FEC_BUF_RS_BITS);
|
||||
}
|
||||
|
||||
/*
|
||||
* If error correction has been configured, returns true.
|
||||
*/
|
||||
bool verity_fec_is_enabled(struct dm_verity *v)
|
||||
{
|
||||
return v->fec && v->fec->dev;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return an interleaved offset for a byte in RS block.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -66,7 +66,11 @@ struct dm_verity_fec_io {
|
|||
/* each feature parameter requires a value */
|
||||
#define DM_VERITY_OPTS_FEC 8
|
||||
|
||||
extern bool verity_fec_is_enabled(struct dm_verity *v);
|
||||
/* Returns true if forward error correction is enabled. */
|
||||
static inline bool verity_fec_is_enabled(struct dm_verity *v)
|
||||
{
|
||||
return v->fec && v->fec->dev;
|
||||
}
|
||||
|
||||
extern int verity_fec_decode(struct dm_verity *v, struct dm_verity_io *io,
|
||||
enum verity_block_type type, const u8 *want_digest,
|
||||
|
|
|
|||
Loading…
Reference in New Issue