diff options
author | Kent Overstreet <koverstreet@google.com> | 2013-06-05 17:21:07 +0400 |
---|---|---|
committer | Kent Overstreet <koverstreet@google.com> | 2013-06-27 08:57:23 +0400 |
commit | 279afbad4e54acbd61bf88a54a73af3bbfdeb5dd (patch) | |
tree | aefebaa3a7f54049904a275ca3035301603a9be1 /drivers/md/bcache/writeback.h | |
parent | 444fc0b6b167ed164e7436621a9d095e042644dd (diff) | |
download | linux-279afbad4e54acbd61bf88a54a73af3bbfdeb5dd.tar.xz |
bcache: Track dirty data by stripe
To make background writeback aware of raid5/6 stripes, we first need to
track the amount of dirty data within each stripe - we do this by
breaking up the existing sectors_dirty into per stripe atomic_ts
Signed-off-by: Kent Overstreet <koverstreet@google.com>
Diffstat (limited to 'drivers/md/bcache/writeback.h')
-rw-r--r-- | drivers/md/bcache/writeback.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/md/bcache/writeback.h b/drivers/md/bcache/writeback.h new file mode 100644 index 000000000000..5ce9771df047 --- /dev/null +++ b/drivers/md/bcache/writeback.h @@ -0,0 +1,21 @@ +#ifndef _BCACHE_WRITEBACK_H +#define _BCACHE_WRITEBACK_H + +static inline uint64_t bcache_dev_sectors_dirty(struct bcache_device *d) +{ + uint64_t i, ret = 0; + + for (i = 0; i < d->nr_stripes; i++) + ret += atomic_read(d->stripe_sectors_dirty + i); + + return ret; +} + +void bcache_dev_sectors_dirty_add(struct cache_set *, unsigned, uint64_t, int); +void bch_writeback_queue(struct cached_dev *); +void bch_writeback_add(struct cached_dev *); + +void bch_sectors_dirty_init(struct cached_dev *dc); +void bch_cached_dev_writeback_init(struct cached_dev *); + +#endif |