aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/page.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/page.c')
-rw-r--r--fs/gfs2/page.c60
1 files changed, 0 insertions, 60 deletions
diff --git a/fs/gfs2/page.c b/fs/gfs2/page.c
index b93caf294b9f..0d6befed1ae5 100644
--- a/fs/gfs2/page.c
+++ b/fs/gfs2/page.c
@@ -114,66 +114,6 @@ void gfs2_page_sync(struct gfs2_glock *gl, int flags)
114} 114}
115 115
116/** 116/**
117 * gfs2_unstuffer_page - unstuff a stuffed inode into a block cached by a page
118 * @ip: the inode
119 * @dibh: the dinode buffer
120 * @block: the block number that was allocated
121 * @private: any locked page held by the caller process
122 *
123 * Returns: errno
124 */
125
126int gfs2_unstuffer_page(struct gfs2_inode *ip, struct buffer_head *dibh,
127 uint64_t block, void *private)
128{
129 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
130 struct inode *inode = &ip->i_inode;
131 struct page *page = (struct page *)private;
132 struct buffer_head *bh;
133 int release = 0;
134
135 if (!page || page->index) {
136 page = grab_cache_page(inode->i_mapping, 0);
137 if (!page)
138 return -ENOMEM;
139 release = 1;
140 }
141
142 if (!PageUptodate(page)) {
143 void *kaddr = kmap(page);
144
145 memcpy(kaddr, dibh->b_data + sizeof(struct gfs2_dinode),
146 ip->i_di.di_size);
147 memset(kaddr + ip->i_di.di_size, 0,
148 PAGE_CACHE_SIZE - ip->i_di.di_size);
149 kunmap(page);
150
151 SetPageUptodate(page);
152 }
153
154 if (!page_has_buffers(page))
155 create_empty_buffers(page, 1 << inode->i_blkbits,
156 (1 << BH_Uptodate));
157
158 bh = page_buffers(page);
159
160 if (!buffer_mapped(bh))
161 map_bh(bh, inode->i_sb, block);
162
163 set_buffer_uptodate(bh);
164 if ((sdp->sd_args.ar_data == GFS2_DATA_ORDERED) || gfs2_is_jdata(ip))
165 gfs2_trans_add_bh(ip->i_gl, bh, 0);
166 mark_buffer_dirty(bh);
167
168 if (release) {
169 unlock_page(page);
170 page_cache_release(page);
171 }
172
173 return 0;
174}
175
176/**
177 * gfs2_block_truncate_page - Deal with zeroing out data for truncate 117 * gfs2_block_truncate_page - Deal with zeroing out data for truncate
178 * 118 *
179 * This is partly borrowed from ext3. 119 * This is partly borrowed from ext3.