struct mm_struct *mm = current->mm;
struct page *page;
int ret;
int offset;
void *maddr;

down_read(&mm->mmap_sem);
ret = get_user_pages(current, mm, start, 0, 1, &page, NULL);
up_read(&mm->mmap_sem);
if (ret <= 0)
  return -1;

offset = start & (PAGE_SIZE - 1);

maddr = kmap(page);
/*
  user's code
*/
kunmap(page);
page_cache_release(page);