Skip to content

Commit c72c616

Browse files
sergey-senozhatskytorvalds
authored andcommitted
zram: move compact_store() to sysfs functions area
A cosmetic change. We have a new code layout and keep zram per-device sysfs store and show functions in one place. Move compact_store() to that handlers block to conform to current layout. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Acked-by: Minchan Kim <minchan@kernel.org> Cc: Nitin Gupta <ngupta@vflare.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 10447b6 commit c72c616

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

drivers/block/zram/zram_drv.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -63,27 +63,6 @@ static inline struct zram *dev_to_zram(struct device *dev)
6363
return (struct zram *)dev_to_disk(dev)->private_data;
6464
}
6565

66-
static ssize_t compact_store(struct device *dev,
67-
struct device_attribute *attr, const char *buf, size_t len)
68-
{
69-
unsigned long nr_migrated;
70-
struct zram *zram = dev_to_zram(dev);
71-
struct zram_meta *meta;
72-
73-
down_read(&zram->init_lock);
74-
if (!init_done(zram)) {
75-
up_read(&zram->init_lock);
76-
return -EINVAL;
77-
}
78-
79-
meta = zram->meta;
80-
nr_migrated = zs_compact(meta->mem_pool);
81-
atomic64_add(nr_migrated, &zram->stats.num_migrated);
82-
up_read(&zram->init_lock);
83-
84-
return len;
85-
}
86-
8766
static ssize_t disksize_show(struct device *dev,
8867
struct device_attribute *attr, char *buf)
8968
{
@@ -1038,7 +1017,6 @@ static const struct block_device_operations zram_devops = {
10381017
.owner = THIS_MODULE
10391018
};
10401019

1041-
static DEVICE_ATTR_WO(compact);
10421020
static DEVICE_ATTR_RW(disksize);
10431021
static DEVICE_ATTR_RO(initstate);
10441022
static DEVICE_ATTR_WO(reset);
@@ -1066,7 +1044,6 @@ static struct attribute *zram_disk_attrs[] = {
10661044
&dev_attr_num_writes.attr,
10671045
&dev_attr_failed_reads.attr,
10681046
&dev_attr_failed_writes.attr,
1069-
&dev_attr_compact.attr,
10701047
&dev_attr_invalid_io.attr,
10711048
&dev_attr_notify_free.attr,
10721049
&dev_attr_zero_pages.attr,

0 commit comments

Comments
 (0)