Lines Matching refs:store
212 struct bitmap_storage *store = &bitmap->storage; in write_sb_page() local
216 node_offset = bitmap->cluster_slot * store->file_pages; in write_sb_page()
224 if (page->index == store->file_pages-1) { in write_sb_page()
225 int last_page_size = store->bytes & (PAGE_SIZE-1); in write_sb_page()
724 static inline unsigned long file_page_index(struct bitmap_storage *store, in file_page_index() argument
727 if (store->sb_page) in file_page_index()
733 static inline unsigned long file_page_offset(struct bitmap_storage *store, in file_page_offset() argument
736 if (store->sb_page) in file_page_offset()
745 static inline struct page *filemap_get_page(struct bitmap_storage *store, in filemap_get_page() argument
748 if (file_page_index(store, chunk) >= store->file_pages) in filemap_get_page()
750 return store->filemap[file_page_index(store, chunk)]; in filemap_get_page()
753 static int bitmap_storage_alloc(struct bitmap_storage *store, in bitmap_storage_alloc() argument
768 store->filemap = kmalloc(sizeof(struct page *) in bitmap_storage_alloc()
770 if (!store->filemap) in bitmap_storage_alloc()
773 if (with_super && !store->sb_page) { in bitmap_storage_alloc()
774 store->sb_page = alloc_page(GFP_KERNEL|__GFP_ZERO); in bitmap_storage_alloc()
775 if (store->sb_page == NULL) in bitmap_storage_alloc()
780 if (store->sb_page) { in bitmap_storage_alloc()
781 store->filemap[0] = store->sb_page; in bitmap_storage_alloc()
783 store->sb_page->index = offset; in bitmap_storage_alloc()
787 store->filemap[pnum] = alloc_page(GFP_KERNEL|__GFP_ZERO); in bitmap_storage_alloc()
788 if (!store->filemap[pnum]) { in bitmap_storage_alloc()
789 store->file_pages = pnum; in bitmap_storage_alloc()
792 store->filemap[pnum]->index = pnum + offset; in bitmap_storage_alloc()
794 store->file_pages = pnum; in bitmap_storage_alloc()
798 store->filemap_attr = kzalloc( in bitmap_storage_alloc()
801 if (!store->filemap_attr) in bitmap_storage_alloc()
804 store->bytes = bytes; in bitmap_storage_alloc()
809 static void bitmap_file_unmap(struct bitmap_storage *store) in bitmap_file_unmap() argument
815 file = store->file; in bitmap_file_unmap()
816 map = store->filemap; in bitmap_file_unmap()
817 pages = store->file_pages; in bitmap_file_unmap()
818 sb_page = store->sb_page; in bitmap_file_unmap()
824 kfree(store->filemap_attr); in bitmap_file_unmap()
1031 struct bitmap_storage *store = &bitmap->storage; in bitmap_init_from_disk() local
1034 file = store->file; in bitmap_init_from_disk()
1038 store->filemap = NULL; in bitmap_init_from_disk()
1039 store->file_pages = 0; in bitmap_init_from_disk()
1056 if (file && i_size_read(file->f_mapping->host) < store->bytes) { in bitmap_init_from_disk()
1060 store->bytes); in bitmap_init_from_disk()
1070 node_offset = bitmap->cluster_slot * (DIV_ROUND_UP(store->bytes, PAGE_SIZE)); in bitmap_init_from_disk()
1079 if (index == store->file_pages-1) in bitmap_init_from_disk()
1080 count = store->bytes - index * PAGE_SIZE; in bitmap_init_from_disk()
1083 page = store->filemap[index]; in bitmap_init_from_disk()
1136 bmname(bitmap), store->file_pages, in bitmap_init_from_disk()
1958 struct bitmap_storage store; in bitmap_resize() local
1999 memset(&store, 0, sizeof(store)); in bitmap_resize()
2001 ret = bitmap_storage_alloc(&store, chunks, in bitmap_resize()
2013 bitmap_file_unmap(&store); in bitmap_resize()
2020 store.file = bitmap->storage.file; in bitmap_resize()
2023 if (store.sb_page && bitmap->storage.sb_page) in bitmap_resize()
2024 memcpy(page_address(store.sb_page), in bitmap_resize()
2028 bitmap->storage = store; in bitmap_resize()