sizeof(lsm->lsm_oinfo[0])))
return (-EFAULT);
}
- return (0);
+ return 0;
}
static int
((__u64)lsm->lsm_stripe_size * lsm->lsm_stripe_count > ~0UL))
return (-EINVAL);
+
for (i = 0; i < lsm->lsm_stripe_count; i++) {
if (copy_from_user(lsm->lsm_oinfo[i],
((struct lov_stripe_md *)ulsm)->lsm_oinfo[i],
sizeof(lsm->lsm_oinfo[0])))
return (-EFAULT);
}
-
return (0);
}
struct echo_client_obd *ec = &obd->u.echo_client;
LASSERT (eco->eco_refcount == 0);
- if (!eco->eco_lsm)
+ if (!eco->eco_lsm)
CERROR("No object %s\n", obd->obd_name);
- else
+ else
obd_free_memmd(ec->ec_exp, &eco->eco_lsm);
OBD_FREE (eco, sizeof (*eco));
}
if (ulsm != NULL) {
eco = echo_allocate_object (obd);
- if (eco == NULL)
+ if (eco == NULL)
return (-ENOMEM);
lsm = eco->eco_lsm;
*offp = offset * stripe_size + woffset % stripe_size;
}
-static void
-echo_client_page_debug_setup(struct lov_stripe_md *lsm,
- cfs_page_t *page, int rw, obd_id id,
+static void
+echo_client_page_debug_setup(struct lov_stripe_md *lsm,
+ cfs_page_t *page, int rw, obd_id id,
obd_off offset, obd_off count)
{
char *addr;
stripe_off = 0xdeadbeef00c0ffeeULL;
stripe_id = 0xdeadbeef00c0ffeeULL;
}
- block_debug_setup(addr + delta, OBD_ECHO_BLOCK_SIZE,
+ block_debug_setup(addr + delta, OBD_ECHO_BLOCK_SIZE,
stripe_off, stripe_id);
}
cfs_kunmap(page);
}
-static int
-echo_client_page_debug_check(struct lov_stripe_md *lsm,
- cfs_page_t *page, obd_id id,
- obd_off offset, obd_off count)
+static int echo_client_page_debug_check(struct lov_stripe_md *lsm,
+ cfs_page_t *page, obd_id id,
+ obd_off offset, obd_off count)
{
obd_off stripe_off;
obd_id stripe_id;
stripe_id = id;
echo_get_stripe_off_id (lsm, &stripe_off, &stripe_id);
- rc2 = block_debug_check("test_brw",
- addr + delta, OBD_ECHO_BLOCK_SIZE,
+ rc2 = block_debug_check("test_brw",
+ addr + delta, OBD_ECHO_BLOCK_SIZE,
stripe_off, stripe_id);
if (rc2 != 0) {
CERROR ("Error in echo object "LPX64"\n", id);
obd_off offset, obd_size count, char *buffer,
struct obd_trans_info *oti)
{
- /* echo_client_ubrw() needs to be ported on 2.6 yet */
+#warning "echo_client_ubrw() needs to be ported on 2.6 yet"
LBUG();
return 0;
}
eas->eas_oa.o_id != ECHO_PERSISTENT_OBJID &&
(eas->eas_oa.o_valid & OBD_MD_FLFLAGS) != 0 &&
(eas->eas_oa.o_flags & OBD_FL_DEBUG_CHECK) != 0)
- echo_client_page_debug_check(eas->eas_lsm, eap->eap_page,
+ echo_client_page_debug_check(eas->eas_lsm, eap->eap_page,
eas->eas_oa.o_id, eap->eap_off,
CFS_PAGE_SIZE);
/* sleep until we have a page to send */
spin_unlock(&eas.eas_lock);
- rc = wait_event_interruptible(eas.eas_waitq,
+ rc = wait_event_interruptible(eas.eas_waitq,
eas_should_wake(&eas));
spin_lock(&eas.eas_lock);
if (rc && !eas.eas_rc)
/* unbind the eap from its old page offset */
if (eap->eap_cookie != NULL) {
- obd_teardown_async_page(exp, lsm, NULL,
+ obd_teardown_async_page(exp, lsm, NULL,
eap->eap_cookie);
eap->eap_cookie = NULL;
}
if (oa->o_id != ECHO_PERSISTENT_OBJID &&
(oa->o_valid & OBD_MD_FLFLAGS) != 0 &&
(oa->o_flags & OBD_FL_DEBUG_CHECK) != 0)
- echo_client_page_debug_setup(lsm, eap->eap_page, rw,
- oa->o_id,
+ echo_client_page_debug_setup(lsm, eap->eap_page, rw,
+ oa->o_id,
eap->eap_off, CFS_PAGE_SIZE);
/* always asserts urgent, which isn't quite right */
eas.eas_in_flight++;
if (eas.eas_next_offset == eas.eas_end_offset)
break;
- }
+ }
/* still hold the eas_lock here.. */
/* now we just spin waiting for all the rpcs to complete */
while(eas.eas_in_flight) {
spin_unlock(&eas.eas_lock);
- wait_event_interruptible(eas.eas_waitq,
+ wait_event_interruptible(eas.eas_waitq,
eas.eas_in_flight == 0);
spin_lock(&eas.eas_lock);
}
static int echo_client_prep_commit(struct obd_export *exp, int rw,
struct obdo *oa, struct lov_stripe_md *lsm,
- obd_off offset, obd_size count,
+ obd_off offset, obd_size count,
obd_size batch, struct obd_trans_info *oti)
{
struct obd_ioobj ioo;
ioo.ioo_bufcnt = npages;
oti->oti_transno = 0;
- ret = obd_preprw(rw, exp, oa, 1, &ioo, npages, rnb, lnb, oti);
+ ret = obd_preprw(rw, exp, oa, 1, &ioo, npages, rnb, lnb, oti,
+ NULL);
if (ret != 0)
GOTO(out, ret);
case OBD_IOC_DESTROY:
if (!capable (CAP_SYS_ADMIN))
GOTO (out, rc = -EPERM);
+
rc = echo_get_object (&eco, obd, &data->ioc_obdo1);
if (rc == 0) {
oa = &data->ioc_obdo1;
out:
/* XXX this should be in a helper also called by target_send_reply */
- for (ack_lock = dummy_oti.oti_ack_locks, i = 0; i < 4;
+ for (ack_lock = dummy_oti.oti_ack_locks, i = 0; i < 4;
i++, ack_lock++) {
if (!ack_lock->mode)
break;
return rc;
}
-static int
-echo_client_setup(struct obd_device *obddev, obd_count len, void *buf)
+static int echo_client_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
{
- struct lustre_cfg* lcfg = buf;
struct echo_client_obd *ec = &obddev->u.echo_client;
struct obd_device *tgt;
struct lustre_handle conn = {0, };
return -ENOMEM;
}
- ocd->ocd_connect_flags = OBD_CONNECT_VERSION;
+ ocd->ocd_connect_flags = OBD_CONNECT_VERSION | OBD_CONNECT_REQPORTAL;
ocd->ocd_version = LUSTRE_VERSION_CODE;
+ ocd->ocd_group = FILTER_GROUP_ECHO;
- rc = obd_connect(&conn, tgt, &echo_uuid, ocd);
+ rc = obd_connect(NULL, &conn, tgt, &echo_uuid, ocd);
OBD_FREE(ocd, sizeof(*ocd));
RETURN(rc);
}
-static int echo_client_connect(struct lustre_handle *conn,
+static int echo_client_connect(const struct lu_env *env,
+ struct lustre_handle *conn,
struct obd_device *src, struct obd_uuid *cluuid,
struct obd_connect_data *data)
{
struct lprocfs_static_vars lvars;
lprocfs_init_vars(echo, &lvars);
- return class_register_type(&echo_obd_ops, lvars.module_vars,
- LUSTRE_ECHO_CLIENT_NAME);
+ return class_register_type(&echo_obd_ops, NULL, lvars.module_vars,
+ LUSTRE_ECHO_CLIENT_NAME, NULL);
}
void echo_client_exit(void)