mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
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>
This commit is contained in:
parent
cf170f3fa4
commit
f2e06c5884
1 changed files with 1 additions and 5 deletions
|
@ -669,17 +669,13 @@ static inline unsigned long file_page_offset(struct bitmap_storage *store,
|
||||||
/*
|
/*
|
||||||
* return a pointer to the page in the filemap that contains the given bit
|
* return a pointer to the page in the filemap that contains the given bit
|
||||||
*
|
*
|
||||||
* this lookup is complicated by the fact that the bitmap sb might be exactly
|
|
||||||
* 1 page (e.g., x86) or less than 1 page -- so the bitmap might start on page
|
|
||||||
* 0 or page 1
|
|
||||||
*/
|
*/
|
||||||
static inline struct page *filemap_get_page(struct bitmap_storage *store,
|
static inline struct page *filemap_get_page(struct bitmap_storage *store,
|
||||||
unsigned long chunk)
|
unsigned long chunk)
|
||||||
{
|
{
|
||||||
if (file_page_index(store, chunk) >= store->file_pages)
|
if (file_page_index(store, chunk) >= store->file_pages)
|
||||||
return NULL;
|
return NULL;
|
||||||
return store->filemap[file_page_index(store, chunk)
|
return store->filemap[file_page_index(store, chunk)];
|
||||||
- file_page_index(store, 0)];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int bitmap_storage_alloc(struct bitmap_storage *store,
|
static int bitmap_storage_alloc(struct bitmap_storage *store,
|
||||||
|
|
Loading…
Add table
Reference in a new issue