Whamcloud - gitweb
Use types for journal_callback_set() as in RH 12.5 rawhide and as submitted
authoradilger <adilger>
Fri, 27 Sep 2002 21:26:49 +0000 (21:26 +0000)
committeradilger <adilger>
Fri, 27 Sep 2002 21:26:49 +0000 (21:26 +0000)
for the 2.4.20 kernel.  Will cause a compile warning on chaos22 kernels.

lustre/mds/mds_extN.c
lustre/patches/patch-2.4.18

index 377388e..8b77b6f 100644 (file)
@@ -221,7 +221,7 @@ static void mds_extN_delete_inode(struct inode *inode)
                 mds_extN_fs_ops.cl_delete_inode(inode);
 }
 
-static void mds_extN_callback_status(void *jcb, int error)
+static void mds_extN_callback_status(struct journal_callback *jcb, int error)
 {
         struct mds_cb_data *mcb = (struct mds_cb_data *)jcb;
 
@@ -250,7 +250,7 @@ static int mds_extN_set_last_rcvd(struct mds_obd *mds, void *handle)
         CDEBUG(D_EXT2, "set callback for last_rcvd: %Ld\n",
                (unsigned long long)mcb->cb_last_rcvd);
         journal_callback_set(handle, mds_extN_callback_status,
-                             (void *)mcb);
+                             (struct journal_callback *)mcb);
 #else
 #warning "no journal callback kernel patch, faking it..."
         {
index 2d903ac..9c0105b 100644 (file)
        current->journal_info = handle;
  
        err = try_start_this_handle(journal, handle);
-@@ -1328,6 +1337,29 @@
+@@ -1328,6 +1337,28 @@
  #endif
  
  /*
 + * allocated struct must start with a struct journal_callback at offset 0,
 + * and has the caller-specific data afterwards.
 + */
-+void journal_callback_set(handle_t *handle, void (*func)(void *, int),
-+                        void *cb_data)
++void journal_callback_set(handle_t *handle,
++                        void (*func)(struct journal_callback *jcb, int error),
++                        struct journal_callback *jcb)
 +{
-+      struct journal_callback *jcb = cb_data;
-+
 +      list_add(&jcb->jcb_list, &handle->h_jcb);
 +      jcb->jcb_func = func;
 +}
 +#define HAVE_JOURNAL_CALLBACK_STATUS
 +struct journal_callback {
 +      struct list_head jcb_list;
-+      void (*jcb_func)(void *cb_data, int error);
++      void (*jcb_func)(struct journal_callback *jcb, int error);
 +      /* user data goes here */
 +};
 +
  extern int     journal_try_to_free_buffers(journal_t *, struct page *, int);
  extern int     journal_stop(handle_t *);
  extern int     journal_flush (journal_t *);
-+extern void    journal_callback_set(handle_t *handle, void (*fn)(void *, int),
-+                                    void *cb_data);
++extern void    journal_callback_set(handle_t *handle,
++                                    void (*fn)(struct journal_callback *,int),
++                                    struct journal_callback *jcb);
  
  extern void    journal_lock_updates (journal_t *);
  extern void    journal_unlock_updates (journal_t *);