/* Check if request is within bounds and page aligned.  */
static int valid_swap_request(struct ramzswap *rzs, struct bio *bio)
/* Check if request is within bounds and page aligned.  */
static int valid_swap_request(struct ramzswap *rzs, struct bio *bio)
{
	if (unlikely(
		(bio->bi_sector >= (rzs->disksize >> SECTOR_SHIFT)) ||
		(bio->bi_sector & (SECTORS_PER_PAGE - 1)) ||
		(bio->bi_vcnt != 1) ||
		(bio->bi_size != PAGE_SIZE) ||
		(bio->bi_io_vec[0].bv_offset != 0))) {
		return 0;
	}
	return 1;
}