diff options
Diffstat (limited to 'fs/gfs2/dir.c')
-rw-r--r-- | fs/gfs2/dir.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 459498cac93b..e24af28b1a12 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c | |||
@@ -184,7 +184,7 @@ static int gfs2_dir_write_data(struct gfs2_inode *ip, const char *buf, | |||
184 | while (copied < size) { | 184 | while (copied < size) { |
185 | unsigned int amount; | 185 | unsigned int amount; |
186 | struct buffer_head *bh; | 186 | struct buffer_head *bh; |
187 | int new; | 187 | int new = 0; |
188 | 188 | ||
189 | amount = size - copied; | 189 | amount = size - copied; |
190 | if (amount > sdp->sd_sb.sb_bsize - o) | 190 | if (amount > sdp->sd_sb.sb_bsize - o) |
@@ -212,8 +212,6 @@ static int gfs2_dir_write_data(struct gfs2_inode *ip, const char *buf, | |||
212 | gfs2_trans_add_bh(ip->i_gl, bh, 1); | 212 | gfs2_trans_add_bh(ip->i_gl, bh, 1); |
213 | memcpy(bh->b_data + o, buf, amount); | 213 | memcpy(bh->b_data + o, buf, amount); |
214 | brelse(bh); | 214 | brelse(bh); |
215 | if (error) | ||
216 | goto fail; | ||
217 | 215 | ||
218 | buf += amount; | 216 | buf += amount; |
219 | copied += amount; | 217 | copied += amount; |
@@ -317,8 +315,7 @@ static int gfs2_dir_read_data(struct gfs2_inode *ip, char *buf, u64 offset, | |||
317 | if (!ra) | 315 | if (!ra) |
318 | extlen = 1; | 316 | extlen = 1; |
319 | bh = gfs2_meta_ra(ip->i_gl, dblock, extlen); | 317 | bh = gfs2_meta_ra(ip->i_gl, dblock, extlen); |
320 | } | 318 | } else { |
321 | if (!bh) { | ||
322 | error = gfs2_meta_read(ip->i_gl, dblock, DIO_WAIT, &bh); | 319 | error = gfs2_meta_read(ip->i_gl, dblock, DIO_WAIT, &bh); |
323 | if (error) | 320 | if (error) |
324 | goto fail; | 321 | goto fail; |
@@ -332,7 +329,6 @@ static int gfs2_dir_read_data(struct gfs2_inode *ip, char *buf, u64 offset, | |||
332 | extlen--; | 329 | extlen--; |
333 | memcpy(buf, bh->b_data + o, amount); | 330 | memcpy(buf, bh->b_data + o, amount); |
334 | brelse(bh); | 331 | brelse(bh); |
335 | bh = NULL; | ||
336 | buf += amount; | 332 | buf += amount; |
337 | copied += amount; | 333 | copied += amount; |
338 | lblock++; | 334 | lblock++; |
@@ -815,7 +811,7 @@ static struct gfs2_leaf *new_leaf(struct inode *inode, struct buffer_head **pbh, | |||
815 | leaf = (struct gfs2_leaf *)bh->b_data; | 811 | leaf = (struct gfs2_leaf *)bh->b_data; |
816 | leaf->lf_depth = cpu_to_be16(depth); | 812 | leaf->lf_depth = cpu_to_be16(depth); |
817 | leaf->lf_entries = 0; | 813 | leaf->lf_entries = 0; |
818 | leaf->lf_dirent_format = cpu_to_be16(GFS2_FORMAT_DE); | 814 | leaf->lf_dirent_format = cpu_to_be32(GFS2_FORMAT_DE); |
819 | leaf->lf_next = 0; | 815 | leaf->lf_next = 0; |
820 | memset(leaf->lf_reserved, 0, sizeof(leaf->lf_reserved)); | 816 | memset(leaf->lf_reserved, 0, sizeof(leaf->lf_reserved)); |
821 | dent = (struct gfs2_dirent *)(leaf+1); | 817 | dent = (struct gfs2_dirent *)(leaf+1); |