LASSERT(io->ci_obj != NULL);
fio = &io->u.ci_fault;
- fio->ft_index = vma->vm_pgoff + index;
+ fio->ft_index = index;
fio->ft_writable = (vma->vm_flags&writable) == writable;
fio->ft_executable = vma->vm_flags&VM_EXEC;
int result;
ENTRY;
- pg_offset = (address - vma->vm_start) >> PAGE_SHIFT;
+ pg_offset = ((address - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
result = ll_fault_io_init(vma, &env, &nest, pg_offset, &ra_flags);
if (env == NULL)
return NOPAGE_SIGBUS;
ENTRY;
LASSERT(vma->vm_file);
- LASSERT(atomic_read(&vob->cob_mmap_cnt) >= 0);
- atomic_inc(&vob->cob_mmap_cnt);
+ LASSERT(cfs_atomic_read(&vob->cob_mmap_cnt) >= 0);
+ cfs_atomic_inc(&vob->cob_mmap_cnt);
EXIT;
}
ENTRY;
LASSERT(vma->vm_file);
- atomic_dec(&vob->cob_mmap_cnt);
- LASSERT(atomic_read(&vob->cob_mmap_cnt) >= 0);
+ cfs_atomic_dec(&vob->cob_mmap_cnt);
+ LASSERT(cfs_atomic_read(&vob->cob_mmap_cnt) >= 0);
EXIT;
}