From 2bd8bf5a376e94c251a859062d0c63df6d8e5a6b Mon Sep 17 00:00:00 2001 From: Steven Whitehouse Date: Thu, 6 Jul 2006 17:58:03 -0400 Subject: [PATCH] --- yaml --- r: 38741 b: refs/heads/master c: 29937ac6caa68d60c7f1a3e07b6137cf53e09e24 h: refs/heads/master i: 38739: 00e94493d06de69c8701608502a60606b54f3f4d v: v3 --- [refs] | 2 +- trunk/fs/gfs2/glock.c | 12 +++--------- trunk/fs/gfs2/inode.c | 2 ++ trunk/fs/gfs2/ops_inode.c | 1 + trunk/fs/gfs2/page.c | 3 +-- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index b8905e5c1b5b..b44d5ad5d662 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 71ec63c5d66b577a71910b82740751be73e81310 +refs/heads/master: 29937ac6caa68d60c7f1a3e07b6137cf53e09e24 diff --git a/trunk/fs/gfs2/glock.c b/trunk/fs/gfs2/glock.c index 7f362d0c3f7a..0381d4cc4146 100644 --- a/trunk/fs/gfs2/glock.c +++ b/trunk/fs/gfs2/glock.c @@ -1965,19 +1965,13 @@ static int examine_bucket(glock_examiner examiner, struct gfs2_sbd *sdp, static void scan_glock(struct gfs2_glock *gl) { if (gfs2_glmutex_trylock(gl)) { - if (gl->gl_ops == &gfs2_inode_glops) { - struct gfs2_inode *ip = gl->gl_object; - if (ip == NULL) { - struct gfs2_sbd *sdp = gl->gl_sbd; - gfs2_assert_withdraw(sdp, gl->gl_state == LM_ST_UNLOCKED); - goto out_schedule; - } - } + if (gl->gl_ops == &gfs2_inode_glops) + goto out; if (queue_empty(gl, &gl->gl_holders) && gl->gl_state != LM_ST_UNLOCKED && demote_ok(gl)) goto out_schedule; - +out: gfs2_glmutex_unlock(gl); } diff --git a/trunk/fs/gfs2/inode.c b/trunk/fs/gfs2/inode.c index 6499c4f91078..f4c48395208a 100644 --- a/trunk/fs/gfs2/inode.c +++ b/trunk/fs/gfs2/inode.c @@ -325,6 +325,7 @@ int gfs2_change_nlink(struct gfs2_inode *ip, int diff) uint32_t nlink; int error; + BUG_ON(ip->i_di.di_nlink != ip->i_inode.i_nlink); nlink = ip->i_di.di_nlink + diff; /* If we are reducing the nlink count, but the new value ends up being @@ -341,6 +342,7 @@ int gfs2_change_nlink(struct gfs2_inode *ip, int diff) ip->i_di.di_nlink = nlink; ip->i_di.di_ctime = get_seconds(); + ip->i_inode.i_nlink = nlink; gfs2_trans_add_bh(ip->i_gl, dibh, 1); gfs2_dinode_out(&ip->i_di, dibh->b_data); diff --git a/trunk/fs/gfs2/ops_inode.c b/trunk/fs/gfs2/ops_inode.c index 8895baafc640..caecafe0469b 100644 --- a/trunk/fs/gfs2/ops_inode.c +++ b/trunk/fs/gfs2/ops_inode.c @@ -250,6 +250,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir, gfs2_holder_uninit(ghs + 1); if (!error) { + atomic_inc(&inode->i_count); d_instantiate(dentry, inode); mark_inode_dirty(inode); } diff --git a/trunk/fs/gfs2/page.c b/trunk/fs/gfs2/page.c index a8165a693b56..b93caf294b9f 100644 --- a/trunk/fs/gfs2/page.c +++ b/trunk/fs/gfs2/page.c @@ -256,8 +256,7 @@ void gfs2_page_add_databufs(struct gfs2_inode *ip, struct page *page, struct buffer_head *bh; unsigned int start, end; - for (bh = head, start = 0; - bh != head || !start; + for (bh = head, start = 0; bh != head || !start; bh = bh->b_this_page, start = end) { end = start + bsize; if (end <= from || start >= to)