page = kzalloc(sizeof(struct afs_pagecopy_page), GFP_NOFS);
INIT_LIST_HEAD(&page->tasklink);
- page_cache_get(cachepage);
+ get_page(cachepage);
page->cachepage = cachepage;
- page_cache_get(afspage);
+ get_page(afspage);
page->afspage = afspage;
spin_lock(&task->lock);
if (!schedule_work(&task->work))
atomic_dec(&task->refcnt);
} else if (!sleeppage) {
- page_cache_get(page->cachepage);
+ get_page(page->cachepage);
sleeppage = page->cachepage;
}
}
SetPageUptodate(page->afspage);
}
unlock_page(page->afspage);
- page_cache_release(page->cachepage);
- page_cache_release(page->afspage);
+ put_page(page->cachepage);
+ put_page(page->afspage);
kfree(page);
spin_lock(&task->lock);
sleeppage = afs_pagecopy_checkworkload();
if (sleeppage) {
wait_on_page_locked(sleeppage);
- page_cache_release(sleeppage);
+ put_page(sleeppage);
} else {
break;
}
/* If we're trying to read a page that's past the end of the disk
* cache file, then just return a zeroed page */
if (AFS_CHUNKOFFSET(offset) >= i_size_read(cacheinode)) {
- zero_user_segment(page, 0, PAGE_CACHE_SIZE);
+ zero_user_segment(page, 0, PAGE_SIZE);
SetPageUptodate(page);
if (task)
unlock_page(page);
/* From our offset, we now need to work out which page in the disk
* file it corresponds to. This will be fun ... */
- pageindex = (offset - AFS_CHUNKTOBASE(chunk)) >> PAGE_CACHE_SHIFT;
+ pageindex = (offset - AFS_CHUNKTOBASE(chunk)) >> PAGE_SHIFT;
while (cachepage == NULL) {
cachepage = find_get_page(cachemapping, pageindex);
cachepage = newpage;
newpage = NULL;
- page_cache_get(cachepage);
+ get_page(cachepage);
if (!pagevec_add(lrupv, cachepage))
__pagevec_lru_add_file(lrupv);
} else {
- page_cache_release(newpage);
+ put_page(newpage);
newpage = NULL;
if (code != -EEXIST)
goto out;
out:
if (cachepage)
- page_cache_release(cachepage);
+ put_page(cachepage);
return code;
}
/* If we allocate a page and don't remove it from page_list,
* the page cache gets upset. */
list_del(&pp->lru);
- isize = (i_size_read(fp->f_mapping->host) - 1) >> PAGE_CACHE_SHIFT;
+ isize = (i_size_read(fp->f_mapping->host) - 1) >> PAGE_SHIFT;
if(pp->index > isize) {
if(PageLocked(pp))
unlock_page(pp);
if(base_index != pp->index) {
if(PageLocked(pp))
unlock_page(pp);
- page_cache_release(pp);
+ put_page(pp);
iovecp[page_ix].iov_base = (void *) 0;
base_index++;
ancr->length -= PAGE_SIZE;
if(code) {
if(PageLocked(pp))
unlock_page(pp);
- page_cache_release(pp);
+ put_page(pp);
iovecp[page_ix].iov_base = (void *) 0;
} else {
page_count++;
* it as up to date.
*/
if (page_offset(pp) >= i_size_read(fp->f_mapping->host)) {
- zero_user_segment(pp, 0, PAGE_CACHE_SIZE);
+ zero_user_segment(pp, 0, PAGE_SIZE);
SetPageUptodate(pp);
unlock_page(pp);
return 0;
if (tdc && !add_to_page_cache(page, mapping, page->index,
GFP_KERNEL)) {
- page_cache_get(page);
+ get_page(page);
if (!pagevec_add(&lrupv, page))
__pagevec_lru_add_file(&lrupv);
afs_linux_read_cache(cacheFp, page, tdc->f.chunk, &lrupv, task);
}
- page_cache_release(page);
+ put_page(page);
}
if (pagevec_count(&lrupv))
__pagevec_lru_add_file(&lrupv);
struct inode *inode;
struct vcache *vcp;
cred_t *credp;
- unsigned int to = PAGE_CACHE_SIZE;
+ unsigned int to = PAGE_SIZE;
loff_t isize;
int code = 0;
int code1 = 0;
- page_cache_get(pp);
+ get_page(pp);
inode = mapping->host;
vcp = VTOAFS(inode);
done:
end_page_writeback(pp);
- page_cache_release(pp);
+ put_page(pp);
if (code1)
return code1;
/* Is the location we are writing to beyond the end of the file? */
if (pagebase >= isize ||
((from == 0) && (pagebase + to) >= isize)) {
- zero_user_segments(page, 0, from, to, PAGE_CACHE_SIZE);
+ zero_user_segments(page, 0, from, to, PAGE_SIZE);
SetPageChecked(page);
/* Are we we writing a full page */
- } else if (from == 0 && to == PAGE_CACHE_SIZE) {
+ } else if (from == 0 && to == PAGE_SIZE) {
SetPageChecked(page);
/* Is the page readable, if it's wronly, we don't care, because we're
* not actually going to read from it ... */
struct page *page, void *fsdata)
{
int code;
- unsigned int from = pos & (PAGE_CACHE_SIZE - 1);
+ unsigned int from = pos & (PAGE_SIZE - 1);
code = afs_linux_commit_write(file, page, from, from + len);
unlock_page(page);
- page_cache_release(page);
+ put_page(page);
return code;
}
struct page **pagep, void **fsdata)
{
struct page *page;
- pgoff_t index = pos >> PAGE_CACHE_SHIFT;
- unsigned int from = pos & (PAGE_CACHE_SIZE - 1);
+ pgoff_t index = pos >> PAGE_SHIFT;
+ unsigned int from = pos & (PAGE_SIZE - 1);
int code;
page = grab_cache_page_write_begin(mapping, index, flags);
code = afs_linux_prepare_write(file, page, from, from + len);
if (code) {
unlock_page(page);
- page_cache_release(page);
+ put_page(page);
}
return code;