aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-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? */