Lines Matching refs:page
67 static inline void nilfs_put_page(struct page *page) in nilfs_put_page() argument
69 kunmap(page); in nilfs_put_page()
70 put_page(page); in nilfs_put_page()
87 static int nilfs_prepare_chunk(struct page *page, unsigned int from, in nilfs_prepare_chunk() argument
90 loff_t pos = page_offset(page) + from; in nilfs_prepare_chunk()
92 return __block_write_begin(page, pos, to - from, nilfs_get_block); in nilfs_prepare_chunk()
95 static void nilfs_commit_chunk(struct page *page, in nilfs_commit_chunk() argument
100 loff_t pos = page_offset(page) + from; in nilfs_commit_chunk()
105 nr_dirty = nilfs_page_count_clean_buffers(page, from, to); in nilfs_commit_chunk()
106 copied = block_write_end(NULL, mapping, pos, len, len, page, NULL); in nilfs_commit_chunk()
113 unlock_page(page); in nilfs_commit_chunk()
116 static bool nilfs_check_page(struct page *page) in nilfs_check_page() argument
118 struct inode *dir = page->mapping->host; in nilfs_check_page()
121 char *kaddr = page_address(page); in nilfs_check_page()
127 if ((dir->i_size >> PAGE_SHIFT) == page->index) { in nilfs_check_page()
150 SetPageChecked(page); in nilfs_check_page()
174 dir->i_ino, error, (page->index << PAGE_SHIFT) + offs, in nilfs_check_page()
182 dir->i_ino, (page->index << PAGE_SHIFT) + offs, in nilfs_check_page()
185 SetPageError(page); in nilfs_check_page()
189 static struct page *nilfs_get_page(struct inode *dir, unsigned long n) in nilfs_get_page()
192 struct page *page = read_mapping_page(mapping, n, NULL); in nilfs_get_page() local
194 if (!IS_ERR(page)) { in nilfs_get_page()
195 kmap(page); in nilfs_get_page()
196 if (unlikely(!PageChecked(page))) { in nilfs_get_page()
197 if (PageError(page) || !nilfs_check_page(page)) in nilfs_get_page()
201 return page; in nilfs_get_page()
204 nilfs_put_page(page); in nilfs_get_page()
278 struct page *page = nilfs_get_page(inode, n); in nilfs_readdir() local
280 if (IS_ERR(page)) { in nilfs_readdir()
285 kaddr = page_address(page); in nilfs_readdir()
292 nilfs_put_page(page); in nilfs_readdir()
305 nilfs_put_page(page); in nilfs_readdir()
311 nilfs_put_page(page); in nilfs_readdir()
326 struct page **res_page) in nilfs_find_entry()
333 struct page *page = NULL; in nilfs_find_entry() local
350 page = nilfs_get_page(dir, n); in nilfs_find_entry()
351 if (!IS_ERR(page)) { in nilfs_find_entry()
352 kaddr = page_address(page); in nilfs_find_entry()
359 nilfs_put_page(page); in nilfs_find_entry()
366 nilfs_put_page(page); in nilfs_find_entry()
383 *res_page = page; in nilfs_find_entry()
388 struct nilfs_dir_entry *nilfs_dotdot(struct inode *dir, struct page **p) in nilfs_dotdot()
390 struct page *page = nilfs_get_page(dir, 0); in nilfs_dotdot() local
393 if (!IS_ERR(page)) { in nilfs_dotdot()
395 (struct nilfs_dir_entry *)page_address(page)); in nilfs_dotdot()
396 *p = page; in nilfs_dotdot()
405 struct page *page; in nilfs_inode_by_name() local
407 de = nilfs_find_entry(dir, qstr, &page); in nilfs_inode_by_name()
410 kunmap(page); in nilfs_inode_by_name()
411 put_page(page); in nilfs_inode_by_name()
418 struct page *page, struct inode *inode) in nilfs_set_link() argument
420 unsigned int from = (char *)de - (char *)page_address(page); in nilfs_set_link()
422 struct address_space *mapping = page->mapping; in nilfs_set_link()
425 lock_page(page); in nilfs_set_link()
426 err = nilfs_prepare_chunk(page, from, to); in nilfs_set_link()
430 nilfs_commit_chunk(page, mapping, from, to); in nilfs_set_link()
431 nilfs_put_page(page); in nilfs_set_link()
446 struct page *page = NULL; in nilfs_add_link() local
462 page = nilfs_get_page(dir, n); in nilfs_add_link()
463 err = PTR_ERR(page); in nilfs_add_link()
464 if (IS_ERR(page)) in nilfs_add_link()
466 lock_page(page); in nilfs_add_link()
467 kaddr = page_address(page); in nilfs_add_link()
497 unlock_page(page); in nilfs_add_link()
498 nilfs_put_page(page); in nilfs_add_link()
504 from = (char *)de - (char *)page_address(page); in nilfs_add_link()
506 err = nilfs_prepare_chunk(page, from, to); in nilfs_add_link()
521 nilfs_commit_chunk(page, page->mapping, from, to); in nilfs_add_link()
526 nilfs_put_page(page); in nilfs_add_link()
530 unlock_page(page); in nilfs_add_link()
538 int nilfs_delete_entry(struct nilfs_dir_entry *dir, struct page *page) in nilfs_delete_entry() argument
540 struct address_space *mapping = page->mapping; in nilfs_delete_entry()
542 char *kaddr = page_address(page); in nilfs_delete_entry()
562 from = (char *)pde - (char *)page_address(page); in nilfs_delete_entry()
563 lock_page(page); in nilfs_delete_entry()
564 err = nilfs_prepare_chunk(page, from, to); in nilfs_delete_entry()
569 nilfs_commit_chunk(page, mapping, from, to); in nilfs_delete_entry()
572 nilfs_put_page(page); in nilfs_delete_entry()
582 struct page *page = grab_cache_page(mapping, 0); in nilfs_make_empty() local
588 if (!page) in nilfs_make_empty()
591 err = nilfs_prepare_chunk(page, 0, chunk_size); in nilfs_make_empty()
593 unlock_page(page); in nilfs_make_empty()
596 kaddr = kmap_atomic(page); in nilfs_make_empty()
612 nilfs_commit_chunk(page, mapping, 0, chunk_size); in nilfs_make_empty()
614 put_page(page); in nilfs_make_empty()
623 struct page *page = NULL; in nilfs_empty_dir() local
630 page = nilfs_get_page(inode, i); in nilfs_empty_dir()
631 if (IS_ERR(page)) in nilfs_empty_dir()
634 kaddr = page_address(page); in nilfs_empty_dir()
660 nilfs_put_page(page); in nilfs_empty_dir()
665 nilfs_put_page(page); in nilfs_empty_dir()