aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell Cattelan <cattelan@redhat.com>2006-11-09 11:42:33 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-11-30 10:34:57 -0500
commit61057c6bb3a3d14cf2bea6ca20dc6d367e1d852e (patch)
tree731f4c13ae3dee3f90b78a3ec381c29064b9f548
parent7020933156ac2a8a7386314933e49948bf0438f7 (diff)
[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>
-rw-r--r--fs/gfs2/ops_address.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c
index 3822189454a3..2f7ef980d029 100644
--- a/fs/gfs2/ops_address.c
+++ b/fs/gfs2/ops_address.c
@@ -156,19 +156,6 @@ out_ignore:
156 return 0; 156 return 0;
157} 157}
158 158
159static 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
172/** 159/**
173 * stuffed_readpage - Fill in a Linux page with stuffed file data 160 * stuffed_readpage - Fill in a Linux page with stuffed file data
174 * @ip: the inode 161 * @ip: the inode
@@ -183,9 +170,7 @@ static int stuffed_readpage(struct gfs2_inode *ip, struct page *page)
183 void *kaddr; 170 void *kaddr;
184 int error; 171 int error;
185 172
186 /* Only the first page of a stuffed file might contain data */ 173 BUG_ON(page->index);
187 if (unlikely(page->index))
188 return zero_readpage(page);
189 174
190 error = gfs2_meta_inode_buffer(ip, &dibh); 175 error = gfs2_meta_inode_buffer(ip, &dibh);
191 if (error) 176 if (error)
@@ -737,6 +722,9 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask)
737 if (!atomic_read(&aspace->i_writecount)) 722 if (!atomic_read(&aspace->i_writecount))
738 return 0; 723 return 0;
739 724
725 if (!(gfp_mask & __GFP_WAIT))
726 return 0;
727
740 if (time_after_eq(jiffies, t)) { 728 if (time_after_eq(jiffies, t)) {
741 stuck_releasepage(bh); 729 stuck_releasepage(bh);
742 /* should we withdraw here? */ 730 /* should we withdraw here? */