diff options
Diffstat (limited to 'block/blk.h')
-rw-r--r-- | block/blk.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/block/blk.h b/block/blk.h index 61c2afa67daa..32f4e9f630a3 100644 --- a/block/blk.h +++ b/block/blk.h @@ -372,7 +372,8 @@ static inline struct bio *__bio_split_to_limits(struct bio *bio, const struct queue_limits *lim, unsigned int *nr_segs) { switch (bio_op(bio)) { - default: + case REQ_OP_READ: + case REQ_OP_WRITE: if (bio_may_need_split(bio, lim)) return bio_split_rw(bio, lim, nr_segs); *nr_segs = 1; @@ -384,6 +385,10 @@ static inline struct bio *__bio_split_to_limits(struct bio *bio, return bio_split_discard(bio, lim, nr_segs); case REQ_OP_WRITE_ZEROES: return bio_split_write_zeroes(bio, lim, nr_segs); + default: + /* other operations can't be split */ + *nr_segs = 0; + return bio; } } |