aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/writeback.h9
-rw-r--r--mm/page-writeback.c10
2 files changed, 13 insertions, 6 deletions
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 64a36ba43b2f..b096159086e8 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -53,10 +53,11 @@ struct writeback_control {
53 loff_t start; 53 loff_t start;
54 loff_t end; 54 loff_t end;
55 55
56 unsigned nonblocking:1; /* Don't get stuck on request queues */ 56 unsigned nonblocking:1; /* Don't get stuck on request queues */
57 unsigned encountered_congestion:1; /* An output: a queue is full */ 57 unsigned encountered_congestion:1; /* An output: a queue is full */
58 unsigned for_kupdate:1; /* A kupdate writeback */ 58 unsigned for_kupdate:1; /* A kupdate writeback */
59 unsigned for_reclaim:1; /* Invoked from the page allocator */ 59 unsigned for_reclaim:1; /* Invoked from the page allocator */
60 unsigned for_writepages:1; /* This is a writepages() call */
60}; 61};
61 62
62/* 63/*
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 0166ea15c9ee..5240e426c1f7 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -550,11 +550,17 @@ void __init page_writeback_init(void)
550 550
551int do_writepages(struct address_space *mapping, struct writeback_control *wbc) 551int do_writepages(struct address_space *mapping, struct writeback_control *wbc)
552{ 552{
553 int ret;
554
553 if (wbc->nr_to_write <= 0) 555 if (wbc->nr_to_write <= 0)
554 return 0; 556 return 0;
557 wbc->for_writepages = 1;
555 if (mapping->a_ops->writepages) 558 if (mapping->a_ops->writepages)
556 return mapping->a_ops->writepages(mapping, wbc); 559 ret = mapping->a_ops->writepages(mapping, wbc);
557 return generic_writepages(mapping, wbc); 560 else
561 ret = generic_writepages(mapping, wbc);
562 wbc->for_writepages = 0;
563 return ret;
558} 564}
559 565
560/** 566/**