summaryrefslogtreecommitdiff
path: root/drivers/md/bitmap.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-05-22 13:55:06 +1000
committerNeilBrown <neilb@suse.de>2012-05-22 13:55:06 +1000
commitbf07bb7d5be813630d3530be274b3324f85e310c (patch)
tree22fc12593b6d377ceb7b94c42d346f2946319c48 /drivers/md/bitmap.h
parentbc0934f0477d0a2350a478004799d9c064923b7b (diff)
md/bitmap: disentangle two different 'pending' flags.
There are two different 'pending' concepts in the handling of the write intent bitmap. Firstly, a 'page' from the bitmap (which container PAGE_SIZE*8 bits) may have changes (bits cleared) that should be written in due course. There is no hurry for these and the page will transition from PENDING to NEEDWRITE and will then be written, though if it ever becomes DIRTY it will be written much sooner and PENDING will be cleared. Secondly, a page of counters - which contains PAGE_SIZE/2 counters, one for each bit, can usefully have a 'pending' flag which indicates if any of the counters are low (2 or 1) and ready to be processed by bitmap_daemon_work(). If this flag is clear we can skip the whole page. These two concepts are currently combined in the bitmap-file flag. This causes a tighter connection between the counters and the bitmap file than I would like - as I want to add some flexibility to the bitmap file. So introduce a new flag with the page-of-counters, and rewrite bitmap_daemon_work() so that it handles the two different 'pending' concepts separately. This also allows us to clear BITMAP_PAGE_PENDING when we write out a dirty page, which may occasionally reduce the number of times we write a page. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/bitmap.h')
-rw-r--r--drivers/md/bitmap.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/md/bitmap.h b/drivers/md/bitmap.h
index b44b0aba2d47..79e17983473a 100644
--- a/drivers/md/bitmap.h
+++ b/drivers/md/bitmap.h
@@ -160,9 +160,14 @@ struct bitmap_page {
*/
unsigned int hijacked:1;
/*
+ * If any counter in this page is '1' or '2' - and so could be
+ * cleared then that page is marked as 'pending'
+ */
+ unsigned int pending:1;
+ /*
* count of dirty bits on the page
*/
- unsigned int count:31;
+ unsigned int count:30;
};
/* the main bitmap structure - one per mddev */