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

Commit 696fe917 authored by Vivek Kumar's avatar Vivek Kumar Committed by Gerrit - the friendly Code Review server
Browse files

block: gendisk: Add a new flag in gendisk structure



Add a new flag in gendisk structure to serialize offsets
for swap partition. This flag is enabled for the gendisk of
the block device which will be used for saving the snapshot
of the hibernation image, based on a kernel parameter
"noswap_randomize". Serializing offset in swap partition
helps in improving hibernation resume time from bootloader.

Change-Id: I52ecd078fd47ff6f47b7eff27ee8333a3aac85f8
Signed-off-by: default avatarVivek Kumar <vivekuma@codeaurora.org>
parent ffd32d2b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -141,6 +141,7 @@ struct hd_struct {
#define GENHD_FL_NATIVE_CAPACITY		128
#define GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE	256
#define GENHD_FL_NO_PART_SCAN			512
#define GENHD_FL_NO_RANDOMIZE			1024

enum {
	DISK_EVENT_MEDIA_CHANGE			= 1 << 0, /* media changed */
+3 −0
Original line number Diff line number Diff line
@@ -1534,6 +1534,9 @@ int swsusp_check(void)
					    FMODE_READ, NULL);
	if (!IS_ERR(hib_resume_bdev)) {
		set_blocksize(hib_resume_bdev, PAGE_SIZE);
		if (noswap_randomize)
			hib_resume_bdev->bd_disk->flags |=
					GENHD_FL_NO_RANDOMIZE;
		clear_page(swsusp_header);
		error = hib_submit_io(REQ_OP_READ, 0,
					swsusp_resume_block,