Whamcloud - gitweb
mgc codes
authorlincent <lincent>
Mon, 17 Oct 2005 12:22:45 +0000 (12:22 +0000)
committerlincent <lincent>
Mon, 17 Oct 2005 12:22:45 +0000 (12:22 +0000)
lustre/include/linux/lustre_dlm.h
lustre/include/linux/lustre_idl.h
lustre/include/linux/lustre_log.h
lustre/include/linux/obd.h
lustre/mgc/mgc_llog.c
lustre/mgc/mgc_lock.c
lustre/mgc/mgc_request.c
lustre/obdclass/obd_config.c

index 5fb0019..d1ed5a2 100644 (file)
@@ -267,7 +267,7 @@ struct ldlm_resource {
         struct list_head       lr_converting;
         struct list_head       lr_waiting;
         ldlm_mode_t            lr_most_restr;
-        ldlm_type_t            lr_type; /* LDLM_{PLAIN,EXTENT,FLOCK} */
+        ldlm_type_t            lr_type; /* LDLM_{PLAIN,EXTENT,FLOCK,LLOG} */
         struct ldlm_resource  *lr_root;
         struct ldlm_res_id     lr_name;
         atomic_t               lr_refcount;
index d601ebd..630cd85 100644 (file)
@@ -1086,6 +1086,7 @@ struct llog_gen_rec {
 
 struct llog_log_hdr {
         struct llog_rec_hdr     llh_hdr;
+        __u64                   llh_version;
         __u64                   llh_timestamp;
         __u32                   llh_count;
         __u32                   llh_bitmap_offset;
@@ -1124,6 +1125,7 @@ enum llogd_rpc_ops {
 
 struct llogd_body {
         struct llog_logid  lgd_logid;
+        __u64 lgd_local_version;
         __u32 lgd_ctxt_idx;
         __u32 lgd_llh_flags;
         __u32 lgd_index;
index 108e656..02f1e00 100644 (file)
@@ -60,6 +60,7 @@ struct llog_handle {
         struct rw_semaphore     lgh_lock;
         struct llog_logid       lgh_id;             /* id of this log */
         struct llog_log_hdr    *lgh_hdr;
+        struct mgc_open_llog   *lgh_mol;
         struct file            *lgh_file;
         char                   *lgh_fsname;
         int                     lgh_last_idx;
@@ -184,7 +185,6 @@ struct llog_operations {
                            struct obd_uuid *uuid);
         int (*lop_update)(struct llog_ctxt *ctxt, struct llog_handle **,
                            struct llog_logid *logid, void *data);
-        /* XXX add 2 more: commit callbacks and llog recovery functions */
 };
 
 /* llog_lvfs.c */
@@ -364,7 +364,6 @@ static inline int llog_next_block(struct llog_handle *loghandle, int *cur_idx,
 }
 
 static inline int llog_create(struct llog_ctxt *ctxt, struct llog_handle **res,
-//                              struct llog_logid *logid, char*fsname, char *name)
                               struct llog_logid *logid, char *name)
 {
         struct llog_operations *lop;
@@ -377,7 +376,6 @@ static inline int llog_create(struct llog_ctxt *ctxt, struct llog_handle **res,
         if (lop->lop_create == NULL)
                 RETURN(-EOPNOTSUPP);
 
- //       rc = lop->lop_create(ctxt, res, logid, fsname, name);
         rc = lop->lop_create(ctxt, res, logid, name);
         RETURN(rc);
 }
index 327998f..b690d5c 100644 (file)
@@ -328,8 +328,8 @@ struct mgc_obd {
         struct mgc_rpc_lock     *mgc_rpc_lock;
         struct vfsmount         *mgc_vfsmnt;     /* for local config dirs */
         struct super_block      *mgc_sb;
-        struct file             *mgc_rcvd_filp;
         struct dentry           *mgc_configs_dir;
+        struct list_head         mgc_open_llogs;
 };
 
 struct mgs_obd {
index 07b05de..e8005c5 100644 (file)
 
 #include "mgc_internal.h"
 
-static 
+int mgc_get_process_llog(struct obd_device *obd, char *llog_name,
+                         struct config_llog_instance *cfg)
+{
+        struct llog_ctxt *ctxt;
+
+        ctxt = llog_get_context(obd, LLOG_CONFIG_REPL_CTXT);
+
+        rc = class_config_parse_llog(ctxt, llog_name, cfg);
+
+        if (!rc) {
+                if (rc == -EINVAL)
+                        LCONSOLE_ERROR("%s: The configuration '%s' could not " 
+                                       "be read from the MGS.  Make sure this " 
+                                       "client and the MGS are running " 
+                                       "compatible versions of Lustre.\n",
+                                       obd->obd_name, llog_name);
+                else
+                        CERROR("class_config_parse_llog failed: rc = %d\n", rc);
+        }
+        return 0;
+}
+
+EXPORT_SYMBOL(mgc_get_process_llog)
index 7e3398b..262582c 100644 (file)
@@ -73,7 +73,7 @@ int mgc_enqueue(struct obd_export *exp, int lock_mode,
 
         rc = ldlm_cli_enqueue(exp, req, obd->obd_namespace, res_id, LDLM_LLOG,
                               NULL, mode, flags, bl_cb, cp_cb, gl_cb, data,
-                              &lvb, sizeof(lvb), lustre_swab_ost_lvb, lockh);
+                              NULL, 0, NULL, lockh);
 
         if (req != NULL) {
                 if (rc == ELDLM_LOCK_ABORTED) {
@@ -89,3 +89,4 @@ int mgc_enqueue(struct obd_export *exp, int lock_mode,
 
         RETURN(rc);
 }
+EXPORT_SYMBOL(mgc_enqueue)
index 2a04d12..a58c217 100644 (file)
@@ -189,6 +189,8 @@ static int mgc_setup(struct obd_device *obd, obd_count len, void *buf)
                 mgc_cleanup(obd);
                 RETURN(-ENOENT);
         }
+        INIT_LIST_HEAD(&mgc->mgc_open_llogs);
+
         RETURN(rc);
 
 err_rpc_lock:
@@ -197,7 +199,6 @@ err_rpc_lock:
         RETURN(rc);
 }
 
-
 static int mgc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                          void *karg, void *uarg)
 {
index c188756..6d064f9 100644 (file)
@@ -776,7 +776,6 @@ parse_out:
                 rc = rc2;
 
         RETURN(rc);
-
 }
 
 int class_config_dump_handler(struct llog_handle * handle,