/** * destroy fld cache. */ void fld_cache_fini(struct fld_cache *cache) { LASSERT(cache != NULL); fld_cache_flush(cache); CDEBUG(D_INFO, "FLD cache statistics (%s):\n", cache->fci_name); CDEBUG(D_INFO, " Cache reqs: %llu\n", cache->fci_stat.fst_cache); CDEBUG(D_INFO, " Total reqs: %llu\n", cache->fci_stat.fst_count); OBD_FREE_PTR(cache); }
static ssize_t fld_proc_cache_flush_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos) { struct lu_client_fld *fld = file->private_data; LASSERT(fld != NULL); fld_cache_flush(fld->lcf_cache); CDEBUG(D_INFO, "%s: Lookup cache is flushed\n", fld->lcf_name); return count; }
/** * destroy fld cache. */ void fld_cache_fini(struct fld_cache *cache) { __u64 pct; LASSERT(cache); fld_cache_flush(cache); if (cache->fci_stat.fst_count > 0) { pct = cache->fci_stat.fst_cache * 100; do_div(pct, cache->fci_stat.fst_count); } else { pct = 0; } CDEBUG(D_INFO, "FLD cache statistics (%s):\n", cache->fci_name); CDEBUG(D_INFO, " Total reqs: %llu\n", cache->fci_stat.fst_count); CDEBUG(D_INFO, " Cache reqs: %llu\n", cache->fci_stat.fst_cache); CDEBUG(D_INFO, " Cache hits: %llu%%\n", pct); kfree(cache); }
/** * destroy fld cache. */ void fld_cache_fini(struct fld_cache *cache) { __u64 pct; ENTRY; LASSERT(cache != NULL); fld_cache_flush(cache); if (cache->fci_stat.fst_count > 0) { pct = cache->fci_stat.fst_cache * 100; do_div(pct, cache->fci_stat.fst_count); } else { pct = 0; } CDEBUG(D_INFO, "FLD cache statistics (%s):\n", cache->fci_name); CDEBUG(D_INFO, " Total reqs: "LPU64"\n", cache->fci_stat.fst_count); CDEBUG(D_INFO, " Cache reqs: "LPU64"\n", cache->fci_stat.fst_cache); CDEBUG(D_INFO, " Cache hits: "LPU64"%%\n", pct); OBD_FREE_PTR(cache); EXIT; }