Commit 6e422408 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher
Browse files

gfs2: Turn gfs2_withdraw into a void function



Since commit 601ef0d5 ("gfs2: Force withdraw to replay journals and
wait for it to finish"), gfs2_withdraw() always returns -1, so turn it
into a straight void function.

Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: default avatarAndrew Price <anprice@redhat.com>
parent 418c8547
Loading
Loading
Loading
Loading
+8 −13
Original line number Diff line number Diff line
@@ -309,7 +309,7 @@ void gfs2_lm(struct gfs2_sbd *sdp, const char *fmt, ...)
	va_end(args);
}

int gfs2_withdraw(struct gfs2_sbd *sdp)
void gfs2_withdraw(struct gfs2_sbd *sdp)
{
	struct lm_lockstruct *ls = &sdp->sd_lockstruct;
	const struct lm_lockops *lm = ls->ls_ops;
@@ -322,7 +322,7 @@ int gfs2_withdraw(struct gfs2_sbd *sdp)
				wait_on_bit(&sdp->sd_flags,
					    SDF_WITHDRAW_IN_PROG,
					    TASK_UNINTERRUPTIBLE);
				return -1;
				return;
			}
			new = old | BIT(SDF_WITHDRAWN) | BIT(SDF_WITHDRAW_IN_PROG);
		} while (unlikely(!try_cmpxchg(&sdp->sd_flags, &old, new)));
@@ -350,8 +350,6 @@ int gfs2_withdraw(struct gfs2_sbd *sdp)

	if (sdp->sd_args.ar_errors == GFS2_ERRORS_PANIC)
		panic("GFS2: fsid=%s: panic requested\n", sdp->sd_fsname);

	return -1;
}

/*
@@ -481,16 +479,14 @@ int gfs2_meta_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh,
		       const char *function, char *file,
		       unsigned int line)
{
	int me;

	gfs2_lm(sdp,
		"fatal: invalid metadata block - "
		"bh = %llu (bad magic number), "
		"function = %s, file = %s, line = %u\n",
		(unsigned long long)bh->b_blocknr,
		function, file, line);
	me = gfs2_withdraw(sdp);
	return (me) ? -1 : -2;
	gfs2_withdraw(sdp);
	return -1;
}

/*
@@ -503,16 +499,14 @@ int gfs2_metatype_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh,
			   u16 type, u16 t, const char *function,
			   char *file, unsigned int line)
{
	int me;

	gfs2_lm(sdp,
		"fatal: invalid metadata block - "
		"bh = %llu (type: exp=%u, found=%u), "
		"function = %s, file = %s, line = %u\n",
		(unsigned long long)bh->b_blocknr, type, t,
		function, file, line);
	me = gfs2_withdraw(sdp);
	return (me) ? -1 : -2;
	gfs2_withdraw(sdp);
	return -1;
}

/*
@@ -528,7 +522,8 @@ int gfs2_io_error_i(struct gfs2_sbd *sdp, const char *function, char *file,
		"fatal: I/O error - "
		"function = %s, file = %s, line = %u\n",
		function, file, line);
	return gfs2_withdraw(sdp);
	gfs2_withdraw(sdp);
	return -1;
}

/*
+1 −1
Original line number Diff line number Diff line
@@ -228,6 +228,6 @@ gfs2_tune_get_i(&(sdp)->sd_tune, &(sdp)->sd_tune.field)

__printf(2, 3)
void gfs2_lm(struct gfs2_sbd *sdp, const char *fmt, ...);
int gfs2_withdraw(struct gfs2_sbd *sdp);
void gfs2_withdraw(struct gfs2_sbd *sdp);

#endif /* __UTIL_DOT_H__ */