aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-12-11 18:20:35 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-12-11 18:20:35 +0100
commit0fbed24161fea03303a09a83f8c3c94f2446980f (patch)
treef8009271f28686ce1a6227432a9f8b4b59e94585
parent22276c57445de5b29e143affdabe72576ab8dce3 (diff)
downloadpatches-0fbed24161fea03303a09a83f8c3c94f2446980f.tar.gz
clean up zram patch
-rw-r--r--c06.patch34
1 files changed, 27 insertions, 7 deletions
diff --git a/c06.patch b/c06.patch
index 1e59c98c061b20..a6efc40c0b82ad 100644
--- a/c06.patch
+++ b/c06.patch
@@ -1,25 +1,45 @@
---
- drivers/block/zram/zram_drv.c | 13 ++++++++-----
- 1 file changed, 8 insertions(+), 5 deletions(-)
+ drivers/block/zram/zram_drv.c | 26 +++++++++++++++-----------
+ 1 file changed, 15 insertions(+), 11 deletions(-)
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
-@@ -1382,6 +1382,7 @@ static ssize_t hot_add_show(struct class
+@@ -1368,6 +1368,13 @@ static int zram_remove(struct zram *zram
+ }
+
+ /* zram-control sysfs attributes */
++
++/*
++ * NOTE: hot_add attribute is not the usual read-only sysfs attribute. In a
++ * sense that reading from this file does alter the state of your system -- it
++ * creates a new un-initialized zram device and returns back this device's
++ * device_id (or an error code if it fails to create a new device).
++ */
+ static ssize_t hot_add_show(struct class *class,
+ struct class_attribute *attr,
+ char *buf)
+@@ -1382,6 +1389,7 @@ static ssize_t hot_add_show(struct class
return ret;
return scnprintf(buf, PAGE_SIZE, "%d\n", ret);
}
-+static CLASS_ATTR_RO(hot_add);
++static CLASS_ATTR(hot_add, 0400, hot_add_show, NULL);
static ssize_t hot_remove_store(struct class *class,
struct class_attribute *attr,
-@@ -1411,17 +1412,19 @@ static ssize_t hot_remove_store(struct c
+@@ -1412,23 +1420,19 @@ static ssize_t hot_remove_store(struct c
mutex_unlock(&zram_index_mutex);
return ret ? ret : count;
}
+static CLASS_ATTR_WO(hot_remove);
+-/*
+- * NOTE: hot_add attribute is not the usual read-only sysfs attribute. In a
+- * sense that reading from this file does alter the state of your system -- it
+- * creates a new un-initialized zram device and returns back this device's
+- * device_id (or an error code if it fails to create a new device).
+- */
-static struct class_attribute zram_control_class_attrs[] = {
-- __ATTR_RO(hot_add),
+- __ATTR(hot_add, 0400, hot_add_show, NULL),
- __ATTR_WO(hot_remove),
- __ATTR_NULL,
+static struct attribute *zram_control_class_attrs[] = {
@@ -27,7 +47,7 @@
+ &class_attr_hot_remove.attr,
+ NULL,
};
-+ATTRIBUTE_GROUPS(zram_controll_class);
++ATTRIBUTE_GROUPS(zram_control_class);
static struct class zram_control_class = {
.name = "zram-control",