Lines Matching refs:n_blocks
74 __le64 n_blocks; member
153 size_t n_blocks; member
960 wc->entries = vmalloc(array_size(sizeof(struct wc_entry), wc->n_blocks)); in writecache_alloc_entries()
963 for (b = 0; b < wc->n_blocks; b++) { in writecache_alloc_entries()
1034 for (b = 0; b < wc->n_blocks; b++) { in writecache_resume()
1056 for (b = 0; b < wc->n_blocks; b++) { in writecache_resume()
1152 wc->freelist_high_watermark = wc->n_blocks; in activate_cleaner()
1153 wc->freelist_low_watermark = wc->n_blocks; in activate_cleaner()
2098 uint64_t n_blocks, offset; in calculate_memory_size() local
2101 n_blocks = device_size; in calculate_memory_size()
2102 do_div(n_blocks, block_size + sizeof(struct wc_memory_entry)); in calculate_memory_size()
2105 if (!n_blocks) in calculate_memory_size()
2108 if (n_blocks >= ((size_t)-sizeof(struct wc_memory_superblock) / in calculate_memory_size()
2111 offset = offsetof(struct wc_memory_superblock, entries[n_blocks]); in calculate_memory_size()
2113 if (offset + n_blocks * block_size <= device_size) in calculate_memory_size()
2115 n_blocks--; in calculate_memory_size()
2119 e.index = n_blocks; in calculate_memory_size()
2120 if (e.index != n_blocks) in calculate_memory_size()
2124 *n_blocks_p = n_blocks; in calculate_memory_size()
2135 r = calculate_memory_size(wc->memory_map_size, wc->block_size, &wc->n_blocks, NULL); in init_memory()
2147 pmem_assign(sb(wc)->n_blocks, cpu_to_le64(wc->n_blocks)); in init_memory()
2150 for (b = 0; b < wc->n_blocks; b++) { in init_memory()
2495 size_t n_blocks, n_metadata_blocks; in writecache_ctr() local
2510 &n_blocks, &n_metadata_blocks); in writecache_ctr()
2594 wc->n_blocks = le64_to_cpu(s.n_blocks); in writecache_ctr()
2596 offset = wc->n_blocks * sizeof(struct wc_memory_entry); in writecache_ctr()
2597 if (offset / sizeof(struct wc_memory_entry) != le64_to_cpu(sb(wc)->n_blocks)) { in writecache_ctr()
2607 data_size = wc->n_blocks * (size_t)wc->block_size; in writecache_ctr()
2608 if (!offset || (data_size / wc->block_size != wc->n_blocks) || in writecache_ctr()
2620 x = (uint64_t)wc->n_blocks * (100 - high_wm_percent); in writecache_ctr()
2624 x = (uint64_t)wc->n_blocks * (100 - low_wm_percent); in writecache_ctr()
2666 (unsigned long long)wc->n_blocks, (unsigned long long)wc->freelist_size, in writecache_status()