RETURN (rc);
}
+int cmm_notify(struct md_device *md, struct obd_device *watched,
+ enum obd_notify_event ev, void *data)
+{
+ struct cmm_device *cmm_dev = md2cmm_dev(md);
+ int rc;
+
+ rc = cmm_child_ops(cmm_dev)->mdo_notify(cmm_dev->cmm_child, watched,
+ ev, data);
+
+ return rc;
+}
+
static struct md_device_operations cmm_md_ops = {
.mdo_root_get = cmm_root_get,
.mdo_statfs = cmm_statfs,
+ .mdo_notify = cmm_notify
};
extern struct lu_device_type mdc_device_type;
RETURN(err);
}
-int cmm_notify(const struct lu_context *ctx, struct lu_device *d,
- struct obd_device *watched, enum obd_notify_event ev,
- void *data)
-{
- struct cmm_device *m = lu2cmm_dev(d);
- struct lu_device *next = md2lu_dev(m->cmm_child);
- int err;
- ENTRY;
-
- err = next->ld_ops->ldo_notify(ctx, next, watched, ev, data);
-
- RETURN(err);
-
-}
static struct lu_device_operations cmm_lu_ops = {
.ldo_object_alloc = cmm_object_alloc,
.ldo_process_config = cmm_process_config,
- .ldo_notify = cmm_notify
};
/* --- lu_device_type operations --- */
int (*ldo_process_config)(const struct lu_context *ctx,
struct lu_device *, struct lustre_cfg *);
- /*
- * notify function for metadata stack
- */
- int (*ldo_notify)(const struct lu_context *ctx, struct lu_device *d,
- struct obd_device *watched, enum obd_notify_event ev,
- void *data);
-
};
/*
struct md_device *m, struct lu_fid *f);
int (*mdo_statfs)(const struct lu_context *ctx,
struct md_device *m, struct kstatfs *sfs);
+ /*
+ * notify function for metadata stack
+ */
+ int (*mdo_notify)(struct md_device *m, struct obd_device *watched,
+ enum obd_notify_event ev, void *data);
};
#define IOC_MDC_MAX_NR 50
#include <lustre/lustre_idl.h>
+#include <lu_object.h>
#include <lustre_lib.h>
#include <lustre_export.h>
#include <lustre_quota.h>
int md_lov_max_mdsize;
int md_lov_max_cookiesize;
struct semaphore md_lov_orphan_recovery_sem;
+ struct lu_context md_lov_ctxt;
struct md_lov_ops *md_lov_ops;
};
struct lu_device_operations mdd_lu_ops = {
.ldo_object_alloc = mdd_object_alloc,
.ldo_process_config = mdd_process_config,
- .ldo_notify = mdd_notify
};
static struct lu_object_operations mdd_lu_obj_ops = {
struct md_device_operations mdd_ops = {
.mdo_root_get = mdd_root_get,
.mdo_statfs = mdd_statfs,
+ .mdo_notify = mdd_notify
};
static struct md_dir_operations mdd_dir_ops = {
int mdd_lov_init(const struct lu_context *ctxt, struct mdd_device *mdd,
struct lustre_cfg *cfg);
int mdd_lov_fini(const struct lu_context *ctxt, struct mdd_device *mdd);
-int mdd_notify(const struct lu_context *ctxt, struct lu_device *ld,
- struct obd_device *watched, enum obd_notify_event ev,
- void *data);
+int mdd_notify(struct md_device *md, struct obd_device *watched,
+ enum obd_notify_event ev, void *data);
int mdd_xattr_set(const struct lu_context *ctxt, struct md_object *obj,
const void *buf, int buf_len, const char *name);
mli->md_lov_exp = NULL;
}
+ lu_context_fini(&mli->md_lov_ctxt);
dt_object_fini(mli->md_lov_objid_obj);
return 0;
}
rc = md_lov_connect(obd, lov_info, lov_name,
&obd->obd_uuid, &mdd_lov_ops, ctxt);
if (rc)
+ GOTO(out, rc);
+
+ rc = lu_context_init(&lov_info->md_lov_ctxt);
+out:
+ if (rc)
mdd_lov_fini(ctxt, mdd);
+
RETURN(rc);
}
-int mdd_notify(const struct lu_context *ctxt, struct lu_device *ld,
- struct obd_device *watched, enum obd_notify_event ev,
- void *data)
+int mdd_notify(struct md_device *md, struct obd_device *watched,
+ enum obd_notify_event ev, void *data)
{
- struct mdd_device *mdd = lu2mdd_dev(ld);
- struct obd_device *obd = ld->ld_site->ls_top_dev->ld_obd;
+ struct mdd_device *mdd = lu2mdd_dev(&md->md_lu_dev);
+ struct obd_device *obd = md2lu_dev(md)->ld_site->ls_top_dev->ld_obd;
int rc = 0;
ENTRY;
rc = 0;
RETURN(rc);
}
-
- rc = md_lov_start_synchronize(obd, &mdd->mdd_lov_info, watched, data,
- !(ev == OBD_NOTIFY_SYNC), ctxt);
-
+
+ lu_context_enter(&mdd->mdd_lov_info.md_lov_ctxt);
+ rc = md_lov_start_synchronize(obd, &mdd->mdd_lov_info, watched, data,
+ !(ev == OBD_NOTIFY_SYNC),
+ &mdd->mdd_lov_info.md_lov_ctxt);
+ lu_context_exit(&mdd->mdd_lov_info.md_lov_ctxt);
+
RETURN(rc);
}
disconnect the LOV. This of course means a cleanup won't
finish for as long as the sync is blocking. */
class_incref(obd);
-#if 0
if (nonblock) {
/* Synchronize in the background */
rc = cfs_kernel_thread(mds_lov_synchronize, mlsi,
} else {
rc = __mds_lov_synchronize((void *)mlsi);
}
-#else
- rc = __mds_lov_synchronize((void *)mlsi);
-#endif
RETURN(rc);
}
EXPORT_SYMBOL(md_lov_start_synchronize);
enum obd_notify_event ev, void *data)
{
struct mdt_device *mdt;
- struct lu_device *next;
- struct lu_context ctxt;
+ struct md_device *next;
int rc;
ENTRY;
- /*FIXME: allocation here may have some problems :( */
- rc = lu_context_init(&ctxt);
- if (rc)
- GOTO(out, rc);
-
mdt = mdt_dev(obd->obd_lu_dev);
- next = md2lu_dev(mdt->mdt_child);
+ next = mdt->mdt_child;
- lu_context_enter(&ctxt);
- rc = next->ld_ops->ldo_notify(&ctxt, next, watched, ev, data);
- lu_context_exit(&ctxt);
-out:
- lu_context_fini(&ctxt);
+ rc = next->md_ops->mdo_notify(next, watched, ev, data);
+
RETURN(rc);
}