[RFC PATCH 20/21] Call padding callback on flush.

From: Tom Zanussi
Date: Thu Oct 16 2008 - 02:19:03 EST


---
kernel/relay_pagewriter.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/kernel/relay_pagewriter.c b/kernel/relay_pagewriter.c
index 9bc1461..c3369f5 100644
--- a/kernel/relay_pagewriter.c
+++ b/kernel/relay_pagewriter.c
@@ -137,10 +137,18 @@ void pagewriter_flush(struct pagewriter *pagewriter)
return;

mutex_lock(&pagewriters_mutex);
- for_each_possible_cpu(i)
- if (pagewriter->buf[i])
- pagewriter->cb->switch_page(pagewriter->buf[i], 0,
- NULL);
+ for_each_possible_cpu(i) {
+ struct pagewriter_buf *buf = pagewriter->buf[i];
+ if (buf) {
+ if (buf->pagewriter->flags & PAGEWRITER_PAD_WRITES) {
+ void *padding = buf->data + buf->offset;
+ size_t padlen = PAGE_SIZE - buf->offset;
+ pagewriter->cb->write_padding(buf, padlen,
+ padding);
+ }
+ pagewriter->cb->switch_page(buf, 0, NULL);
+ }
+ }
relay_flush(pagewriter->rchan);
mutex_unlock(&pagewriters_mutex);
}
--
1.5.3.5



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/