On Sat, 2017-03-04 at 17:01 +0100, Paolo Valente wrote: > +static sector_t get_sdist(sector_t last_pos, struct request *rq) > +{ > + sector_t sdist = 0; > + > + if (last_pos) { > + if (last_pos < blk_rq_pos(rq)) > + sdist = blk_rq_pos(rq) - last_pos; > + else > + sdist = last_pos - blk_rq_pos(rq); > + } > + > + return sdist; > +} Have you considered to use abs() from <linux/kernel.h>? Thanks, Bart.