commit 7047eba35342544128c7dbbdf24c06943141c1ad Author: Edward Shishkin <edward.shishkin@xxxxxxxxx> Date: Thu Oct 5 23:15:41 2017 +0200 Port for Linux-4.14 Signed-off-by: Edward Shishkin <edward.shishkin@xxxxxxxxx> diff --git a/page_cache.c b/page_cache.c index eadf74b33..8cca57867 100644 --- a/page_cache.c +++ b/page_cache.c @@ -437,7 +437,7 @@ static struct bio *page_bio(struct page *page, jnode * node, int rw, gfp_t gfp) assert("nikita-2275", blocknr != (reiser4_block_nr) 0); assert("nikita-2276", !reiser4_blocknr_is_fake(&blocknr)); - bio->bi_bdev = super->s_bdev; + bio_set_dev(bio, super->s_bdev); /* fill bio->bi_iter.bi_sector before calling bio_add_page(), because * q->merge_bvec_fn may want to inspect it (see * drivers/md/linear.c:linear_mergeable_bvec() for example. */ diff --git a/plugin/file/cryptcompress.c b/plugin/file/cryptcompress.c index 694680bc7..f58eee96e 100644 --- a/plugin/file/cryptcompress.c +++ b/plugin/file/cryptcompress.c @@ -1501,7 +1501,8 @@ static int pages_truncate_ok(struct inode *inode, pgoff_t start) int found; struct page * page; - found = find_get_pages(inode->i_mapping, start, 1, &page); + + found = find_get_pages(inode->i_mapping, &start, 1, &page); if (found) put_cluster_page(page); return !found; @@ -1887,14 +1888,14 @@ static void checkout_page_cluster(struct cluster_handle * clust, int i; int found; int to_put; + pgoff_t page_index = clust_to_pg(clust->index, inode); struct tfm_cluster *tc = &clust->tc; /* find and put checked in pages: cluster is locked, * so we must get expected number (to_put) of pages */ to_put = size_in_pages(lbytes(clust->index, inode)); - found = find_get_pages(inode->i_mapping, - clust_to_pg(clust->index, inode), + found = find_get_pages(inode->i_mapping, &page_index, to_put, clust->pages); BUG_ON(found != to_put); @@ -2521,6 +2522,7 @@ void truncate_complete_page_cluster(struct inode *inode, cloff_t index, int found; int nr_pages; jnode *node; + pgoff_t page_index = clust_to_pg(index, inode); struct page *pages[MAX_CLUSTER_NRPAGES]; node = jlookup(current_tree, get_inode_oid(inode), @@ -2529,8 +2531,7 @@ void truncate_complete_page_cluster(struct inode *inode, cloff_t index, assert("edward-1483", nr_pages != 0); if (!node) goto truncate; - found = find_get_pages(inode->i_mapping, - clust_to_pg(index, inode), + found = find_get_pages(inode->i_mapping, &page_index, cluster_nrpages(inode), pages); if (!found) { assert("edward-1484", jnode_truncate_ok(inode, index)); diff --git a/status_flags.c b/status_flags.c index 21e70c662..574005e06 100644 --- a/status_flags.c +++ b/status_flags.c @@ -46,7 +46,7 @@ int reiser4_status_init(reiser4_block_nr block) bio = bio_alloc(reiser4_ctx_gfp_mask_get(), 1); if (bio != NULL) { bio->bi_iter.bi_sector = block * (sb->s_blocksize >> 9); - bio->bi_bdev = sb->s_bdev; + bio_set_dev(bio, sb->s_bdev); bio->bi_io_vec[0].bv_page = page; bio->bi_io_vec[0].bv_len = sb->s_blocksize; bio->bi_io_vec[0].bv_offset = 0; @@ -146,7 +146,7 @@ int reiser4_status_write(__u64 status, __u64 extended_status, char *message) kunmap_atomic((char *)statuspage); bio_reset(bio); - bio->bi_bdev = sb->s_bdev; + bio_set_dev(bio, sb->s_bdev); bio->bi_io_vec[0].bv_page = get_super_private(sb)->status_page; bio->bi_io_vec[0].bv_len = sb->s_blocksize; bio->bi_io_vec[0].bv_offset = 0; diff --git a/wander.c b/wander.c index 8595c22cb..5dfb30ae3 100644 --- a/wander.c +++ b/wander.c @@ -728,7 +728,7 @@ static int write_jnodes_to_disk_extent( if (!bio) return RETERR(-ENOMEM); - bio->bi_bdev = super->s_bdev; + bio_set_dev(bio, super->s_bdev); bio->bi_iter.bi_sector = block * (super->s_blocksize >> 9); for (nr_used = 0, i = 0; i < nr_blocks; i++) { struct page *pg;