aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSultan Qasim Khan <sultanqasim@gmail.com>2015-09-06 17:59:58 -0400
committerMister Oyster <oysterized@gmail.com>2017-09-25 20:26:59 +0200
commit56b31b8c5ade6986bfbb064e5127d1ac79e597fb (patch)
tree6a3b90d31d7ad18f9a691bccb4b8c55692edc741 /include
parent6f44eca8c982bcebea87cca776193ddefa062a6f (diff)
block: zram: Backport from Linux 4.1
Change-Id: I23f6f75979077992298d848efd79a6efc0d776bd
Diffstat (limited to 'include')
-rw-r--r--include/linux/bio.h5
-rw-r--r--include/linux/device.h6
-rw-r--r--include/linux/sysfs.h8
3 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 8245f6cb3..e09261bab 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -284,6 +284,11 @@ extern struct bio *bio_copy_kern(struct request_queue *, void *, unsigned int,
extern void bio_set_pages_dirty(struct bio *bio);
extern void bio_check_pages_dirty(struct bio *bio);
+void generic_start_io_acct(int rw, unsigned long sectors,
+ struct hd_struct *part);
+void generic_end_io_acct(int rw, struct hd_struct *part,
+ unsigned long start_time);
+
#ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
# error "You should define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE for your platform"
#endif
diff --git a/include/linux/device.h b/include/linux/device.h
index c0a126125..0f90d5f47 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -504,6 +504,12 @@ ssize_t device_store_bool(struct device *dev, struct device_attribute *attr,
#define DEVICE_ATTR(_name, _mode, _show, _store) \
struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
+#define DEVICE_ATTR_RW(_name) \
+ struct device_attribute dev_attr_##_name = __ATTR_RW(_name)
+#define DEVICE_ATTR_RO(_name) \
+ struct device_attribute dev_attr_##_name = __ATTR_RO(_name)
+#define DEVICE_ATTR_WO(_name) \
+ struct device_attribute dev_attr_##_name = __ATTR_WO(_name)
#define DEVICE_ULONG_ATTR(_name, _mode, _var) \
struct dev_ext_attribute dev_attr_##_name = \
{ __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) }
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index e2cee22f5..4e1a023c3 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -79,6 +79,14 @@ struct attribute_group {
.show = _name##_show, \
}
+#define __ATTR_WO(_name) { \
+ .attr = { .name = __stringify(_name), .mode = S_IWUSR }, \
+ .store = _name##_store, \
+}
+
+#define __ATTR_RW(_name) __ATTR(_name, (S_IWUSR | S_IRUGO), \
+ _name##_show, _name##_store)
+
#define __ATTR_NULL { .attr = { .name = NULL } }
#ifdef CONFIG_DEBUG_LOCK_ALLOC