]> err.no Git - linux-2.6/commitdiff
[GFS2] Remove one typedef
authorSteven Whitehouse <swhiteho@redhat.com>
Thu, 7 Sep 2006 19:50:20 +0000 (15:50 -0400)
committerSteven Whitehouse <swhiteho@redhat.com>
Thu, 7 Sep 2006 19:50:20 +0000 (15:50 -0400)
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: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/glock.c
fs/gfs2/glock.h
fs/gfs2/lm_interface.h
fs/gfs2/locking.c
fs/gfs2/locking/dlm/lock_dlm.h
fs/gfs2/locking/dlm/mount.c
fs/gfs2/locking/dlm/sysfs.c
fs/gfs2/locking/dlm/thread.c
fs/gfs2/locking/nolock/main.c

index 5759f52a1cf9d6af9231fe25a7c5406840139865..87b37fe269b67322a3ca53e3a916207d635c1315 100644 (file)
@@ -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:
index 0febca3d6d4710d75488b5d2c4a44244242d60f4..e3bf4bcd4b292a2b9faae29296bd5c7e84304c69 100644 (file)
@@ -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);
 
index e2dfc3da4da9632f0f57a27c018891ef05aaeba3..75835e0f425466189371c5b2d5804e8e3de72e0b 100644 (file)
 
 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);
index fce2001e5e256a021c499de340ed167eaa472fb8..31421ee6d863a69c22e2fbaa668578396dacbd38 100644 (file)
@@ -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 @@ retry:
                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);
index c7b6e370258f608daea8d3b936ec7afcf165d1e3..e6898d236521b80f79368ef1b8ebb22d9959361c 100644 (file)
@@ -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;
index 82ac00af84a38e9a588d905081820315fde7ff0c..8a1764f4d71cbf44f4136e15ed0841f9540d0c93 100644 (file)
@@ -14,7 +14,7 @@ int gdlm_drop_period;
 struct lm_lockops gdlm_ops;
 
 
-static struct gdlm_ls *init_gdlm(lm_callback_t cb, lm_fsdata_t *fsdata,
+static struct gdlm_ls *init_gdlm(lm_callback_t cb, struct gfs2_sbd *sdp,
                                 int flags, char *table_name)
 {
        struct gdlm_ls *ls;
@@ -27,7 +27,7 @@ static struct gdlm_ls *init_gdlm(lm_callback_t cb, lm_fsdata_t *fsdata,
        ls->drop_locks_count = gdlm_drop_count;
        ls->drop_locks_period = gdlm_drop_period;
        ls->fscb = cb;
-       ls->fsdata = fsdata;
+       ls->sdp = sdp;
        ls->fsflags = flags;
        spin_lock_init(&ls->async_lock);
        INIT_LIST_HEAD(&ls->complete);
@@ -120,7 +120,7 @@ static int make_args(struct gdlm_ls *ls, char *data_arg, int *nodir)
 }
 
 static int gdlm_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)
@@ -131,7 +131,7 @@ static int gdlm_mount(char *table_name, char *host_data,
        if (min_lvb_size > GDLM_LVB_SIZE)
                goto out;
 
-       ls = init_gdlm(cb, fsdata, flags, table_name);
+       ls = init_gdlm(cb, sdp, flags, table_name);
        if (!ls)
                goto out;
 
index c1237a91fc683db4319ca7c8b2e6ca4623e4f61f..29ae06f949445c735fac49c62cb65f3aa090a9a5 100644 (file)
@@ -102,7 +102,7 @@ static ssize_t recover_show(struct gdlm_ls *ls, char *buf)
 static ssize_t recover_store(struct gdlm_ls *ls, const char *buf, size_t len)
 {
        ls->recover_jid = simple_strtol(buf, NULL, 0);
-       ls->fscb(ls->fsdata, LM_CB_NEED_RECOVERY, &ls->recover_jid);
+       ls->fscb(ls->sdp, LM_CB_NEED_RECOVERY, &ls->recover_jid);
        return len;
 }
 
index d4895ec242f61ddda334f304c7cf9bf1f295690a..554bf882a4c2bf48287f6ceb6dc55c2a19db821b 100644 (file)
@@ -41,7 +41,7 @@ static void process_blocking(struct gdlm_lock *lp, int bast_mode)
                gdlm_assert(0, "unknown bast mode %u", lp->bast_mode);
        }
 
-       ls->fscb(ls->fsdata, cb, &lp->lockname);
+       ls->fscb(ls->sdp, cb, &lp->lockname);
 }
 
 static void process_complete(struct gdlm_lock *lp)
@@ -232,7 +232,7 @@ out:
            (lp->cur > DLM_LOCK_NL) && (prev_mode > DLM_LOCK_NL))
                acb.lc_ret |= LM_OUT_CACHEABLE;
 
-       ls->fscb(ls->fsdata, LM_CB_ASYNC, &acb);
+       ls->fscb(ls->sdp, LM_CB_ASYNC, &acb);
 }
 
 static inline int no_work(struct gdlm_ls *ls, int blocking)
@@ -318,7 +318,7 @@ static int gdlm_thread(void *data)
                        gdlm_do_lock(lp);
 
                if (drop)
-                       ls->fscb(ls->fsdata, LM_CB_DROPLOCKS, NULL);
+                       ls->fscb(ls->sdp, LM_CB_DROPLOCKS, NULL);
 
                schedule();
        }
index 95a29914730aec4dcc76ee2b02b87e3e4692af6b..e326079430a26327127a886af6efb89504c4ea02 100644 (file)
@@ -24,7 +24,7 @@ struct nolock_lockspace {
 static struct lm_lockops nolock_ops;
 
 static int nolock_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)