Lines Matching refs:store

430 	struct bitmap_storage *store = &bitmap->storage;  in __write_sb_page()  local
441 if ((pg_index - store->sb_index) == num_pages - 1) { in __write_sb_page()
442 unsigned int last_page_size = store->bytes & (PAGE_SIZE - 1); in __write_sb_page()
639 struct bitmap_storage *store = &bitmap->storage; in filemap_write_page() local
640 struct page *page = store->filemap[pg_index]; in filemap_write_page()
644 pg_index += store->sb_index; in filemap_write_page()
647 if (store->file) in filemap_write_page()
981 static inline unsigned long file_page_index(struct bitmap_storage *store, in file_page_index() argument
984 if (store->sb_page) in file_page_index()
990 static inline unsigned long file_page_offset(struct bitmap_storage *store, in file_page_offset() argument
993 if (store->sb_page) in file_page_offset()
1002 static inline struct page *filemap_get_page(struct bitmap_storage *store, in filemap_get_page() argument
1005 if (file_page_index(store, chunk) >= store->file_pages) in filemap_get_page()
1007 return store->filemap[file_page_index(store, chunk)]; in filemap_get_page()
1010 static int md_bitmap_storage_alloc(struct bitmap_storage *store, in md_bitmap_storage_alloc() argument
1025 store->filemap = kmalloc_array(num_pages, sizeof(struct page *), in md_bitmap_storage_alloc()
1027 if (!store->filemap) in md_bitmap_storage_alloc()
1030 if (with_super && !store->sb_page) { in md_bitmap_storage_alloc()
1031 store->sb_page = alloc_page(GFP_KERNEL|__GFP_ZERO); in md_bitmap_storage_alloc()
1032 if (store->sb_page == NULL) in md_bitmap_storage_alloc()
1037 if (store->sb_page) { in md_bitmap_storage_alloc()
1038 store->filemap[0] = store->sb_page; in md_bitmap_storage_alloc()
1040 store->sb_index = offset; in md_bitmap_storage_alloc()
1044 store->filemap[pnum] = alloc_page(GFP_KERNEL|__GFP_ZERO); in md_bitmap_storage_alloc()
1045 if (!store->filemap[pnum]) { in md_bitmap_storage_alloc()
1046 store->file_pages = pnum; in md_bitmap_storage_alloc()
1050 store->file_pages = pnum; in md_bitmap_storage_alloc()
1054 store->filemap_attr = kzalloc( in md_bitmap_storage_alloc()
1057 if (!store->filemap_attr) in md_bitmap_storage_alloc()
1060 store->bytes = bytes; in md_bitmap_storage_alloc()
1065 static void md_bitmap_file_unmap(struct bitmap_storage *store) in md_bitmap_file_unmap() argument
1067 struct file *file = store->file; in md_bitmap_file_unmap()
1068 struct page *sb_page = store->sb_page; in md_bitmap_file_unmap()
1069 struct page **map = store->filemap; in md_bitmap_file_unmap()
1070 int pages = store->file_pages; in md_bitmap_file_unmap()
1076 kfree(store->filemap_attr); in md_bitmap_file_unmap()
1152 struct bitmap_storage *store = &bitmap->storage; in md_bitmap_file_set_bit() local
1153 unsigned long index = file_page_index(store, chunk); in md_bitmap_file_set_bit()
1156 index += store->sb_index; in md_bitmap_file_set_bit()
1158 node_offset = bitmap->cluster_slot * store->file_pages; in md_bitmap_file_set_bit()
1183 struct bitmap_storage *store = &bitmap->storage; in md_bitmap_file_clear_bit() local
1184 unsigned long index = file_page_index(store, chunk); in md_bitmap_file_clear_bit()
1187 index += store->sb_index; in md_bitmap_file_clear_bit()
1189 node_offset = bitmap->cluster_slot * store->file_pages; in md_bitmap_file_clear_bit()
1324 struct bitmap_storage *store = &bitmap->storage; in md_bitmap_init_from_disk() local
1325 struct file *file = store->file; in md_bitmap_init_from_disk()
1333 store->filemap = NULL; in md_bitmap_init_from_disk()
1334 store->file_pages = 0; in md_bitmap_init_from_disk()
1346 if (file && i_size_read(file->f_mapping->host) < store->bytes) { in md_bitmap_init_from_disk()
1350 store->bytes); in md_bitmap_init_from_disk()
1356 node_offset = bitmap->cluster_slot * (DIV_ROUND_UP(store->bytes, PAGE_SIZE)); in md_bitmap_init_from_disk()
1358 for (i = 0; i < store->file_pages; i++) { in md_bitmap_init_from_disk()
1359 struct page *page = store->filemap[i]; in md_bitmap_init_from_disk()
1363 if (i == store->file_pages - 1) in md_bitmap_init_from_disk()
1364 count = store->bytes - i * PAGE_SIZE; in md_bitmap_init_from_disk()
1381 for (i = 0; i < store->file_pages; i++) { in md_bitmap_init_from_disk()
1382 struct page *page = store->filemap[i]; in md_bitmap_init_from_disk()
1430 bmname(bitmap), store->file_pages, in md_bitmap_init_from_disk()
2394 struct bitmap_storage store; in __bitmap_resize() local
2441 memset(&store, 0, sizeof(store)); in __bitmap_resize()
2443 ret = md_bitmap_storage_alloc(&store, chunks, in __bitmap_resize()
2448 md_bitmap_file_unmap(&store); in __bitmap_resize()
2457 md_bitmap_file_unmap(&store); in __bitmap_resize()
2464 store.file = bitmap->storage.file; in __bitmap_resize()
2467 if (store.sb_page && bitmap->storage.sb_page) in __bitmap_resize()
2468 memcpy(page_address(store.sb_page), in __bitmap_resize()
2473 bitmap->storage = store; in __bitmap_resize()