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()
723 static inline unsigned long file_page_index(struct bitmap_storage *store, in file_page_index() argument
726 if (store->sb_page) in file_page_index()
732 static inline unsigned long file_page_offset(struct bitmap_storage *store, in file_page_offset() argument
735 if (store->sb_page) in file_page_offset()
744 static inline struct page *filemap_get_page(struct bitmap_storage *store, in filemap_get_page() argument
747 if (file_page_index(store, chunk) >= store->file_pages) in filemap_get_page()
749 return store->filemap[file_page_index(store, chunk)]; in filemap_get_page()
752 static int bitmap_storage_alloc(struct bitmap_storage *store, in bitmap_storage_alloc() argument
767 store->filemap = kmalloc(sizeof(struct page *) in bitmap_storage_alloc()
769 if (!store->filemap) in bitmap_storage_alloc()
772 if (with_super && !store->sb_page) { in bitmap_storage_alloc()
773 store->sb_page = alloc_page(GFP_KERNEL|__GFP_ZERO); in bitmap_storage_alloc()
774 if (store->sb_page == NULL) in bitmap_storage_alloc()
779 if (store->sb_page) { in bitmap_storage_alloc()
780 store->filemap[0] = store->sb_page; in bitmap_storage_alloc()
782 store->sb_page->index = offset; in bitmap_storage_alloc()
786 store->filemap[pnum] = alloc_page(GFP_KERNEL|__GFP_ZERO); in bitmap_storage_alloc()
787 if (!store->filemap[pnum]) { in bitmap_storage_alloc()
788 store->file_pages = pnum; in bitmap_storage_alloc()
791 store->filemap[pnum]->index = pnum + offset; in bitmap_storage_alloc()
793 store->file_pages = pnum; in bitmap_storage_alloc()
797 store->filemap_attr = kzalloc( in bitmap_storage_alloc()
800 if (!store->filemap_attr) in bitmap_storage_alloc()
803 store->bytes = bytes; in bitmap_storage_alloc()
808 static void bitmap_file_unmap(struct bitmap_storage *store) in bitmap_file_unmap() argument
814 file = store->file; in bitmap_file_unmap()
815 map = store->filemap; in bitmap_file_unmap()
816 pages = store->file_pages; in bitmap_file_unmap()
817 sb_page = store->sb_page; in bitmap_file_unmap()
823 kfree(store->filemap_attr); in bitmap_file_unmap()
1030 struct bitmap_storage *store = &bitmap->storage; in bitmap_init_from_disk() local
1033 file = store->file; in bitmap_init_from_disk()
1037 store->filemap = NULL; in bitmap_init_from_disk()
1038 store->file_pages = 0; in bitmap_init_from_disk()
1055 if (file && i_size_read(file->f_mapping->host) < store->bytes) { in bitmap_init_from_disk()
1059 store->bytes); in bitmap_init_from_disk()
1069 node_offset = bitmap->cluster_slot * (DIV_ROUND_UP(store->bytes, PAGE_SIZE)); in bitmap_init_from_disk()
1078 if (index == store->file_pages-1) in bitmap_init_from_disk()
1079 count = store->bytes - index * PAGE_SIZE; in bitmap_init_from_disk()
1082 page = store->filemap[index]; in bitmap_init_from_disk()
1135 bmname(bitmap), store->file_pages, in bitmap_init_from_disk()
1953 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()