Lines Matching refs:page
23 static inline void dir_put_page(struct page *page) in dir_put_page() argument
25 kunmap(page); in dir_put_page()
26 page_cache_release(page); in dir_put_page()
34 static int dir_commit_chunk(struct page *page, unsigned from, unsigned to) in dir_commit_chunk() argument
36 struct inode *dir = (struct inode *)page->mapping->host; in dir_commit_chunk()
38 page->mapping->a_ops->commit_write(NULL, page, from, to); in dir_commit_chunk()
41 err = writeout_one_page(page); in dir_commit_chunk()
42 err2 = waitfor_one_page(page); in dir_commit_chunk()
49 static struct page * dir_get_page(struct inode *dir, unsigned long n) in dir_get_page()
52 struct page *page = read_cache_page(mapping, n, in dir_get_page() local
54 if (!IS_ERR(page)) { in dir_get_page()
55 wait_on_page(page); in dir_get_page()
56 kmap(page); in dir_get_page()
57 if (!Page_Uptodate(page)) in dir_get_page()
60 return page; in dir_get_page()
63 dir_put_page(page); in dir_get_page()
89 struct page *page = dir_get_page(inode, n); in minix_readdir() local
91 if (IS_ERR(page)) in minix_readdir()
93 kaddr = (char *)page_address(page); in minix_readdir()
107 dir_put_page(page); in minix_readdir()
112 dir_put_page(page); in minix_readdir()
137 minix_dirent *minix_find_entry(struct dentry *dentry, struct page **res_page) in minix_find_entry()
146 struct page *page = NULL; in minix_find_entry() local
153 page = dir_get_page(dir, n); in minix_find_entry()
154 if (IS_ERR(page)) in minix_find_entry()
157 kaddr = (char*)page_address(page); in minix_find_entry()
166 dir_put_page(page); in minix_find_entry()
171 *res_page = page; in minix_find_entry()
182 struct page *page = NULL; in minix_add_link() local
192 page = dir_get_page(dir, n); in minix_add_link()
193 err = PTR_ERR(page); in minix_add_link()
194 if (IS_ERR(page)) in minix_add_link()
196 kaddr = (char*)page_address(page); in minix_add_link()
207 dir_put_page(page); in minix_add_link()
213 from = (char*)de - (char*)page_address(page); in minix_add_link()
215 lock_page(page); in minix_add_link()
216 err = page->mapping->a_ops->prepare_write(NULL, page, from, to); in minix_add_link()
222 err = dir_commit_chunk(page, from, to); in minix_add_link()
226 UnlockPage(page); in minix_add_link()
228 dir_put_page(page); in minix_add_link()
233 int minix_delete_entry(struct minix_dir_entry *de, struct page *page) in minix_delete_entry() argument
235 struct address_space *mapping = page->mapping; in minix_delete_entry()
237 char *kaddr = (char*)page_address(page); in minix_delete_entry()
242 lock_page(page); in minix_delete_entry()
243 err = mapping->a_ops->prepare_write(NULL, page, from, to); in minix_delete_entry()
246 err = dir_commit_chunk(page, from, to); in minix_delete_entry()
248 UnlockPage(page); in minix_delete_entry()
249 dir_put_page(page); in minix_delete_entry()
258 struct page *page = grab_cache_page(mapping, 0); in minix_make_empty() local
264 if (!page) in minix_make_empty()
266 err = mapping->a_ops->prepare_write(NULL, page, 0, 2 * sbi->s_dirsize); in minix_make_empty()
270 base = (char*)page_address(page); in minix_make_empty()
280 err = dir_commit_chunk(page, 0, 2 * sbi->s_dirsize); in minix_make_empty()
282 UnlockPage(page); in minix_make_empty()
283 page_cache_release(page); in minix_make_empty()
292 struct page *page = NULL; in minix_empty_dir() local
299 page = dir_get_page(inode, i); in minix_empty_dir()
301 if (IS_ERR(page)) in minix_empty_dir()
304 kaddr = (char *)page_address(page); in minix_empty_dir()
323 dir_put_page(page); in minix_empty_dir()
328 dir_put_page(page); in minix_empty_dir()
333 void minix_set_link(struct minix_dir_entry *de, struct page *page, in minix_set_link() argument
336 struct inode *dir = (struct inode*)page->mapping->host; in minix_set_link()
338 unsigned from = (char *)de-(char*)page_address(page); in minix_set_link()
342 lock_page(page); in minix_set_link()
343 err = page->mapping->a_ops->prepare_write(NULL, page, from, to); in minix_set_link()
346 err = dir_commit_chunk(page, from, to); in minix_set_link()
348 UnlockPage(page); in minix_set_link()
349 dir_put_page(page); in minix_set_link()
354 struct minix_dir_entry * minix_dotdot (struct inode *dir, struct page **p) in minix_dotdot()
356 struct page *page = dir_get_page(dir, 0); in minix_dotdot() local
360 if (!IS_ERR(page)) { in minix_dotdot()
361 de = minix_next_entry(page_address(page), sbi); in minix_dotdot()
362 *p = page; in minix_dotdot()
369 struct page *page; in minix_inode_by_name() local
370 struct minix_dir_entry *de = minix_find_entry(dentry, &page); in minix_inode_by_name()
375 dir_put_page(page); in minix_inode_by_name()