Commit 1c089c32 authored by Steven Whitehouse's avatar Steven Whitehouse
Browse files

[GFS2] Remove one typedef



This removes one of the typedefs from the locking interface. It
is replaced by a forward declaration of the gfs2 superblock. The
other two are not so easy to solve since in their case, they
can refer to one of two possible structures.

Cc: David Teigland <teigland@redhat.com>
Cc: Jan Engelhardt <jengelh@linux01.gwdg.de>
Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent b9201ce9
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1704,7 +1704,7 @@ static void blocking_cb(struct gfs2_sbd *sdp, struct lm_lockname *name,

/**
 * gfs2_glock_cb - Callback used by locking module
 * @fsdata: Pointer to the superblock
 * @sdp: Pointer to the superblock
 * @type: Type of callback
 * @data: Type dependent data pointer
 *
@@ -1713,9 +1713,8 @@ static void blocking_cb(struct gfs2_sbd *sdp, struct lm_lockname *name,
 * a journal from another client needs to be recovered.
 */

void gfs2_glock_cb(lm_fsdata_t *fsdata, unsigned int type, void *data)
void gfs2_glock_cb(struct gfs2_sbd *sdp, unsigned int type, void *data)
{
	struct gfs2_sbd *sdp = (struct gfs2_sbd *)fsdata;

	switch (type) {
	case LM_CB_NEED_E:
+1 −1
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ static inline int gfs2_glock_nq_init(struct gfs2_glock *gl,
int gfs2_lvb_hold(struct gfs2_glock *gl);
void gfs2_lvb_unhold(struct gfs2_glock *gl);

void gfs2_glock_cb(lm_fsdata_t *fsdata, unsigned int type, void *data);
void gfs2_glock_cb(struct gfs2_sbd *sdp, unsigned int type, void *data);

void gfs2_iopen_go_callback(struct gfs2_glock *gl, unsigned int state);

+4 −5
Original line number Diff line number Diff line
@@ -17,10 +17,9 @@

typedef void lm_lockspace_t;
typedef void lm_lock_t;
typedef void lm_fsdata_t;
struct gfs2_sbd;

typedef void (*lm_callback_t) (lm_fsdata_t *fsdata, unsigned int type,
			       void *data);
typedef void (*lm_callback_t) (struct gfs2_sbd *sdp, unsigned int type, void *data);

/*
 * lm_mount() flags
@@ -183,7 +182,7 @@ struct lm_lockops {
	 */

	int (*lm_mount) (char *table_name, char *host_data,
			 lm_callback_t cb, lm_fsdata_t *fsdata,
			 lm_callback_t cb, struct gfs2_sbd *sdp,
			 unsigned int min_lvb_size, int flags,
			 struct lm_lockstruct *lockstruct,
			 struct kobject *fskobj);
@@ -275,7 +274,7 @@ void gfs2_unregister_lockproto(struct lm_lockops *proto);
 */

int gfs2_mount_lockproto(char *proto_name, char *table_name, char *host_data,
			 lm_callback_t cb, lm_fsdata_t *fsdata,
			 lm_callback_t cb, struct gfs2_sbd *sdp,
			 unsigned int min_lvb_size, int flags,
			 struct lm_lockstruct *lockstruct,
			 struct kobject *fskobj);
+3 −3
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ void gfs2_unregister_lockproto(struct lm_lockops *proto)
 * @table_name - the name of the lock space
 * @host_data - data specific to this host
 * @cb - the callback to the code using the lock module
 * @fsdata - data to pass back with the callback
 * @sdp - The GFS2 superblock
 * @min_lvb_size - the mininum LVB size that the caller can deal with
 * @flags - LM_MFLAG_*
 * @lockstruct - a structure returned describing the mount
@@ -108,7 +108,7 @@ void gfs2_unregister_lockproto(struct lm_lockops *proto)
 */

int gfs2_mount_lockproto(char *proto_name, char *table_name, char *host_data,
			 lm_callback_t cb, lm_fsdata_t *fsdata,
			 lm_callback_t cb, struct gfs2_sbd *sdp,
			 unsigned int min_lvb_size, int flags,
			 struct lm_lockstruct *lockstruct,
			 struct kobject *fskobj)
@@ -147,7 +147,7 @@ int gfs2_mount_lockproto(char *proto_name, char *table_name, char *host_data,
		goto retry;
	}

	error = lw->lw_ops->lm_mount(table_name, host_data, cb, fsdata,
	error = lw->lw_ops->lm_mount(table_name, host_data, cb, sdp,
				     min_lvb_size, flags, lockstruct, fskobj);
	if (error)
		module_put(lw->lw_ops->lm_owner);
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ struct gdlm_ls {
	int			fsflags;
	dlm_lockspace_t		*dlm_lockspace;
	lm_callback_t		fscb;
	lm_fsdata_t		*fsdata;
	struct gfs2_sbd		*sdp;
	int			recover_jid;
	int			recover_jid_done;
	int			recover_jid_status;
Loading