/* * Transfer a single BIO. */ static int sbull_xfer_bio(struct sbull_dev *dev, struct bio *bio) { int i; struct bio_vec *bvec; sector_t sector = bio->bi_sector; /* Do each segment independently. */ bio_for_each_segment(bvec, bio, i) { char *buffer = __bio_kmap_atomic(bio, i, KM_USER0); sbull_transfer(dev, sector, bio_cur_bytes(bio), buffer, bio_data_dir(bio) == WRITE); sector += bio_cur_bytes(bio) / KERNEL_SECTOR_SIZE; __bio_kunmap_atomic(bio, KM_USER0); }
/* * Transfer a single BIO. */ static int sbull_xfer_bio(struct sbull_dev *dev, struct bio *bio) { int i; struct bio_vec *bvec; sector_t sector = bio->bi_sector; /* Do each segment independently. */ bio_for_each_segment(bvec, bio, i) { char *buffer = __bio_kmap_atomic(bio, i); sbull_transfer(dev, sector,bytes_to_sectors_checked(bio_cur_bytes(bio)), buffer, bio_data_dir(bio) == WRITE); sector += (bytes_to_sectors_checked(bio_cur_bytes(bio))); __bio_kunmap_atomic(bio); }