Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76030
b: refs/heads/master
c: 2bcd610
h: refs/heads/master
v: v3
  • Loading branch information
Steven Whitehouse committed Jan 25, 2008
1 parent a0f7571 commit 29d6684
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 79 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: 8cbc4342478311c2a85260a7ca54d96cb7f71f7b
refs/heads/master: 2bcd610d2fdea608a8fdac32788fc35a32a2327c
3 changes: 0 additions & 3 deletions trunk/fs/gfs2/glock.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
gl->gl_object = NULL;
gl->gl_sbd = sdp;
gl->gl_aspace = NULL;
lops_init_le(&gl->gl_le, &gfs2_glock_lops);
INIT_DELAYED_WORK(&gl->gl_work, glock_work_func);

/* If this glock protects actual on-disk data or metadata blocks,
Expand Down Expand Up @@ -1900,8 +1899,6 @@ static int dump_glock(struct glock_iter *gi, struct gfs2_glock *gl)
print_dbg(gi, " req_bh = %s\n", (gl->gl_req_bh) ? "yes" : "no");
print_dbg(gi, " lvb_count = %d\n", atomic_read(&gl->gl_lvb_count));
print_dbg(gi, " object = %s\n", (gl->gl_object) ? "yes" : "no");
print_dbg(gi, " le = %s\n",
(list_empty(&gl->gl_le.le_list)) ? "no" : "yes");
print_dbg(gi, " reclaim = %s\n",
(list_empty(&gl->gl_reclaim)) ? "no" : "yes");
if (gl->gl_aspace)
Expand Down
4 changes: 1 addition & 3 deletions trunk/fs/gfs2/incore.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ enum {
GLF_PENDING_DEMOTE = 4,
GLF_DIRTY = 5,
GLF_DEMOTE_IN_PROGRESS = 6,
GLF_LFLUSH = 7,
};

struct gfs2_glock {
Expand Down Expand Up @@ -208,7 +209,6 @@ struct gfs2_glock {
struct gfs2_sbd *gl_sbd;

struct inode *gl_aspace;
struct gfs2_log_element gl_le;
struct list_head gl_ail_list;
atomic_t gl_ail_count;
struct delayed_work gl_work;
Expand Down Expand Up @@ -584,13 +584,11 @@ struct gfs2_sbd {
unsigned int sd_log_commited_databuf;
unsigned int sd_log_commited_revoke;

unsigned int sd_log_num_gl;
unsigned int sd_log_num_buf;
unsigned int sd_log_num_revoke;
unsigned int sd_log_num_rg;
unsigned int sd_log_num_databuf;

struct list_head sd_log_le_gl;
struct list_head sd_log_le_buf;
struct list_head sd_log_le_revoke;
struct list_head sd_log_le_rg;
Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/gfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ int gfs2_dinode_dealloc(struct gfs2_inode *ip)
if (error)
goto out_rg_gunlock;

gfs2_trans_add_gl(ip->i_gl);
set_bit(GLF_DIRTY, &ip->i_gl->gl_flags);
set_bit(GLF_LFLUSH, &ip->i_gl->gl_flags);

gfs2_free_di(rgd, ip);

Expand Down
15 changes: 5 additions & 10 deletions trunk/fs/gfs2/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,20 +692,16 @@ static void gfs2_ordered_wait(struct gfs2_sbd *sdp)
*
*/

void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl)
void __gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl)
{
struct gfs2_ail *ai;

down_write(&sdp->sd_log_flush_lock);

if (gl) {
gfs2_log_lock(sdp);
if (list_empty(&gl->gl_le.le_list)) {
gfs2_log_unlock(sdp);
up_write(&sdp->sd_log_flush_lock);
return;
}
gfs2_log_unlock(sdp);
/* Log might have been flushed while we waited for the flush lock */
if (gl && !test_bit(GLF_LFLUSH, &gl->gl_flags)) {
up_write(&sdp->sd_log_flush_lock);
return;
}

ai = kzalloc(sizeof(struct gfs2_ail), GFP_NOFS | __GFP_NOFAIL);
Expand Down Expand Up @@ -823,7 +819,6 @@ void gfs2_log_shutdown(struct gfs2_sbd *sdp)
down_write(&sdp->sd_log_flush_lock);

gfs2_assert_withdraw(sdp, !sdp->sd_log_blks_reserved);
gfs2_assert_withdraw(sdp, !sdp->sd_log_num_gl);
gfs2_assert_withdraw(sdp, !sdp->sd_log_num_buf);
gfs2_assert_withdraw(sdp, !sdp->sd_log_num_revoke);
gfs2_assert_withdraw(sdp, !sdp->sd_log_num_rg);
Expand Down
9 changes: 8 additions & 1 deletion trunk/fs/gfs2/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,14 @@ void gfs2_log_incr_head(struct gfs2_sbd *sdp);
struct buffer_head *gfs2_log_get_buf(struct gfs2_sbd *sdp);
struct buffer_head *gfs2_log_fake_buf(struct gfs2_sbd *sdp,
struct buffer_head *real);
void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl);
void __gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl);

static inline void gfs2_log_flush(struct gfs2_sbd *sbd, struct gfs2_glock *gl)
{
if (!gl || test_bit(GLF_LFLUSH, &gl->gl_flags))
__gfs2_log_flush(sbd, gl);
}

