diff --git a/fs/erofs/unzip_vle.c b/fs/erofs/unzip_vle.c index ba45d7c79afa..60d9b3185761 100644 --- a/fs/erofs/unzip_vle.c +++ b/fs/erofs/unzip_vle.c @@ -1631,7 +1631,9 @@ static int z_erofs_vle_normalaccess_readpages(struct file *filp, unsigned int nr_pages) { struct inode *const inode = mapping->host; +#ifdef CONFIG_BLK_DEV_THROTTLING struct block_device *bdev = inode->i_sb->s_bdev; +#endif struct erofs_sb_info *const sbi = EROFS_I_SB(inode); bool sync = __should_decompress_synchronously(sbi, nr_pages); @@ -1643,6 +1645,7 @@ static int z_erofs_vle_normalaccess_readpages(struct file *filp, trace_erofs_readpages(mapping->host, lru_to_page(pages), nr_pages, false); +#ifdef CONFIG_BLK_DEV_THROTTLING if (pages) { /* * Get one quota before read pages, when this ends, @@ -1652,6 +1655,7 @@ static int z_erofs_vle_normalaccess_readpages(struct file *filp, blk_throtl_get_quota(bdev, PAGE_SIZE, msecs_to_jiffies(100), true); } +#endif #if (EROFS_FS_ZIP_CACHE_LVL >= 2) f.cachedzone_la = lru_to_page(pages)->index << PAGE_SHIFT; @@ -1707,10 +1711,12 @@ static int z_erofs_vle_normalaccess_readpages(struct file *filp, /* clean up the remaining free pages */ put_pages_list(&pagepool); +#ifdef CONFIG_BLK_DEV_THROTTLING if (io_submitted) while (--io_submitted) blk_throtl_get_quota(bdev, PAGE_SIZE, msecs_to_jiffies(100), true); +#endif return 0; }