Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d77e18d authored by Blagovest Kolenichev's avatar Blagovest Kolenichev
Browse files

Revert "UPSTREAM: zram: set BDI_CAP_STABLE_WRITES once"



This reverts commit 7b4e1b64.

This is a preparation change for merging android-4.14 commit
e709f59a into msm-4.14 branch.
The reverted change is committed already as:

3694ff6b zram: set BDI_CAP_STABLE_WRITES once

Change-Id: Id7d4ac9130c4d727df64e9887993a737af98f674
Signed-off-by: default avatarBlagovest Kolenichev <bkolenichev@codeaurora.org>
parent e80ead3c
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -145,6 +145,14 @@ static inline bool is_partial_io(struct bio_vec *bvec)
}
#endif

static void zram_revalidate_disk(struct zram *zram)
{
	revalidate_disk(zram->disk);
	/* revalidate_disk reset the BDI_CAP_STABLE_WRITES so set again */
	zram->disk->queue->backing_dev_info->capabilities |=
		BDI_CAP_STABLE_WRITES;
}

/*
 * Check if request is within bounds and aligned on zram logical blocks.
 */
@@ -1509,8 +1517,7 @@ static ssize_t disksize_store(struct device *dev,
	zram->comp = comp;
	zram->disksize = disksize;
	set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT);

	revalidate_disk(zram->disk);
	zram_revalidate_disk(zram);
	up_write(&zram->init_lock);

	return len;
@@ -1557,7 +1564,7 @@ static ssize_t reset_store(struct device *dev,
	/* Make sure all the pending I/O are finished */
	fsync_bdev(bdev);
	zram_reset_device(zram);
	revalidate_disk(zram->disk);
	zram_revalidate_disk(zram);
	bdput(bdev);

	mutex_lock(&bdev->bd_mutex);
@@ -1676,7 +1683,6 @@ static int zram_add(void)
	/* zram devices sort of resembles non-rotational disks */
	queue_flag_set_unlocked(QUEUE_FLAG_NONROT, zram->disk->queue);
	queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, zram->disk->queue);

	/*
	 * To ensure that we always get PAGE_SIZE aligned
	 * and n*PAGE_SIZED sized I/O requests.
@@ -1701,8 +1707,6 @@ static int zram_add(void)
	if (ZRAM_LOGICAL_BLOCK_SIZE == PAGE_SIZE)
		blk_queue_max_write_zeroes_sectors(zram->disk->queue, UINT_MAX);

	zram->disk->queue->backing_dev_info->capabilities |=
					BDI_CAP_STABLE_WRITES;
	add_disk(zram->disk);

	ret = sysfs_create_group(&disk_to_dev(zram->disk)->kobj,