void gfs2_log_commit(struct gfs2_sbd *sdp, struct gfs2_trans *trans);
void gfs2_remove_from_ail(struct gfs2_bufdata *bd);

Expand Down
58 changes: 5 additions & 53 deletions trunk/fs/gfs2/lops.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ static void gfs2_unpin(struct gfs2_sbd *sdp, struct buffer_head *bh,
}
bd->bd_ail = ai;
list_add(&bd->bd_ail_st_list, &ai->ai_ail1_list);
clear_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags);
gfs2_log_unlock(sdp);
unlock_buffer(bh);
}
Expand Down Expand Up @@ -124,49 +125,6 @@ static struct buffer_head *gfs2_get_log_desc(struct gfs2_sbd *sdp, u32 ld_type)
return bh;
}

static void __glock_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)
{
struct gfs2_glock *gl;
struct gfs2_trans *tr = current->journal_info;

tr->tr_touched = 1;

gl = container_of(le, struct gfs2_glock, gl_le);
if (gfs2_assert_withdraw(sdp, gfs2_glock_is_held_excl(gl)))
return;

if (!list_empty(&le->le_list))
return;

gfs2_glock_hold(gl);
set_bit(GLF_DIRTY, &gl->gl_flags);
sdp->sd_log_num_gl++;
list_add(&le->le_list, &sdp->sd_log_le_gl);
}

static void glock_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)
{
gfs2_log_lock(sdp);
__glock_lo_add(sdp, le);
gfs2_log_unlock(sdp);
}

static void glock_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_ail *ai)
{
struct list_head *head = &sdp->sd_log_le_gl;
struct gfs2_glock *gl;

while (!list_empty(head)) {
gl = list_entry(head->next, struct gfs2_glock, gl_le.le_list);
list_del_init(&gl->gl_le.le_list);
sdp->sd_log_num_gl--;

gfs2_assert_withdraw(sdp, gfs2_glock_is_held_excl(gl));
gfs2_glock_put(gl);
}
gfs2_assert_warn(sdp, !sdp->sd_log_num_gl);
}

static void buf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)
{
struct gfs2_bufdata *bd = container_of(le, struct gfs2_bufdata, bd_le);
Expand All @@ -182,7 +140,8 @@ static void buf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)
list_add(&bd->bd_list_tr, &tr->tr_list_buf);
if (!list_empty(&le->le_list))
goto out;
__glock_lo_add(sdp, &bd->bd_gl->gl_le);
set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags);
set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags);
gfs2_meta_check(sdp, bd->bd_bh);
gfs2_pin(sdp, bd->bd_bh);
sdp->sd_log_num_buf++;
Expand Down Expand Up @@ -568,8 +527,8 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)
if (!list_empty(&le->le_list))
goto out;

if (tr)
__glock_lo_add(sdp, &bd->bd_gl->gl_le);
set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags);
set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags);
if (gfs2_is_jdata(ip)) {
gfs2_pin(sdp, bd->bd_bh);
tr->tr_num_databuf_new++;
Expand Down Expand Up @@ -776,12 +735,6 @@ static void databuf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_ail *ai)
}


const struct gfs2_log_operations gfs2_glock_lops = {
.lo_add = glock_lo_add,
.lo_after_commit = glock_lo_after_commit,
.lo_name = "glock",
};

const struct gfs2_log_operations gfs2_buf_lops = {
.lo_add = buf_lo_add,
.lo_incore_commit = buf_lo_incore_commit,
Expand Down Expand Up @@ -819,7 +772,6 @@ const struct gfs2_log_operations gfs2_databuf_lops = {
};

const struct gfs2_log_operations *gfs2_log_ops[] = {
&gfs2_glock_lops,
&gfs2_databuf_lops,
&gfs2_buf_lops,
&gfs2_rg_lops,
Expand Down
1 change: 0 additions & 1 deletion trunk/fs/gfs2/ops_fstype.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb)

spin_lock_init(&sdp->sd_log_lock);

INIT_LIST_HEAD(&sdp->sd_log_le_gl);
INIT_LIST_HEAD(&sdp->sd_log_le_buf);
INIT_LIST_HEAD(&sdp->sd_log_le_revoke);
INIT_LIST_HEAD(&sdp->sd_log_le_rg);
Expand Down
5 changes: 0 additions & 5 deletions trunk/fs/gfs2/trans.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ void gfs2_trans_end(struct gfs2_sbd *sdp)
gfs2_log_flush(sdp, NULL);
}

void gfs2_trans_add_gl(struct gfs2_glock *gl)
{
lops_add(gl->gl_sbd, &gl->gl_le);
}

/**
* gfs2_trans_add_bh - Add a to-be-modified buffer to the current transaction
* @gl: the glock the buffer belongs to
Expand Down
1 change: 0 additions & 1 deletion trunk/fs/gfs2/trans.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks,

void gfs2_trans_end(struct gfs2_sbd *sdp);

void gfs2_trans_add_gl(struct gfs2_glock *gl);
void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta);
void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd);
void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno);
Expand Down

0 comments on commit 29d6684

Please sign in to comment.