/* Currently used to update mapped file statistics, but the routine can be generalized to update other statistics as well.  */
void mem_cgroup_update_file_mapped(struct page *page, int val)
/* Currently used to update mapped file statistics, but the routine can be generalized to update other statistics as well.  */
void mem_cgroup_update_file_mapped(struct page *page, int val)
{
	struct mem_cgroup *mem;
	struct mem_cgroup_stat *stat;
	struct mem_cgroup_stat_cpu *cpustat;
	int cpu;
	struct page_cgroup *pc;
	pc = lookup_page_cgroup(page);
	if (unlikely(!pc))
		return;
	lock_page_cgroup(pc);
	mem = pc->mem_cgroup;
	if (!mem)
		goto done;
	if (!PageCgroupUsed(pc))
		goto done;
	cpu = smp_processor_id();
	stat = &mem->stat;
	cpustat = &stat->cpustat[cpu];
	__mem_cgroup_stat_add_safe(cpustat, MEM_CGROUP_STAT_FILE_MAPPED, val);
done:
	unlock_page_cgroup(pc);
}