Lines Matching refs:store
428 struct bitmap_storage *store = &bitmap->storage; in __write_sb_page() local
439 if ((pg_index - store->sb_index) == store->file_pages - 1) { in __write_sb_page()
440 unsigned int last_page_size = store->bytes & (PAGE_SIZE - 1); in __write_sb_page()
637 struct bitmap_storage *store = &bitmap->storage; in filemap_write_page() local
638 struct page *page = store->filemap[pg_index]; in filemap_write_page()
642 pg_index += store->sb_index; in filemap_write_page()
645 if (store->file) in filemap_write_page()
979 static inline unsigned long file_page_index(struct bitmap_storage *store, in file_page_index() argument
982 if (store->sb_page) in file_page_index()
988 static inline unsigned long file_page_offset(struct bitmap_storage *store, in file_page_offset() argument
991 if (store->sb_page) in file_page_offset()
1000 static inline struct page *filemap_get_page(struct bitmap_storage *store, in filemap_get_page() argument
1003 if (file_page_index(store, chunk) >= store->file_pages) in filemap_get_page()
1005 return store->filemap[file_page_index(store, chunk)]; in filemap_get_page()
1008 static int md_bitmap_storage_alloc(struct bitmap_storage *store, in md_bitmap_storage_alloc() argument
1023 store->filemap = kmalloc_array(num_pages, sizeof(struct page *), in md_bitmap_storage_alloc()
1025 if (!store->filemap) in md_bitmap_storage_alloc()
1028 if (with_super && !store->sb_page) { in md_bitmap_storage_alloc()
1029 store->sb_page = alloc_page(GFP_KERNEL|__GFP_ZERO); in md_bitmap_storage_alloc()
1030 if (store->sb_page == NULL) in md_bitmap_storage_alloc()
1035 if (store->sb_page) { in md_bitmap_storage_alloc()
1036 store->filemap[0] = store->sb_page; in md_bitmap_storage_alloc()
1038 store->sb_index = offset; in md_bitmap_storage_alloc()
1042 store->filemap[pnum] = alloc_page(GFP_KERNEL|__GFP_ZERO); in md_bitmap_storage_alloc()
1043 if (!store->filemap[pnum]) { in md_bitmap_storage_alloc()
1044 store->file_pages = pnum; in md_bitmap_storage_alloc()
1048 store->file_pages = pnum; in md_bitmap_storage_alloc()
1052 store->filemap_attr = kzalloc( in md_bitmap_storage_alloc()
1055 if (!store->filemap_attr) in md_bitmap_storage_alloc()
1058 store->bytes = bytes; in md_bitmap_storage_alloc()
1063 static void md_bitmap_file_unmap(struct bitmap_storage *store) in md_bitmap_file_unmap() argument
1065 struct file *file = store->file; in md_bitmap_file_unmap()
1066 struct page *sb_page = store->sb_page; in md_bitmap_file_unmap()
1067 struct page **map = store->filemap; in md_bitmap_file_unmap()
1068 int pages = store->file_pages; in md_bitmap_file_unmap()
1074 kfree(store->filemap_attr); in md_bitmap_file_unmap()
1150 struct bitmap_storage *store = &bitmap->storage; in md_bitmap_file_set_bit() local
1151 unsigned long index = file_page_index(store, chunk); in md_bitmap_file_set_bit()
1154 index += store->sb_index; in md_bitmap_file_set_bit()
1156 node_offset = bitmap->cluster_slot * store->file_pages; in md_bitmap_file_set_bit()
1181 struct bitmap_storage *store = &bitmap->storage; in md_bitmap_file_clear_bit() local
1182 unsigned long index = file_page_index(store, chunk); in md_bitmap_file_clear_bit()
1185 index += store->sb_index; in md_bitmap_file_clear_bit()
1187 node_offset = bitmap->cluster_slot * store->file_pages; in md_bitmap_file_clear_bit()
1321 struct bitmap_storage *store = &bitmap->storage; in md_bitmap_init_from_disk() local
1322 struct file *file = store->file; in md_bitmap_init_from_disk()
1330 store->filemap = NULL; in md_bitmap_init_from_disk()
1331 store->file_pages = 0; in md_bitmap_init_from_disk()
1343 if (file && i_size_read(file->f_mapping->host) < store->bytes) { in md_bitmap_init_from_disk()
1347 store->bytes); in md_bitmap_init_from_disk()
1353 node_offset = bitmap->cluster_slot * (DIV_ROUND_UP(store->bytes, PAGE_SIZE)); in md_bitmap_init_from_disk()
1355 for (i = 0; i < store->file_pages; i++) { in md_bitmap_init_from_disk()
1356 struct page *page = store->filemap[i]; in md_bitmap_init_from_disk()
1360 if (i == store->file_pages - 1) in md_bitmap_init_from_disk()
1361 count = store->bytes - i * PAGE_SIZE; in md_bitmap_init_from_disk()
1378 for (i = 0; i < store->file_pages; i++) { in md_bitmap_init_from_disk()
1379 struct page *page = store->filemap[i]; in md_bitmap_init_from_disk()
1427 bmname(bitmap), store->file_pages, in md_bitmap_init_from_disk()
2376 struct bitmap_storage store; in __bitmap_resize() local
2423 memset(&store, 0, sizeof(store)); in __bitmap_resize()
2425 ret = md_bitmap_storage_alloc(&store, chunks, in __bitmap_resize()
2430 md_bitmap_file_unmap(&store); in __bitmap_resize()
2439 md_bitmap_file_unmap(&store); in __bitmap_resize()
2446 store.file = bitmap->storage.file; in __bitmap_resize()
2449 if (store.sb_page && bitmap->storage.sb_page) in __bitmap_resize()
2450 memcpy(page_address(store.sb_page), in __bitmap_resize()
2455 bitmap->storage = store; in __bitmap_resize()