* Use is subject to license terms.
*/
/*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*/
/* Passed as data param to class_config_parse_llog */
struct config_llog_instance {
- char * cfg_instance;
char * cfg_obdname;
+ char cfg_instance[sizeof(void*) * 2 + 1];
struct super_block *cfg_sb;
struct obd_uuid cfg_uuid;
int cfg_last_idx; /* for partial llog processing */
RETURN(rc);
}
+static inline void obd_cleanup_client_import(struct obd_device *obd)
+{
+ ENTRY;
+
+ /* If we set up but never connected, the
+ client import will not have been cleaned. */
+ cfs_down_write(&obd->u.cli.cl_sem);
+ if (obd->u.cli.cl_import) {
+ struct obd_import *imp;
+ imp = obd->u.cli.cl_import;
+ CDEBUG(D_CONFIG, "%s: client import never connected\n",
+ obd->obd_name);
+ ptlrpc_invalidate_import(imp);
+ if (imp->imp_rq_pool) {
+ ptlrpc_free_rq_pool(imp->imp_rq_pool);
+ imp->imp_rq_pool = NULL;
+ }
+ class_destroy_import(imp);
+ obd->u.cli.cl_import = NULL;
+ }
+ cfs_up_write(&obd->u.cli.cl_sem);
+
+ EXIT;
+}
+
static inline int
obd_process_config(struct obd_device *obd, int datalen, void *data)
{
RETURN(rc);
}
-static inline int obd_sync(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md *ea, obd_size start,
- obd_size end, void *capa)
+static inline int obd_sync_rqset(struct obd_export *exp, struct obd_info *oinfo,
+ obd_size start, obd_size end)
+{
+ struct ptlrpc_request_set *set = NULL;
+ int rc;
+ ENTRY;
+
+ OBD_CHECK_DT_OP(exp->exp_obd, sync, -EOPNOTSUPP);
+ EXP_COUNTER_INCREMENT(exp, sync);
+
+ set = ptlrpc_prep_set();
+ if (set == NULL)
+ RETURN(-ENOMEM);
+
+ rc = OBP(exp->exp_obd, sync)(exp, oinfo, start, end, set);
+ if (rc == 0)
+ rc = ptlrpc_set_wait(set);
+ ptlrpc_set_destroy(set);
+ RETURN(rc);
+}
+
+static inline int obd_sync(struct obd_export *exp, struct obd_info *oinfo,
+ obd_size start, obd_size end,
+ struct ptlrpc_request_set *set)
{
int rc;
ENTRY;
OBD_CHECK_DT_OP(exp->exp_obd, sync, -EOPNOTSUPP);
EXP_COUNTER_INCREMENT(exp, sync);
- rc = OBP(exp->exp_obd, sync)(exp, oa, ea, start, end, capa);
+ rc = OBP(exp->exp_obd, sync)(exp, oinfo, start, end, set);
RETURN(rc);
}
static inline int md_readpage(struct obd_export *exp, const struct lu_fid *fid,
struct obd_capa *oc, __u64 offset,
- struct page *page,
+ struct page **pages, unsigned npages,
struct ptlrpc_request **request)
{
int rc;
ENTRY;
EXP_CHECK_MD_OP(exp, readpage);
EXP_MD_COUNTER_INCREMENT(exp, readpage);
- rc = MDP(exp->exp_obd, readpage)(exp, fid, oc, offset, page, request);
+ rc = MDP(exp->exp_obd, readpage)(exp, fid, oc, offset, pages, npages,
+ request);
RETURN(rc);
}