struct seq_thread_info *info;
struct dt_device *dt_dev;
struct thandle *th;
- loff_t pos = 0;
+ loff_t pos;
int rc;
ENTRY;
/* store ranges in le format */
range_to_le(&info->sti_record.ssr_space, &seq->lss_space);
range_to_le(&info->sti_record.ssr_super, &seq->lss_super);
+
+ /*
+ * Regular seq server stores its ranges at posision 0 and
+ * controller at position of sizeof(info->sti_record).
+ */
+ pos = (seq->lss_type == LUSTRE_SEQ_SERVER) ? 0 :
+ sizeof(info->sti_record);
rc = dt_obj->do_body_ops->dbo_write(ctx, dt_obj,
(char *)&info->sti_record,
{
struct dt_object *dt_obj = seq->lss_obj;
struct seq_thread_info *info;
- loff_t pos = 0;
+ loff_t pos;
int rc;
ENTRY;
info = lu_context_key_get(ctx, &seq_thread_key);
LASSERT(info != NULL);
+ /*
+ * Regular seq server stores its ranges at posision 0 and controller at
+ * position of sizeof(info->sti_record).
+ */
+ pos = (seq->lss_type == LUSTRE_SEQ_SERVER) ? 0 :
+ sizeof(info->sti_record);
+
rc = dt_obj->do_body_ops->dbo_read(ctx, dt_obj,
(char *)&info->sti_record,
sizeof(info->sti_record), &pos);
+
if (rc == sizeof(info->sti_record)) {
seq->lss_space = info->sti_record.ssr_space;
lustre_swab_lu_range(&seq->lss_space);
struct mdt_handler *mos_hs;
};
-static struct mdt_opc_slice mdt_handlers[];
+static struct mdt_opc_slice mdt_regular_handlers[];
static struct mdt_opc_slice mdt_readpage_handlers[];
-static int mdt_handle (struct ptlrpc_request *req);
-static struct mdt_device *mdt_dev (struct lu_device *d);
+static struct mdt_device *mdt_dev(struct lu_device *d);
+static int mdt_regular_handle(struct ptlrpc_request *req);
static int mdt_unpack_req_pack_rep(struct mdt_thread_info *info, __u32 flags);
static struct lu_object_operations mdt_obj_ops;
struct ptlrpc_request *req;
req = mdt_info_req(info);
- result = target_handle_connect(req, mdt_handle);
+ result = target_handle_connect(req, mdt_regular_handle);
if (result == 0) {
LASSERT(req->rq_export != NULL);
info->mti_mdt = mdt_dev(req->rq_export->exp_obd->obd_lu_dev);
RETURN(rc);
}
-static int mdt_handle_quotacheck(struct mdt_thread_info *info)
+static int mdt_quotacheck_handle(struct mdt_thread_info *info)
{
return -EOPNOTSUPP;
}
-static int mdt_handle_quotactl(struct mdt_thread_info *info)
+static int mdt_quotactl_handle(struct mdt_thread_info *info)
{
return -EOPNOTSUPP;
}
/*
* OBD PING and other handlers.
*/
-
static int mdt_obd_ping(struct mdt_thread_info *info)
{
int result;
RETURN(result);
}
-static int mdt_handle(struct ptlrpc_request *req)
+static int mdt_regular_handle(struct ptlrpc_request *req)
{
- return mdt_handle_common(req, mdt_handlers);
+ return mdt_handle_common(req, mdt_regular_handlers);
}
static int mdt_readpage_handle(struct ptlrpc_request *req)
"mdt_ldlm_client", m->mdt_ldlm_client);
m->mdt_service =
- ptlrpc_init_svc_conf(&conf, mdt_handle, LUSTRE_MDT0_NAME,
+ ptlrpc_init_svc_conf(&conf, mdt_regular_handle, LUSTRE_MDT0_NAME,
m->mdt_md_dev.md_lu_dev.ld_proc_entry,
NULL);
if (m->mdt_service == NULL)
};
m->mdt_setattr_service =
- ptlrpc_init_svc_conf(&conf, mdt_handle,
+ ptlrpc_init_svc_conf(&conf, mdt_regular_handle,
LUSTRE_MDT0_NAME "_setattr",
m->mdt_md_dev.md_lu_dev.ld_proc_entry,
NULL);
/*
* context key constructor/destructor
*/
-
static void *mdt_thread_init(const struct lu_context *ctx,
struct lu_context_key *key)
{
DEF_MDT_HNDL_0(0, DONE_WRITING, mdt_done_writing),
DEF_MDT_HNDL_F(0 |HABEO_REFERO, PIN, mdt_pin),
DEF_MDT_HNDL_0(0, SYNC, mdt_sync),
-DEF_MDT_HNDL_0(0, QUOTACHECK, mdt_handle_quotacheck),
-DEF_MDT_HNDL_0(0, QUOTACTL, mdt_handle_quotactl)
+DEF_MDT_HNDL_0(0, QUOTACHECK, mdt_quotacheck_handle),
+DEF_MDT_HNDL_0(0, QUOTACTL, mdt_quotactl_handle)
};
#define DEF_OBD_HNDL(flags, name, fn) \
static struct mdt_handler mdt_llog_ops[] = {
};
-static struct mdt_opc_slice mdt_handlers[] = {
+static struct mdt_opc_slice mdt_regular_handlers[] = {
{
.mos_opc_start = MDS_GETATTR,
.mos_opc_end = MDS_LAST_OPC,
}
};
-static struct mdt_handler mdt_mds_readpage_ops[] = {
+static struct mdt_handler mdt_readpage_ops[] = {
DEF_MDT_HNDL_F(HABEO_CORPUS|HABEO_REFERO, READPAGE, mdt_readpage),
/*
* XXX: this is ugly and should be fixed one day, see mdc_close() for
* detailed comment. --umka
*/
- DEF_MDT_HNDL_F(HABEO_CORPUS , CLOSE, mdt_close),
+ DEF_MDT_HNDL_F(HABEO_CORPUS, CLOSE, mdt_close),
};
static struct mdt_opc_slice mdt_readpage_handlers[] = {
{
.mos_opc_start = MDS_GETATTR,
.mos_opc_end = MDS_LAST_OPC,
- .mos_hs = mdt_mds_readpage_ops
+ .mos_hs = mdt_readpage_ops
},
{
.mos_hs = NULL