aboutsummaryrefslogtreecommitdiffstats
path: root/block/deadline-iosched.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/deadline-iosched.c')
-rw-r--r--block/deadline-iosched.c64
1 files changed, 21 insertions, 43 deletions
diff --git a/block/deadline-iosched.c b/block/deadline-iosched.c
index a3e3ff1e0c65..399fa1e60e1f 100644
--- a/block/deadline-iosched.c
+++ b/block/deadline-iosched.c
@@ -719,11 +719,11 @@ static ssize_t __FUNC(elevator_t *e, char *page) \
719 __data = jiffies_to_msecs(__data); \ 719 __data = jiffies_to_msecs(__data); \
720 return deadline_var_show(__data, (page)); \ 720 return deadline_var_show(__data, (page)); \
721} 721}
722SHOW_FUNCTION(deadline_readexpire_show, dd->fifo_expire[READ], 1); 722SHOW_FUNCTION(deadline_read_expire_show, dd->fifo_expire[READ], 1);
723SHOW_FUNCTION(deadline_writeexpire_show, dd->fifo_expire[WRITE], 1); 723SHOW_FUNCTION(deadline_write_expire_show, dd->fifo_expire[WRITE], 1);
724SHOW_FUNCTION(deadline_writesstarved_show, dd->writes_starved, 0); 724SHOW_FUNCTION(deadline_writes_starved_show, dd->writes_starved, 0);
725SHOW_FUNCTION(deadline_frontmerges_show, dd->front_merges, 0); 725SHOW_FUNCTION(deadline_front_merges_show, dd->front_merges, 0);
726SHOW_FUNCTION(deadline_fifobatch_show, dd->fifo_batch, 0); 726SHOW_FUNCTION(deadline_fifo_batch_show, dd->fifo_batch, 0);
727#undef SHOW_FUNCTION 727#undef SHOW_FUNCTION
728 728
729#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX, __CONV) \ 729#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX, __CONV) \
@@ -742,46 +742,24 @@ static ssize_t __FUNC(elevator_t *e, const char *page, size_t count) \
742 *(__PTR) = __data; \ 742 *(__PTR) = __data; \
743 return ret; \ 743 return ret; \
744} 744}
745STORE_FUNCTION(deadline_readexpire_store, &dd->fifo_expire[READ], 0, INT_MAX, 1); 745STORE_FUNCTION(deadline_read_expire_store, &dd->fifo_expire[READ], 0, INT_MAX, 1);
746STORE_FUNCTION(deadline_writeexpire_store, &dd->fifo_expire[WRITE], 0, INT_MAX, 1); 746STORE_FUNCTION(deadline_write_expire_store, &dd->fifo_expire[WRITE], 0, INT_MAX, 1);
747STORE_FUNCTION(deadline_writesstarved_store, &dd->writes_starved, INT_MIN, INT_MAX, 0); 747STORE_FUNCTION(deadline_writes_starved_store, &dd->writes_starved, INT_MIN, INT_MAX, 0);
748STORE_FUNCTION(deadline_frontmerges_store, &dd->front_merges, 0, 1, 0); 748STORE_FUNCTION(deadline_front_merges_store, &dd->front_merges, 0, 1, 0);
749STORE_FUNCTION(deadline_fifobatch_store, &dd->fifo_batch, 0, INT_MAX, 0); 749STORE_FUNCTION(deadline_fifo_batch_store, &dd->fifo_batch, 0, INT_MAX, 0);
750#undef STORE_FUNCTION 750#undef STORE_FUNCTION
751 751
752static struct elv_fs_entry deadline_readexpire_entry = { 752#define DD_ATTR(name) \
753 .attr = {.name = "read_expire", .mode = S_IRUGO | S_IWUSR }, 753 __ATTR(name, S_IRUGO|S_IWUSR, deadline_##name##_show, \
754 .show = deadline_readexpire_show, 754 deadline_##name##_store)
755 .store = deadline_readexpire_store, 755
756}; 756static struct elv_fs_entry deadline_attrs[] = {
757static struct elv_fs_entry deadline_writeexpire_entry = { 757 DD_ATTR(read_expire),
758 .attr = {.name = "write_expire", .mode = S_IRUGO | S_IWUSR }, 758 DD_ATTR(write_expire),
759 .show = deadline_writeexpire_show, 759 DD_ATTR(writes_starved),
760 .store = deadline_writeexpire_store, 760 DD_ATTR(front_merges),
761}; 761 DD_ATTR(fifo_batch),
762static struct elv_fs_entry deadline_writesstarved_entry = { 762 __ATTR_NULL
763 .attr = {.name = "writes_starved", .mode = S_IRUGO | S_IWUSR },
764 .show = deadline_writesstarved_show,
765 .store = deadline_writesstarved_store,
766};
767static struct elv_fs_entry deadline_frontmerges_entry = {
768 .attr = {.name = "front_merges", .mode = S_IRUGO | S_IWUSR },
769 .show = deadline_frontmerges_show,
770 .store = deadline_frontmerges_store,
771};
772static struct elv_fs_entry deadline_fifobatch_entry = {
773 .attr = {.name = "fifo_batch", .mode = S_IRUGO | S_IWUSR },
774 .show = deadline_fifobatch_show,
775 .store = deadline_fifobatch_store,
776};
777
778static struct attribute *deadline_attrs[] = {
779 &deadline_readexpire_entry.attr,
780 &deadline_writeexpire_entry.attr,
781 &deadline_writesstarved_entry.attr,
782 &deadline_frontmerges_entry.attr,
783 &deadline_fifobatch_entry.attr,
784 NULL,
785}; 763};
786 764
787static struct elevator_type iosched_deadline = { 765static struct elevator_type iosched_deadline = {