Skip to content

Commit

Permalink
block: bio-integrity: export bio_integrity_free func
Browse files Browse the repository at this point in the history
This function is the complementary function to bio_integrity_alloc.
Export it for users that would like to free the integrity context
explicitly.

Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
  • Loading branch information
mgurtovoy authored and intel-lab-lkp committed Apr 23, 2023
1 parent a6ee0ae commit 1459ddb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions block/bio-integrity.c
Expand Up @@ -110,6 +110,7 @@ void bio_integrity_free(struct bio *bio)
bio->bi_integrity = NULL;
bio->bi_opf &= ~REQ_INTEGRITY;
}
EXPORT_SYMBOL(bio_integrity_free);

/**
* bio_integrity_add_page - Attach integrity metadata
Expand Down
5 changes: 5 additions & 0 deletions include/linux/bio.h
Expand Up @@ -700,6 +700,7 @@ static inline bool bioset_initialized(struct bio_set *bs)
bip_for_each_vec(_bvl, _bio->bi_integrity, _iter)

extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int);
extern void bio_integrity_free(struct bio *);
extern int bio_integrity_add_page(struct bio *, struct page *, unsigned int, unsigned int);
extern bool bio_integrity_prep(struct bio *);
extern void bio_integrity_advance(struct bio *, unsigned int);
Expand Down Expand Up @@ -764,6 +765,10 @@ static inline void *bio_integrity_alloc(struct bio * bio, gfp_t gfp,
return ERR_PTR(-EINVAL);
}

void bio_integrity_free(struct bio *bio)
{
}

static inline int bio_integrity_add_page(struct bio *bio, struct page *page,
unsigned int len, unsigned int offset)
{
Expand Down

0 comments on commit 1459ddb

Please sign in to comment.