Lines Matching refs:page
31 static inline void dir_put_page(struct page *page) in dir_put_page() argument
33 kunmap(page); in dir_put_page()
34 put_page(page); in dir_put_page()
37 static int dir_commit_chunk(struct page *page, loff_t pos, unsigned len) in dir_commit_chunk() argument
39 struct address_space *mapping = page->mapping; in dir_commit_chunk()
43 block_write_end(NULL, mapping, pos, len, len, page, NULL); in dir_commit_chunk()
49 err = write_one_page(page); in dir_commit_chunk()
51 unlock_page(page); in dir_commit_chunk()
55 static struct page * dir_get_page(struct inode *dir, unsigned long n) in dir_get_page()
58 struct page *page = read_mapping_page(mapping, n, NULL); in dir_get_page() local
59 if (!IS_ERR(page)) in dir_get_page()
60 kmap(page); in dir_get_page()
61 return page; in dir_get_page()
83 struct page *page = dir_get_page(inode, n); in sysv_readdir() local
85 if (IS_ERR(page)) in sysv_readdir()
87 kaddr = (char *)page_address(page); in sysv_readdir()
99 dir_put_page(page); in sysv_readdir()
103 dir_put_page(page); in sysv_readdir()
127 struct sysv_dir_entry *sysv_find_entry(struct dentry *dentry, struct page **res_page) in sysv_find_entry()
134 struct page *page = NULL; in sysv_find_entry() local
146 page = dir_get_page(dir, n); in sysv_find_entry()
147 if (!IS_ERR(page)) { in sysv_find_entry()
148 kaddr = (char*)page_address(page); in sysv_find_entry()
158 dir_put_page(page); in sysv_find_entry()
169 *res_page = page; in sysv_find_entry()
178 struct page *page = NULL; in sysv_add_link() local
188 page = dir_get_page(dir, n); in sysv_add_link()
189 err = PTR_ERR(page); in sysv_add_link()
190 if (IS_ERR(page)) in sysv_add_link()
192 kaddr = (char*)page_address(page); in sysv_add_link()
203 dir_put_page(page); in sysv_add_link()
209 pos = page_offset(page) + in sysv_add_link()
210 (char*)de - (char*)page_address(page); in sysv_add_link()
211 lock_page(page); in sysv_add_link()
212 err = sysv_prepare_chunk(page, pos, SYSV_DIRSIZE); in sysv_add_link()
218 err = dir_commit_chunk(page, pos, SYSV_DIRSIZE); in sysv_add_link()
222 dir_put_page(page); in sysv_add_link()
226 unlock_page(page); in sysv_add_link()
230 int sysv_delete_entry(struct sysv_dir_entry *de, struct page *page) in sysv_delete_entry() argument
232 struct inode *inode = page->mapping->host; in sysv_delete_entry()
233 char *kaddr = (char*)page_address(page); in sysv_delete_entry()
234 loff_t pos = page_offset(page) + (char *)de - kaddr; in sysv_delete_entry()
237 lock_page(page); in sysv_delete_entry()
238 err = sysv_prepare_chunk(page, pos, SYSV_DIRSIZE); in sysv_delete_entry()
241 err = dir_commit_chunk(page, pos, SYSV_DIRSIZE); in sysv_delete_entry()
242 dir_put_page(page); in sysv_delete_entry()
250 struct page *page = grab_cache_page(inode->i_mapping, 0); in sysv_make_empty() local
255 if (!page) in sysv_make_empty()
257 err = sysv_prepare_chunk(page, 0, 2 * SYSV_DIRSIZE); in sysv_make_empty()
259 unlock_page(page); in sysv_make_empty()
262 kmap(page); in sysv_make_empty()
264 base = (char*)page_address(page); in sysv_make_empty()
274 kunmap(page); in sysv_make_empty()
275 err = dir_commit_chunk(page, 0, 2 * SYSV_DIRSIZE); in sysv_make_empty()
277 put_page(page); in sysv_make_empty()
287 struct page *page = NULL; in sysv_empty_dir() local
293 page = dir_get_page(inode, i); in sysv_empty_dir()
295 if (IS_ERR(page)) in sysv_empty_dir()
298 kaddr = (char *)page_address(page); in sysv_empty_dir()
317 dir_put_page(page); in sysv_empty_dir()
322 dir_put_page(page); in sysv_empty_dir()
327 void sysv_set_link(struct sysv_dir_entry *de, struct page *page, in sysv_set_link() argument
330 struct inode *dir = page->mapping->host; in sysv_set_link()
331 loff_t pos = page_offset(page) + in sysv_set_link()
332 (char *)de-(char*)page_address(page); in sysv_set_link()
335 lock_page(page); in sysv_set_link()
336 err = sysv_prepare_chunk(page, pos, SYSV_DIRSIZE); in sysv_set_link()
339 err = dir_commit_chunk(page, pos, SYSV_DIRSIZE); in sysv_set_link()
340 dir_put_page(page); in sysv_set_link()
345 struct sysv_dir_entry * sysv_dotdot (struct inode *dir, struct page **p) in sysv_dotdot()
347 struct page *page = dir_get_page(dir, 0); in sysv_dotdot() local
350 if (!IS_ERR(page)) { in sysv_dotdot()
351 de = (struct sysv_dir_entry*) page_address(page) + 1; in sysv_dotdot()
352 *p = page; in sysv_dotdot()
359 struct page *page; in sysv_inode_by_name() local
360 struct sysv_dir_entry *de = sysv_find_entry (dentry, &page); in sysv_inode_by_name()
365 dir_put_page(page); in sysv_inode_by_name()