Lines Matching refs:store
217 struct bitmap_storage *store = &bitmap->storage; in write_sb_page() local
227 if (page->index == store->file_pages-1) { in write_sb_page()
228 int last_page_size = store->bytes & (PAGE_SIZE-1); in write_sb_page()
747 static inline unsigned long file_page_index(struct bitmap_storage *store, in file_page_index() argument
750 if (store->sb_page) in file_page_index()
756 static inline unsigned long file_page_offset(struct bitmap_storage *store, in file_page_offset() argument
759 if (store->sb_page) in file_page_offset()
768 static inline struct page *filemap_get_page(struct bitmap_storage *store, in filemap_get_page() argument
771 if (file_page_index(store, chunk) >= store->file_pages) in filemap_get_page()
773 return store->filemap[file_page_index(store, chunk)]; in filemap_get_page()
776 static int md_bitmap_storage_alloc(struct bitmap_storage *store, in md_bitmap_storage_alloc() argument
791 store->filemap = kmalloc_array(num_pages, sizeof(struct page *), in md_bitmap_storage_alloc()
793 if (!store->filemap) in md_bitmap_storage_alloc()
796 if (with_super && !store->sb_page) { in md_bitmap_storage_alloc()
797 store->sb_page = alloc_page(GFP_KERNEL|__GFP_ZERO); in md_bitmap_storage_alloc()
798 if (store->sb_page == NULL) in md_bitmap_storage_alloc()
803 if (store->sb_page) { in md_bitmap_storage_alloc()
804 store->filemap[0] = store->sb_page; in md_bitmap_storage_alloc()
806 store->sb_page->index = offset; in md_bitmap_storage_alloc()
810 store->filemap[pnum] = alloc_page(GFP_KERNEL|__GFP_ZERO); in md_bitmap_storage_alloc()
811 if (!store->filemap[pnum]) { in md_bitmap_storage_alloc()
812 store->file_pages = pnum; in md_bitmap_storage_alloc()
815 store->filemap[pnum]->index = pnum + offset; in md_bitmap_storage_alloc()
817 store->file_pages = pnum; in md_bitmap_storage_alloc()
821 store->filemap_attr = kzalloc( in md_bitmap_storage_alloc()
824 if (!store->filemap_attr) in md_bitmap_storage_alloc()
827 store->bytes = bytes; in md_bitmap_storage_alloc()
832 static void md_bitmap_file_unmap(struct bitmap_storage *store) in md_bitmap_file_unmap() argument
838 file = store->file; in md_bitmap_file_unmap()
839 map = store->filemap; in md_bitmap_file_unmap()
840 pages = store->file_pages; in md_bitmap_file_unmap()
841 sb_page = store->sb_page; in md_bitmap_file_unmap()
847 kfree(store->filemap_attr); in md_bitmap_file_unmap()
931 struct bitmap_storage *store = &bitmap->storage; in md_bitmap_file_set_bit() local
935 node_offset = bitmap->cluster_slot * store->file_pages; in md_bitmap_file_set_bit()
960 struct bitmap_storage *store = &bitmap->storage; in md_bitmap_file_clear_bit() local
964 node_offset = bitmap->cluster_slot * store->file_pages; in md_bitmap_file_clear_bit()
1065 struct bitmap_storage *store = &bitmap->storage; in md_bitmap_init_from_disk() local
1068 file = store->file; in md_bitmap_init_from_disk()
1072 store->filemap = NULL; in md_bitmap_init_from_disk()
1073 store->file_pages = 0; in md_bitmap_init_from_disk()
1089 if (file && i_size_read(file->f_mapping->host) < store->bytes) { in md_bitmap_init_from_disk()
1093 store->bytes); in md_bitmap_init_from_disk()
1103 node_offset = bitmap->cluster_slot * (DIV_ROUND_UP(store->bytes, PAGE_SIZE)); in md_bitmap_init_from_disk()
1112 if (index == store->file_pages-1) in md_bitmap_init_from_disk()
1113 count = store->bytes - index * PAGE_SIZE; in md_bitmap_init_from_disk()
1116 page = store->filemap[index]; in md_bitmap_init_from_disk()
1168 bmname(bitmap), store->file_pages, in md_bitmap_init_from_disk()
2067 struct bitmap_storage store; in md_bitmap_resize() local
2114 memset(&store, 0, sizeof(store)); in md_bitmap_resize()
2116 ret = md_bitmap_storage_alloc(&store, chunks, in md_bitmap_resize()
2121 md_bitmap_file_unmap(&store); in md_bitmap_resize()
2130 md_bitmap_file_unmap(&store); in md_bitmap_resize()
2137 store.file = bitmap->storage.file; in md_bitmap_resize()
2140 if (store.sb_page && bitmap->storage.sb_page) in md_bitmap_resize()
2141 memcpy(page_address(store.sb_page), in md_bitmap_resize()
2146 bitmap->storage = store; in md_bitmap_resize()