Skip to content

Commit 61057c6

Browse files
Russell Cattelanswhiteho
authored andcommitted
[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>
1 parent 7020933 commit 61057c6

1 file changed

Lines changed: 4 additions & 16 deletions

File tree

‎fs/gfs2/ops_address.c‎

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,6 @@ static int gfs2_writepage(struct page *page, struct writeback_control *wbc)
156156
return 0;
157157
}
158158

159-
static int zero_readpage(struct page *page)
160-
{
161-
void *kaddr;
162-
163-
kaddr = kmap_atomic(page, KM_USER0);
164-
memset(kaddr, 0, PAGE_CACHE_SIZE);
165-
kunmap_atomic(kaddr, KM_USER0);
166-
167-
SetPageUptodate(page);
168-
169-
return 0;
170-
}
171-
172159
/**
173160
* stuffed_readpage - Fill in a Linux page with stuffed file data
174161
* @ip: the inode
@@ -183,9 +170,7 @@ static int stuffed_readpage(struct gfs2_inode *ip, struct page *page)
183170
void *kaddr;
184171
int error;
185172

186-
/* Only the first page of a stuffed file might contain data */
187-
if (unlikely(page->index))
188-
return zero_readpage(page);
173+
BUG_ON(page->index);
189174

190175
error = gfs2_meta_inode_buffer(ip, &dibh);
191176
if (error)
@@ -737,6 +722,9 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask)
737722
if (!atomic_read(&aspace->i_writecount))
738723
return 0;
739724

725+
if (!(gfp_mask & __GFP_WAIT))
726+
return 0;
727+
740728
if (time_after_eq(jiffies, t)) {
741729
stuck_releasepage(bh);
742730
/* should we withdraw here? */

0 commit comments

Comments
 (0)