Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38651
b: refs/heads/master
c: f4154ea
h: refs/heads/master
i:
  38649: 7648edc
  38647: 9c14369
v: v3
  • Loading branch information
Steven Whitehouse committed Apr 11, 2006
1 parent d26ef76 commit 5bf1271
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ed3865079b573ef55dc13ab0bfb242ed5ebab4c1
refs/heads/master: f4154ea039bbf45c52840b30c68143a2dc28d4b4
8 changes: 2 additions & 6 deletions trunk/fs/gfs2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,9 +776,9 @@ static struct gfs2_dirent *gfs2_dirent_search(struct inode *inode,
goto got_dent;
leaf = (struct gfs2_leaf *)bh->b_data;
ln = be64_to_cpu(leaf->lf_next);
brelse(bh);
if (!ln)
break;
brelse(bh);
error = get_leaf(ip, ln, &bh);
} while(!error);

Expand All @@ -790,7 +790,7 @@ static struct gfs2_dirent *gfs2_dirent_search(struct inode *inode,
return ERR_PTR(error);
dent = gfs2_dirent_scan(inode, bh->b_data, bh->b_size, scan, name, NULL);
got_dent:
if (unlikely(IS_ERR(dent))) {
if (unlikely(dent == NULL || IS_ERR(dent))) {
brelse(bh);
bh = NULL;
}
Expand Down Expand Up @@ -1477,7 +1477,6 @@ int gfs2_dir_search(struct inode *dir, const struct qstr *name,
brelse(bh);
return 0;
}
brelse(bh);
return -ENOENT;
}

Expand Down Expand Up @@ -1619,7 +1618,6 @@ int gfs2_dir_del(struct gfs2_inode *dip, const struct qstr *name)
previous entry otherwise */
dent = gfs2_dirent_search(dip->i_vnode, name, gfs2_dirent_prev, &bh);
if (!dent) {
brelse(bh);
gfs2_consist_inode(dip);
return -EIO;
}
Expand Down Expand Up @@ -1680,7 +1678,6 @@ int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename,

dent = gfs2_dirent_search(dip->i_vnode, filename, gfs2_dirent_find, &bh);
if (!dent) {
brelse(bh);
gfs2_consist_inode(dip);
return -EIO;
}
Expand Down Expand Up @@ -1961,7 +1958,6 @@ int gfs2_diradd_alloc_required(struct inode *inode,

dent = gfs2_dirent_search(inode, name, gfs2_dirent_find_space, &bh);
if (!dent) {
brelse(bh);
return 1;
}
if (IS_ERR(dent))
Expand Down
10 changes: 7 additions & 3 deletions trunk/fs/gfs2/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,13 @@ static void log_flush_commit(struct gfs2_sbd *sdp)
struct list_head *head = &sdp->sd_log_flush_list;
struct gfs2_log_buf *lb;
struct buffer_head *bh;
#if 0
unsigned int d;

d = log_distance(sdp, sdp->sd_log_flush_head, sdp->sd_log_head);

gfs2_assert_withdraw(sdp, d + 1 == sdp->sd_log_blks_reserved);
#endif

while (!list_empty(head)) {
lb = list_entry(head->next, struct gfs2_log_buf, lb_list);
Expand Down Expand Up @@ -483,6 +485,7 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl)
sdp->sd_log_head = sdp->sd_log_flush_head;

/* printk(KERN_INFO "sd_log_num_hdrs %u\n", sdp->sd_log_num_hdrs); */
sdp->sd_log_blks_free -= sdp->sd_log_num_hdrs;

sdp->sd_log_blks_reserved =
sdp->sd_log_commited_buf =
Expand Down Expand Up @@ -515,8 +518,7 @@ static void log_refund(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
gfs2_assert_withdraw(sdp, ((int)sdp->sd_log_commited_revoke) >= 0);

if (sdp->sd_log_commited_buf)
reserved += 1 + sdp->sd_log_commited_buf +
sdp->sd_log_commited_buf/503;
reserved += sdp->sd_log_commited_buf;
if (sdp->sd_log_commited_revoke)
reserved += gfs2_struct2blk(sdp, sdp->sd_log_commited_revoke,
sizeof(uint64_t));
Expand All @@ -527,7 +529,8 @@ static void log_refund(struct gfs2_sbd *sdp, struct gfs2_trans *tr)

gfs2_assert_withdraw(sdp, sdp->sd_log_blks_free >= old);
gfs2_assert_withdraw(sdp,
sdp->sd_log_blks_free <= sdp->sd_jdesc->jd_blocks);
sdp->sd_log_blks_free <= sdp->sd_jdesc->jd_blocks +
sdp->sd_log_num_hdrs);

sdp->sd_log_blks_reserved = reserved;

Expand Down Expand Up @@ -582,6 +585,7 @@ void gfs2_log_shutdown(struct gfs2_sbd *sdp)

log_write_header(sdp, GFS2_LOG_HEAD_UNMOUNT, 0);

/* printk(KERN_INFO "sd_log_blks_free %u, sd_jdesc->jd_blocks %u\n", sdp->sd_log_blks_free, sdp->sd_jdesc->jd_blocks); */
gfs2_assert_withdraw(sdp, sdp->sd_log_blks_free ==
sdp->sd_jdesc->jd_blocks);
gfs2_assert_withdraw(sdp, sdp->sd_log_head == sdp->sd_log_tail);
Expand Down
13 changes: 3 additions & 10 deletions trunk/fs/gfs2/trans.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks,
tr->tr_revokes = revokes;
tr->tr_reserved = 1;
if (blocks)
tr->tr_reserved += 1 + blocks;
tr->tr_reserved += 6 + blocks;
if (revokes)
tr->tr_reserved += gfs2_struct2blk(sdp, revokes,
sizeof(uint64_t));
Expand Down Expand Up @@ -83,20 +83,15 @@ int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks,

void gfs2_trans_end(struct gfs2_sbd *sdp)
{
struct gfs2_trans *tr;
struct gfs2_trans *tr = current->journal_info;

tr = current->journal_info;
BUG_ON(!tr);
current->journal_info = NULL;

if (gfs2_assert_warn(sdp, tr))
return;

if (!tr->tr_touched) {
gfs2_log_release(sdp, tr->tr_reserved);

gfs2_glock_dq(&tr->tr_t_gh);
gfs2_holder_uninit(&tr->tr_t_gh);

kfree(tr);
return;
}
Expand All @@ -113,10 +108,8 @@ void gfs2_trans_end(struct gfs2_sbd *sdp)
}

gfs2_log_commit(sdp, tr);

gfs2_glock_dq(&tr->tr_t_gh);
gfs2_holder_uninit(&tr->tr_t_gh);

kfree(tr);

if (sdp->sd_vfs->s_flags & MS_SYNCHRONOUS)
Expand Down

0 comments on commit 5bf1271

Please sign in to comment.