Skip to content

Commit

Permalink
Fix build on v6.0 (bio_op)
Browse files Browse the repository at this point in the history
'bio_op' define is introduced in v4.10-rc1~112^2~42 and made inline
v6.0-rc1~178^2~83, do not trigger old kernels fallback on new kernels.

  /usr/src/RPM/BUILD/dm-secdel-1.0.9/dm-secdel.c: In function 'op_discard':
  /usr/src/RPM/BUILD/dm-secdel-1.0.9/dm-secdel.c:196:12: error: 'struct bio' has no member named 'bi_rw'
    196 |         bio->bi_rw & REQ_DISCARD
	|            ^~
  /usr/src/RPM/BUILD/dm-secdel-1.0.9/dm-secdel.c:196:22: error: 'REQ_DISCARD' undeclared (first use in this function); did you mean 'ITER_DISCARD'?
    196 |         bio->bi_rw & REQ_DISCARD
	|                      ^~~~~~~~~~~
	|                      ITER_DISCARD

Signed-off-by: Vitaly Chikunov <[email protected]>
  • Loading branch information
vt-alt committed Oct 31, 2022
1 parent cbe7ecf commit 3715fbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dm-secdel.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static void secdel_submit_bio(struct bio *bio)
static int op_discard(struct bio *bio)
{
if (
#ifdef bio_op
#if LINUX_VERSION_CODE > KERNEL_VERSION(4,10,0) || defined(bio_op)
bio_op(bio) == REQ_OP_DISCARD
#else
bio->bi_rw & REQ_DISCARD
Expand Down

0 comments on commit 3715fbd

Please sign in to comment.