From: Satya Durga Srinivasu Prabhala Date: Wed, 11 May 2016 18:36:13 +0000 (-0700) Subject: block: zram: Fix compilation issues X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ba939576176482a9d3294dd488c7bd7ce00d3921;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git block: zram: Fix compilation issues While porting changes to 4.4, looks like some functionality lost and causing below compilation issues if we try to enable ZRAM. [1] drivers/block/zram/zram_drv.c: In function 'zram_bvec_write': drivers/block/zram/zram_drv.c:724:9: error: 'ALLOC_ERROR_LOG_RATE_MS' \ undeclared (first use in this function) ALLOC_ERROR_LOG_RATE_MS)) ^ drivers/block/zram/zram_drv.c:724:9: note: each undeclared identifier \ is reported only once for each function it appears in drivers/block/zram/zram_drv.c: In function 'zram_add': drivers/block/zram/zram_drv.c:1239:34: error: 'struct zram' has no \ member named 'queue' __set_bit(QUEUE_FLAG_FAST, &zram->queue->queue_flags); ^ make[4]: *** [drivers/block/zram/zram_drv.o] Error 1 make[3]: *** [drivers/block/zram] Error 2 make[2]: *** [drivers/block] Error 2 make[1]: *** [drivers] Error 2 [2] drivers/block/zram/zram_drv.c: In function 'zram_add': drivers/block/zram/zram_drv.c:1241:34: error: 'struct zram' \ has no member named 'queue' __set_bit(QUEUE_FLAG_FAST, &zram->queue->queue_flags); ^ make[4]: *** [drivers/block/zram/zram_drv.o] Error 1 make[3]: *** [drivers/block/zram] Error 2 make[2]: *** [drivers/block] Error 2 CRs-Fixed: 1013947 Change-Id: I4f7944069306ba92e1fd82625bc15c7fa3bcdb0c Signed-off-by: Satya Durga Srinivasu Prabhala --- diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index d6bff78ce8da..72d088b1863c 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -40,6 +40,13 @@ static DEFINE_MUTEX(zram_index_mutex); static int zram_major; static const char *default_compressor = "lzo"; +/* + * We don't need to see memory allocation errors more than once every 1 + * second to know that a problem is occurring. + */ +#define ALLOC_ERROR_LOG_RATE_MS 1000 + + /* Module params (documentation at end) */ static unsigned int num_devices = 1; @@ -1236,7 +1243,7 @@ static int zram_add(void) zram->disk->private_data = zram; snprintf(zram->disk->disk_name, 16, "zram%d", device_id); - __set_bit(QUEUE_FLAG_FAST, &zram->queue->queue_flags); + __set_bit(QUEUE_FLAG_FAST, &queue->queue_flags); /* Actual capacity set using syfs (/sys/block/zram/disksize */ set_capacity(zram->disk, 0); /* zram devices sort of resembles non-rotational disks */