Skip to content

Commit

Permalink
GFS2: Drop "pull" argument from log_write_header()
Browse files Browse the repository at this point in the history
The "pull" argument to log_write_header() is only used
for debug purposes and it is not really needed any more. There
are other tests for this particular problem, so I think we can
dispose of it in order to simplify the code.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Steven Whitehouse committed Apr 24, 2012
1 parent af3a3ab commit fdb76a4
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions fs/gfs2/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
#include "dir.h"
#include "trace_gfs2.h"

#define PULL 1

/**
* gfs2_struct2blk - compute stuff
* @sdp: the filesystem
Expand Down Expand Up @@ -580,7 +578,7 @@ static void gfs2_ordered_wait(struct gfs2_sbd *sdp)
* Returns: the initialized log buffer descriptor
*/

static void log_write_header(struct gfs2_sbd *sdp, u32 flags, int pull)
static void log_write_header(struct gfs2_sbd *sdp, u32 flags)
{
u64 blkno = gfs2_log_bmap(sdp, sdp->sd_log_flush_head);
struct buffer_head *bh;
Expand Down Expand Up @@ -628,8 +626,6 @@ static void log_write_header(struct gfs2_sbd *sdp, u32 flags, int pull)

if (sdp->sd_log_tail != tail)
log_pull_tail(sdp, tail);
else
gfs2_assert_withdraw(sdp, !pull);

sdp->sd_log_idle = (tail == sdp->sd_log_flush_head);
gfs2_log_incr_head(sdp);
Expand Down Expand Up @@ -680,13 +676,13 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl)
lops_before_commit(sdp);

if (sdp->sd_log_head != sdp->sd_log_flush_head) {
log_write_header(sdp, 0, 0);
log_write_header(sdp, 0);
} else if (sdp->sd_log_tail != current_tail(sdp) && !sdp->sd_log_idle){
gfs2_log_lock(sdp);
atomic_dec(&sdp->sd_log_blks_free); /* Adjust for unreserved buffer */
trace_gfs2_log_blocks(sdp, -1);
gfs2_log_unlock(sdp);
log_write_header(sdp, 0, PULL);
log_write_header(sdp, 0);
}
lops_after_commit(sdp, ai);

Expand Down Expand Up @@ -798,8 +794,7 @@ void gfs2_log_shutdown(struct gfs2_sbd *sdp)
sdp->sd_log_flush_head = sdp->sd_log_head;
sdp->sd_log_flush_wrapped = 0;

log_write_header(sdp, GFS2_LOG_HEAD_UNMOUNT,
(sdp->sd_log_tail == current_tail(sdp)) ? 0 : PULL);
log_write_header(sdp, GFS2_LOG_HEAD_UNMOUNT);

gfs2_assert_warn(sdp, atomic_read(&sdp->sd_log_blks_free) == sdp->sd_jdesc->jd_blocks);
gfs2_assert_warn(sdp, sdp->sd_log_head == sdp->sd_log_tail);
Expand Down

0 comments on commit fdb76a4

Please sign in to comment.