Skip to content

Commit fcd6308

Browse files
author
Andreas Gruenbacher
committed
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: Andreas Gruenbacher <[email protected]>
1 parent 1e86044 commit fcd6308

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

fs/gfs2/ops_fstype.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,7 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc)
12891289
error = gfs2_make_fs_rw(sdp);
12901290

12911291
if (error) {
1292-
gfs2_freeze_unlock(&sdp->sd_freeze_gh);
1292+
gfs2_freeze_unlock(sdp);
12931293
gfs2_destroy_threads(sdp);
12941294
fs_err(sdp, "can't make FS RW: %d\n", error);
12951295
goto fail_per_node;

fs/gfs2/super.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ static int gfs2_lock_fs_check_clean(struct gfs2_sbd *sdp)
358358
list_add(&lfcc->list, &list);
359359
}
360360

361-
gfs2_freeze_unlock(&sdp->sd_freeze_gh);
361+
gfs2_freeze_unlock(sdp);
362362

363363
error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_EXCLUSIVE,
364364
LM_FLAG_NOEXP | GL_NOPID,
@@ -382,7 +382,7 @@ static int gfs2_lock_fs_check_clean(struct gfs2_sbd *sdp)
382382
if (!error)
383383
goto out; /* success */
384384

385-
gfs2_freeze_unlock(&sdp->sd_freeze_gh);
385+
gfs2_freeze_unlock(sdp);
386386

387387
relock_shared:
388388
error2 = gfs2_freeze_lock_shared(sdp);
@@ -621,7 +621,7 @@ static void gfs2_put_super(struct super_block *sb)
621621

622622
/* Release stuff */
623623

624-
gfs2_freeze_unlock(&sdp->sd_freeze_gh);
624+
gfs2_freeze_unlock(sdp);
625625

626626
iput(sdp->sd_jindex);
627627
iput(sdp->sd_statfs_inode);
@@ -707,7 +707,7 @@ void gfs2_freeze_func(struct work_struct *work)
707707
if (error)
708708
goto freeze_failed;
709709

710-
gfs2_freeze_unlock(&sdp->sd_freeze_gh);
710+
gfs2_freeze_unlock(sdp);
711711
set_bit(SDF_FROZEN, &sdp->sd_flags);
712712

713713
error = gfs2_do_thaw(sdp);
@@ -812,7 +812,7 @@ static int gfs2_thaw_super(struct super_block *sb, enum freeze_holder who)
812812
}
813813

814814
atomic_inc(&sb->s_active);
815-
gfs2_freeze_unlock(&sdp->sd_freeze_gh);
815+
gfs2_freeze_unlock(sdp);
816816

817817
error = gfs2_do_thaw(sdp);
818818

@@ -833,7 +833,7 @@ void gfs2_thaw_freeze_initiator(struct super_block *sb)
833833
if (!test_bit(SDF_FREEZE_INITIATOR, &sdp->sd_flags))
834834
goto out;
835835

836-
gfs2_freeze_unlock(&sdp->sd_freeze_gh);
836+
gfs2_freeze_unlock(sdp);
837837

838838
out:
839839
mutex_unlock(&sdp->sd_freeze_mutex);

fs/gfs2/util.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ int gfs2_freeze_lock_shared(struct gfs2_sbd *sdp)
109109
return error;
110110
}
111111

112-
void gfs2_freeze_unlock(struct gfs2_holder *freeze_gh)
112+
void gfs2_freeze_unlock(struct gfs2_sbd *sdp)
113113
{
114-
if (gfs2_holder_initialized(freeze_gh))
115-
gfs2_glock_dq_uninit(freeze_gh);
114+
if (gfs2_holder_initialized(&sdp->sd_freeze_gh))
115+
gfs2_glock_dq_uninit(&sdp->sd_freeze_gh);
116116
}
117117

118118
static void signal_our_withdraw(struct gfs2_sbd *sdp)

fs/gfs2/util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ int gfs2_io_error_i(struct gfs2_sbd *sdp, const char *function,
150150
int check_journal_clean(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd,
151151
bool verbose);
152152
int gfs2_freeze_lock_shared(struct gfs2_sbd *sdp);
153-
void gfs2_freeze_unlock(struct gfs2_holder *freeze_gh);
153+
void gfs2_freeze_unlock(struct gfs2_sbd *sdp);
154154

155155
#define gfs2_io_error(sdp) \
156156
gfs2_io_error_i((sdp), __func__, __FILE__, __LINE__)

0 commit comments

Comments
 (0)