Skip to content

Commit

Permalink
compilation fix for 4.9 kernel (#88)
Browse files Browse the repository at this point in the history
* fix for 4.9 kernel

Signed-off-by: Lakshmi Narasimhan Sundararajan <lns@portworx.com>
  • Loading branch information
sulakshm authored Feb 11, 2020
1 parent 1337fd1 commit 48a672a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pxd_fastpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,9 @@ static int __do_bio_filebacked(struct pxd_device *pxd_dev, struct pxd_io_tracker
ret = _pxd_flush(pxd_dev, iot->file);
goto out;
case REQ_OP_DISCARD:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
case REQ_OP_WRITE_ZEROES:
#endif
ret = _pxd_bio_discard(pxd_dev, iot->file, bio, pos);
goto out;
default:
Expand Down Expand Up @@ -1226,7 +1228,7 @@ void pxd_make_request_fastpath(struct request_queue *q, struct bio *bio)
#endif
{
struct pxd_device *pxd_dev = q->queuedata;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)
unsigned int rw = bio_op(bio);
#else
unsigned int rw = bio_rw(bio);
Expand All @@ -1237,7 +1239,7 @@ void pxd_make_request_fastpath(struct request_queue *q, struct bio *bio)
struct pxd_io_tracker *head;
struct thread_context *tc;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)
if (!pxd_dev) {
#else
if (rw == READA) rw = READ;
Expand Down Expand Up @@ -1297,7 +1299,7 @@ void pxd_make_request_fastpath(struct request_queue *q, struct bio *bio)
if (!head) {
BIO_ENDIO(bio, -ENOMEM);

// non-trivial high memory pressure failing IO
// trivial high memory pressure failing IO
return BLK_QC_RETVAL;
}

Expand Down

0 comments on commit 48a672a

Please sign in to comment.