mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 23:25:07 +00:00
[GFS2] Remove unused zero_readpage from stuffed_readpage
Stuffed files only consist of a maximum of (gfs2 block size - sizeof(struct gfs2_dinode)) bytes. Since the gfs2 block size is always less than page size, we will never see a call to stuffed_readpage for anything other than the first page in the file. Signed-off-by: Russell Cattelan <cattelan@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
This commit is contained in:
parent
7020933156
commit
61057c6bb3
1 changed files with 4 additions and 16 deletions
|
@ -156,19 +156,6 @@ static int gfs2_writepage(struct page *page, struct writeback_control *wbc)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zero_readpage(struct page *page)
|
|
||||||
{
|
|
||||||
void *kaddr;
|
|
||||||
|
|
||||||
kaddr = kmap_atomic(page, KM_USER0);
|
|
||||||
memset(kaddr, 0, PAGE_CACHE_SIZE);
|
|
||||||
kunmap_atomic(kaddr, KM_USER0);
|
|
||||||
|
|
||||||
SetPageUptodate(page);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stuffed_readpage - Fill in a Linux page with stuffed file data
|
* stuffed_readpage - Fill in a Linux page with stuffed file data
|
||||||
* @ip: the inode
|
* @ip: the inode
|
||||||
|
@ -183,9 +170,7 @@ static int stuffed_readpage(struct gfs2_inode *ip, struct page *page)
|
||||||
void *kaddr;
|
void *kaddr;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
/* Only the first page of a stuffed file might contain data */
|
BUG_ON(page->index);
|
||||||
if (unlikely(page->index))
|
|
||||||
return zero_readpage(page);
|
|
||||||
|
|
||||||
error = gfs2_meta_inode_buffer(ip, &dibh);
|
error = gfs2_meta_inode_buffer(ip, &dibh);
|
||||||
if (error)
|
if (error)
|
||||||
|
@ -737,6 +722,9 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask)
|
||||||
if (!atomic_read(&aspace->i_writecount))
|
if (!atomic_read(&aspace->i_writecount))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (!(gfp_mask & __GFP_WAIT))
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (time_after_eq(jiffies, t)) {
|
if (time_after_eq(jiffies, t)) {
|
||||||
stuck_releasepage(bh);
|
stuck_releasepage(bh);
|
||||||
/* should we withdraw here? */
|
/* should we withdraw here? */
|
||||||
|
|
Loading…
Reference in a new issue