Commit 99ebbd30 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

revert "zram: move compact_store() to sysfs functions area"

Revert commit c72c6160

It was intended to be a cosmetic change that w/o any functional change
and was part of a bigger change:

Sergey Senozhatsky <>
Cc: Linus Torvalds <>
Cc: Minchan Kim <>
Cc: Nitin Gupta <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent d9cee5d4
......@@ -74,6 +74,27 @@ static inline struct zram *dev_to_zram(struct device *dev)
return (struct zram *)dev_to_disk(dev)->private_data;
static ssize_t compact_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t len)
unsigned long nr_migrated;
struct zram *zram = dev_to_zram(dev);
struct zram_meta *meta;
if (!init_done(zram)) {
return -EINVAL;
meta = zram->meta;
nr_migrated = zs_compact(meta->mem_pool);
atomic64_add(nr_migrated, &zram->stats.num_migrated);
return len;
static ssize_t disksize_show(struct device *dev,
struct device_attribute *attr, char *buf)
......@@ -1038,6 +1059,7 @@ static const struct block_device_operations zram_devops = {
.owner = THIS_MODULE
static DEVICE_ATTR_WO(compact);
static DEVICE_ATTR_RW(disksize);
static DEVICE_ATTR_RO(initstate);
static DEVICE_ATTR_WO(reset);
......@@ -1114,6 +1136,7 @@ static struct attribute *zram_disk_attrs[] = {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment