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;
struct llog_log_hdr {
struct llog_rec_hdr llh_hdr;
+ __u64 llh_version;
__u64 llh_timestamp;
__u32 llh_count;
__u32 llh_bitmap_offset;
struct llogd_body {
struct llog_logid lgd_logid;
+ __u64 lgd_local_version;
__u32 lgd_ctxt_idx;
__u32 lgd_llh_flags;
__u32 lgd_index;
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;
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 */
}
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;
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);
}
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 {
#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)
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) {
RETURN(rc);
}
+EXPORT_SYMBOL(mgc_enqueue)
mgc_cleanup(obd);
RETURN(-ENOENT);
}
+ INIT_LIST_HEAD(&mgc->mgc_open_llogs);
+
RETURN(rc);
err_rpc_lock:
RETURN(rc);
}
-
static int mgc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
void *karg, void *uarg)
{
rc = rc2;
RETURN(rc);
-
}
int class_config_dump_handler(struct llog_handle * handle,