The only purpose seems to store SCRUB_PAGES_PER_WR_BIO, we can use the constant directly.
Signed-off-by: David Sterba <dste...@suse.com> --- fs/btrfs/scrub.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index f0c7ec38e33c..2c1d344c8edd 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -182,7 +182,6 @@ struct scrub_ctx { struct scrub_bio *wr_curr_bio; struct mutex wr_lock; - int pages_per_wr_bio; /* <= SCRUB_PAGES_PER_WR_BIO */ atomic_t flush_all_writes; struct btrfs_device *wr_tgtdev; @@ -718,7 +717,6 @@ struct scrub_ctx *scrub_setup_ctx(struct btrfs_device *dev, int is_dev_replace) sctx->wr_curr_bio = NULL; if (is_dev_replace) { WARN_ON(!dev->bdev); - sctx->pages_per_wr_bio = SCRUB_PAGES_PER_WR_BIO; sctx->wr_tgtdev = dev; atomic_set(&sctx->flush_all_writes, 0); } @@ -1918,7 +1916,7 @@ static int scrub_add_page_to_wr_bio(struct scrub_ctx *sctx, bio = sbio->bio; if (!bio) { bio = btrfs_io_bio_alloc(GFP_KERNEL, - sctx->pages_per_wr_bio); + SCRUB_PAGES_PER_WR_BIO); if (!bio) { mutex_unlock(&sctx->wr_lock); return -ENOMEM; @@ -1955,7 +1953,7 @@ static int scrub_add_page_to_wr_bio(struct scrub_ctx *sctx, sbio->pagev[sbio->page_count] = spage; scrub_page_get(spage); sbio->page_count++; - if (sbio->page_count == sctx->pages_per_wr_bio) + if (sbio->page_count == SCRUB_PAGES_PER_WR_BIO) scrub_wr_submit(sctx); mutex_unlock(&sctx->wr_lock); -- 2.12.0 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html