Commit fcd63086 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher

gfs2: gfs2_freeze_unlock cleanup

Function gfs2_freeze_unlock() is always called with &sdp->sd_freeze_gh
as its argument, so clean up the code by passing in sdp instead.
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
parent 1e860444
...@@ -1289,7 +1289,7 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc) ...@@ -1289,7 +1289,7 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc)
error = gfs2_make_fs_rw(sdp); error = gfs2_make_fs_rw(sdp);
if (error) { if (error) {
gfs2_freeze_unlock(&sdp->sd_freeze_gh); gfs2_freeze_unlock(sdp);
gfs2_destroy_threads(sdp); gfs2_destroy_threads(sdp);
fs_err(sdp, "can't make FS RW: %d\n", error); fs_err(sdp, "can't make FS RW: %d\n", error);
goto fail_per_node; goto fail_per_node;
......
...@@ -358,7 +358,7 @@ static int gfs2_lock_fs_check_clean(struct gfs2_sbd *sdp) ...@@ -358,7 +358,7 @@ static int gfs2_lock_fs_check_clean(struct gfs2_sbd *sdp)
list_add(&lfcc->list, &list); list_add(&lfcc->list, &list);
} }
gfs2_freeze_unlock(&sdp->sd_freeze_gh); gfs2_freeze_unlock(sdp);
error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_EXCLUSIVE, error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_EXCLUSIVE,
LM_FLAG_NOEXP | GL_NOPID, LM_FLAG_NOEXP | GL_NOPID,
...@@ -382,7 +382,7 @@ static int gfs2_lock_fs_check_clean(struct gfs2_sbd *sdp) ...@@ -382,7 +382,7 @@ static int gfs2_lock_fs_check_clean(struct gfs2_sbd *sdp)
if (!error) if (!error)
goto out; /* success */ goto out; /* success */
gfs2_freeze_unlock(&sdp->sd_freeze_gh); gfs2_freeze_unlock(sdp);
relock_shared: relock_shared:
error2 = gfs2_freeze_lock_shared(sdp); error2 = gfs2_freeze_lock_shared(sdp);
...@@ -621,7 +621,7 @@ static void gfs2_put_super(struct super_block *sb) ...@@ -621,7 +621,7 @@ static void gfs2_put_super(struct super_block *sb)
/* Release stuff */ /* Release stuff */
gfs2_freeze_unlock(&sdp->sd_freeze_gh); gfs2_freeze_unlock(sdp);
iput(sdp->sd_jindex); iput(sdp->sd_jindex);
iput(sdp->sd_statfs_inode); iput(sdp->sd_statfs_inode);
...@@ -707,7 +707,7 @@ void gfs2_freeze_func(struct work_struct *work) ...@@ -707,7 +707,7 @@ void gfs2_freeze_func(struct work_struct *work)
if (error) if (error)
goto freeze_failed; goto freeze_failed;
gfs2_freeze_unlock(&sdp->sd_freeze_gh); gfs2_freeze_unlock(sdp);
set_bit(SDF_FROZEN, &sdp->sd_flags); set_bit(SDF_FROZEN, &sdp->sd_flags);
error = gfs2_do_thaw(sdp); error = gfs2_do_thaw(sdp);
...@@ -812,7 +812,7 @@ static int gfs2_thaw_super(struct super_block *sb, enum freeze_holder who) ...@@ -812,7 +812,7 @@ static int gfs2_thaw_super(struct super_block *sb, enum freeze_holder who)
} }
atomic_inc(&sb->s_active); atomic_inc(&sb->s_active);
gfs2_freeze_unlock(&sdp->sd_freeze_gh); gfs2_freeze_unlock(sdp);
error = gfs2_do_thaw(sdp); error = gfs2_do_thaw(sdp);
...@@ -833,7 +833,7 @@ void gfs2_thaw_freeze_initiator(struct super_block *sb) ...@@ -833,7 +833,7 @@ void gfs2_thaw_freeze_initiator(struct super_block *sb)
if (!test_bit(SDF_FREEZE_INITIATOR, &sdp->sd_flags)) if (!test_bit(SDF_FREEZE_INITIATOR, &sdp->sd_flags))
goto out; goto out;
gfs2_freeze_unlock(&sdp->sd_freeze_gh); gfs2_freeze_unlock(sdp);
out: out:
mutex_unlock(&sdp->sd_freeze_mutex); mutex_unlock(&sdp->sd_freeze_mutex);
......
...@@ -109,10 +109,10 @@ int gfs2_freeze_lock_shared(struct gfs2_sbd *sdp) ...@@ -109,10 +109,10 @@ int gfs2_freeze_lock_shared(struct gfs2_sbd *sdp)
return error; return error;
} }
void gfs2_freeze_unlock(struct gfs2_holder *freeze_gh) void gfs2_freeze_unlock(struct gfs2_sbd *sdp)
{ {
if (gfs2_holder_initialized(freeze_gh)) if (gfs2_holder_initialized(&sdp->sd_freeze_gh))
gfs2_glock_dq_uninit(freeze_gh); gfs2_glock_dq_uninit(&sdp->sd_freeze_gh);
} }
static void signal_our_withdraw(struct gfs2_sbd *sdp) static void signal_our_withdraw(struct gfs2_sbd *sdp)
......
...@@ -150,7 +150,7 @@ int gfs2_io_error_i(struct gfs2_sbd *sdp, const char *function, ...@@ -150,7 +150,7 @@ int gfs2_io_error_i(struct gfs2_sbd *sdp, const char *function,
int check_journal_clean(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd, int check_journal_clean(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd,
bool verbose); bool verbose);
int gfs2_freeze_lock_shared(struct gfs2_sbd *sdp); int gfs2_freeze_lock_shared(struct gfs2_sbd *sdp);
void gfs2_freeze_unlock(struct gfs2_holder *freeze_gh); void gfs2_freeze_unlock(struct gfs2_sbd *sdp);
#define gfs2_io_error(sdp) \ #define gfs2_io_error(sdp) \
gfs2_io_error_i((sdp), __func__, __FILE__, __LINE__) gfs2_io_error_i((sdp), __func__, __FILE__, __LINE__)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment