Lines Matching refs:page
39 static inline void ext2_put_page(struct page *page) in ext2_put_page() argument
41 kunmap(page); in ext2_put_page()
42 page_cache_release(page); in ext2_put_page()
50 static int ext2_commit_chunk(struct page *page, unsigned from, unsigned to) in ext2_commit_chunk() argument
52 struct inode *dir = page->mapping->host; in ext2_commit_chunk()
55 page->mapping->a_ops->commit_write(NULL, page, from, to); in ext2_commit_chunk()
58 err = writeout_one_page(page); in ext2_commit_chunk()
59 err2 = waitfor_one_page(page); in ext2_commit_chunk()
66 static void ext2_check_page(struct page *page, int quiet) in ext2_check_page() argument
68 struct inode *dir = page->mapping->host; in ext2_check_page()
71 char *kaddr = page_address(page); in ext2_check_page()
78 if ((dir->i_size >> PAGE_CACHE_SHIFT) == page->index) { in ext2_check_page()
107 SetPageChecked(page); in ext2_check_page()
136 dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT)+offs, in ext2_check_page()
146 dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs, in ext2_check_page()
150 SetPageChecked(page); in ext2_check_page()
151 SetPageError(page); in ext2_check_page()
154 static struct page * ext2_get_page(struct inode *dir, unsigned long n, in ext2_get_page()
158 struct page *page = read_cache_page(mapping, n, in ext2_get_page() local
160 if (!IS_ERR(page)) { in ext2_get_page()
161 wait_on_page(page); in ext2_get_page()
162 kmap(page); in ext2_get_page()
163 if (!Page_Uptodate(page)) in ext2_get_page()
165 if (!PageChecked(page)) in ext2_get_page()
166 ext2_check_page(page, quiet); in ext2_get_page()
167 if (PageError(page)) in ext2_get_page()
170 return page; in ext2_get_page()
173 ext2_put_page(page); in ext2_get_page()
264 struct page *page = ext2_get_page(inode, n, 0); in ext2_readdir() local
266 if (IS_ERR(page)) { in ext2_readdir()
274 kaddr = page_address(page); in ext2_readdir()
294 ext2_put_page(page); in ext2_readdir()
300 ext2_put_page(page); in ext2_readdir()
318 struct dentry *dentry, struct page ** res_page) in ext2_find_entry()
325 struct page *page = NULL; in ext2_find_entry() local
338 page = ext2_get_page(dir, n, dir_has_error); in ext2_find_entry()
339 if (!IS_ERR(page)) { in ext2_find_entry()
340 kaddr = page_address(page); in ext2_find_entry()
348 ext2_put_page(page); in ext2_find_entry()
367 *res_page = page; in ext2_find_entry()
372 struct ext2_dir_entry_2 * ext2_dotdot (struct inode *dir, struct page **p) in ext2_dotdot()
374 struct page *page = ext2_get_page(dir, 0, 0); in ext2_dotdot() local
377 if (!IS_ERR(page)) { in ext2_dotdot()
378 de = ext2_next_entry((ext2_dirent *) page_address(page)); in ext2_dotdot()
379 *p = page; in ext2_dotdot()
388 struct page *page; in ext2_inode_by_name() local
390 de = ext2_find_entry (dir, dentry, &page); in ext2_inode_by_name()
393 kunmap(page); in ext2_inode_by_name()
394 page_cache_release(page); in ext2_inode_by_name()
401 struct page *page, struct inode *inode) in ext2_set_link() argument
403 unsigned from = (char *) de - (char *) page_address(page); in ext2_set_link()
407 lock_page(page); in ext2_set_link()
408 err = page->mapping->a_ops->prepare_write(NULL, page, from, to); in ext2_set_link()
413 err = ext2_commit_chunk(page, from, to); in ext2_set_link()
414 UnlockPage(page); in ext2_set_link()
415 ext2_put_page(page); in ext2_set_link()
431 struct page *page = NULL; in ext2_add_link() local
441 page = ext2_get_page(dir, n, 0); in ext2_add_link()
442 err = PTR_ERR(page); in ext2_add_link()
443 if (IS_ERR(page)) in ext2_add_link()
445 kaddr = page_address(page); in ext2_add_link()
460 ext2_put_page(page); in ext2_add_link()
466 from = (char*)de - (char*)page_address(page); in ext2_add_link()
468 lock_page(page); in ext2_add_link()
469 err = page->mapping->a_ops->prepare_write(NULL, page, from, to); in ext2_add_link()
482 err = ext2_commit_chunk(page, from, to); in ext2_add_link()
488 UnlockPage(page); in ext2_add_link()
490 ext2_put_page(page); in ext2_add_link()
499 int ext2_delete_entry (struct ext2_dir_entry_2 * dir, struct page * page ) in ext2_delete_entry() argument
501 struct address_space *mapping = page->mapping; in ext2_delete_entry()
503 char *kaddr = page_address(page); in ext2_delete_entry()
515 from = (char*)pde - (char*)page_address(page); in ext2_delete_entry()
516 lock_page(page); in ext2_delete_entry()
517 err = mapping->a_ops->prepare_write(NULL, page, from, to); in ext2_delete_entry()
523 err = ext2_commit_chunk(page, from, to); in ext2_delete_entry()
524 UnlockPage(page); in ext2_delete_entry()
525 ext2_put_page(page); in ext2_delete_entry()
538 struct page *page = grab_cache_page(mapping, 0); in ext2_make_empty() local
544 if (!page) in ext2_make_empty()
546 err = mapping->a_ops->prepare_write(NULL, page, 0, chunk_size); in ext2_make_empty()
550 base = page_address(page); in ext2_make_empty()
567 err = ext2_commit_chunk(page, 0, chunk_size); in ext2_make_empty()
569 UnlockPage(page); in ext2_make_empty()
570 page_cache_release(page); in ext2_make_empty()
579 struct page *page = NULL; in ext2_empty_dir() local
586 page = ext2_get_page(inode, i, dir_has_error); in ext2_empty_dir()
588 if (IS_ERR(page)) { in ext2_empty_dir()
593 kaddr = page_address(page); in ext2_empty_dir()
613 ext2_put_page(page); in ext2_empty_dir()
618 ext2_put_page(page); in ext2_empty_dir()