Lines Matching refs:store

440 	struct bitmap_storage *store = &bitmap->storage;  in __write_sb_page()  local
451 if ((pg_index - store->sb_index) == num_pages - 1) { in __write_sb_page()
452 unsigned int last_page_size = store->bytes & (PAGE_SIZE - 1); in __write_sb_page()
649 struct bitmap_storage *store = &bitmap->storage; in filemap_write_page() local
650 struct page *page = store->filemap[pg_index]; in filemap_write_page()
654 pg_index += store->sb_index; in filemap_write_page()
657 if (store->file) in filemap_write_page()
991 static inline unsigned long file_page_index(struct bitmap_storage *store, in file_page_index() argument
994 if (store->sb_page) in file_page_index()
1000 static inline unsigned long file_page_offset(struct bitmap_storage *store, in file_page_offset() argument
1003 if (store->sb_page) in file_page_offset()
1012 static inline struct page *filemap_get_page(struct bitmap_storage *store, in filemap_get_page() argument
1015 if (file_page_index(store, chunk) >= store->file_pages) in filemap_get_page()
1017 return store->filemap[file_page_index(store, chunk)]; in filemap_get_page()
1020 static int md_bitmap_storage_alloc(struct bitmap_storage *store, in md_bitmap_storage_alloc() argument
1035 store->filemap = kmalloc_array(num_pages, sizeof(struct page *), in md_bitmap_storage_alloc()
1037 if (!store->filemap) in md_bitmap_storage_alloc()
1040 if (with_super && !store->sb_page) { in md_bitmap_storage_alloc()
1041 store->sb_page = alloc_page(GFP_KERNEL|__GFP_ZERO); in md_bitmap_storage_alloc()
1042 if (store->sb_page == NULL) in md_bitmap_storage_alloc()
1047 if (store->sb_page) { in md_bitmap_storage_alloc()
1048 store->filemap[0] = store->sb_page; in md_bitmap_storage_alloc()
1050 store->sb_index = offset; in md_bitmap_storage_alloc()
1054 store->filemap[pnum] = alloc_page(GFP_KERNEL|__GFP_ZERO); in md_bitmap_storage_alloc()
1055 if (!store->filemap[pnum]) { in md_bitmap_storage_alloc()
1056 store->file_pages = pnum; in md_bitmap_storage_alloc()
1060 store->file_pages = pnum; in md_bitmap_storage_alloc()
1064 store->filemap_attr = kzalloc( in md_bitmap_storage_alloc()
1067 if (!store->filemap_attr) in md_bitmap_storage_alloc()
1070 store->bytes = bytes; in md_bitmap_storage_alloc()
1075 static void md_bitmap_file_unmap(struct bitmap_storage *store) in md_bitmap_file_unmap() argument
1077 struct file *file = store->file; in md_bitmap_file_unmap()
1078 struct page *sb_page = store->sb_page; in md_bitmap_file_unmap()
1079 struct page **map = store->filemap; in md_bitmap_file_unmap()
1080 int pages = store->file_pages; in md_bitmap_file_unmap()
1086 kfree(store->filemap_attr); in md_bitmap_file_unmap()
1162 struct bitmap_storage *store = &bitmap->storage; in md_bitmap_file_set_bit() local
1163 unsigned long index = file_page_index(store, chunk); in md_bitmap_file_set_bit()
1166 index += store->sb_index; in md_bitmap_file_set_bit()
1168 node_offset = bitmap->cluster_slot * store->file_pages; in md_bitmap_file_set_bit()
1193 struct bitmap_storage *store = &bitmap->storage; in md_bitmap_file_clear_bit() local
1194 unsigned long index = file_page_index(store, chunk); in md_bitmap_file_clear_bit()
1197 index += store->sb_index; in md_bitmap_file_clear_bit()
1199 node_offset = bitmap->cluster_slot * store->file_pages; in md_bitmap_file_clear_bit()
1334 struct bitmap_storage *store = &bitmap->storage; in md_bitmap_init_from_disk() local
1335 struct file *file = store->file; in md_bitmap_init_from_disk()
1343 store->filemap = NULL; in md_bitmap_init_from_disk()
1344 store->file_pages = 0; in md_bitmap_init_from_disk()
1356 if (file && i_size_read(file->f_mapping->host) < store->bytes) { in md_bitmap_init_from_disk()
1360 store->bytes); in md_bitmap_init_from_disk()
1366 node_offset = bitmap->cluster_slot * (DIV_ROUND_UP(store->bytes, PAGE_SIZE)); in md_bitmap_init_from_disk()
1368 for (i = 0; i < store->file_pages; i++) { in md_bitmap_init_from_disk()
1369 struct page *page = store->filemap[i]; in md_bitmap_init_from_disk()
1373 if (i == store->file_pages - 1) in md_bitmap_init_from_disk()
1374 count = store->bytes - i * PAGE_SIZE; in md_bitmap_init_from_disk()
1391 for (i = 0; i < store->file_pages; i++) { in md_bitmap_init_from_disk()
1392 struct page *page = store->filemap[i]; in md_bitmap_init_from_disk()
1440 bmname(bitmap), store->file_pages, in md_bitmap_init_from_disk()
2402 struct bitmap_storage store; in __bitmap_resize() local
2449 memset(&store, 0, sizeof(store)); in __bitmap_resize()
2451 ret = md_bitmap_storage_alloc(&store, chunks, in __bitmap_resize()
2456 md_bitmap_file_unmap(&store); in __bitmap_resize()
2465 md_bitmap_file_unmap(&store); in __bitmap_resize()
2472 store.file = bitmap->storage.file; in __bitmap_resize()
2475 if (store.sb_page && bitmap->storage.sb_page) in __bitmap_resize()
2476 memcpy(page_address(store.sb_page), in __bitmap_resize()
2481 bitmap->storage = store; in __bitmap_resize()