diff options
author | NeilBrown <neilb@suse.de> | 2014-05-27 23:39:23 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2014-05-29 02:59:47 -0400 |
commit | f2e06c58841b3e89eaacfa88ce14389d311c54a8 (patch) | |
tree | 34ca8dd597489694c289d0da7a007b14adbe3be1 /drivers/md | |
parent | cf170f3fa451350e431314e1a0a52014fda4b2d6 (diff) |
md/bitmap: remove confusing code from filemap_get_page.
file_page_index(store, 0) is *always* 0.
This is because the bitmap sb, at 256 bytes, is *always* less than
one page.
So subtracting it has no effect and the code should be removed.
Reported-by: Goldwyn Rodrigues <rgoldwyn@suse.de>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/bitmap.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 9a8e66ae04f5..67f8b31e2054 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -669,17 +669,13 @@ static inline unsigned long file_page_offset(struct bitmap_storage *store, | |||
669 | /* | 669 | /* |
670 | * return a pointer to the page in the filemap that contains the given bit | 670 | * return a pointer to the page in the filemap that contains the given bit |
671 | * | 671 | * |
672 | * this lookup is complicated by the fact that the bitmap sb might be exactly | ||
673 | * 1 page (e.g., x86) or less than 1 page -- so the bitmap might start on page | ||
674 | * 0 or page 1 | ||
675 | */ | 672 | */ |
676 | static inline struct page *filemap_get_page(struct bitmap_storage *store, | 673 | static inline struct page *filemap_get_page(struct bitmap_storage *store, |
677 | unsigned long chunk) | 674 | unsigned long chunk) |
678 | { | 675 | { |
679 | if (file_page_index(store, chunk) >= store->file_pages) | 676 | if (file_page_index(store, chunk) >= store->file_pages) |
680 | return NULL; | 677 | return NULL; |
681 | return store->filemap[file_page_index(store, chunk) | 678 | return store->filemap[file_page_index(store, chunk)]; |
682 | - file_page_index(store, 0)]; | ||
683 | } | 679 | } |
684 | 680 | ||
685 | static int bitmap_storage_alloc(struct bitmap_storage *store, | 681 | static int bitmap_storage_alloc(struct bitmap_storage *store, |