data->ocd_brw_size = MD_MAX_BRW_SIZE;
err = obd_connect(NULL, &sbi->ll_md_exp, sbi->ll_md_obd,
- &sbi->ll_sb_uuid, data, NULL);
+ &sbi->ll_sb_uuid, data, sbi->ll_cache);
if (err == -EBUSY) {
LCONSOLE_ERROR_MSG(0x14f, "An MDT (md %s) is performing "
"recovery, of which this client is not a "
data->ocd_brw_size = DT_MAX_BRW_SIZE;
err = obd_connect(NULL, &sbi->ll_dt_exp, sbi->ll_dt_obd,
- &sbi->ll_sb_uuid, data, NULL);
+ &sbi->ll_sb_uuid, data, sbi->ll_cache);
if (err == -EBUSY) {
LCONSOLE_ERROR_MSG(0x150, "An OST (dt %s) is performing "
"recovery, of which this client is not a "
}
cl_sb_init(sb);
- err = obd_set_info_async(NULL, sbi->ll_dt_exp, sizeof(KEY_CACHE_SET),
- KEY_CACHE_SET, sizeof(*sbi->ll_cache),
- sbi->ll_cache, NULL);
- if (err) {
- CERROR("%s: Set cache_set failed: rc = %d\n",
- sbi->ll_dt_exp->exp_obd->obd_name, err);
- GOTO(out_root, err);
- }
-
sb->s_root = d_make_root(root);
if (sb->s_root == NULL) {
CERROR("%s: can't make root dentry\n",
static int lov_notify(struct obd_device *obd, struct obd_device *watched,
enum obd_notify_event ev);
-int lov_connect_obd(struct obd_device *obd, u32 index, int activate,
+int lov_connect_osc(struct obd_device *obd, u32 index, int activate,
struct obd_connect_data *data)
{
struct lov_obd *lov = &obd->u.lov;
RETURN(rc);
}
+ if (imp->imp_invalid) {
+ CDEBUG(D_CONFIG, "%s: not connecting - administratively disabled\n",
+ obd_uuid2str(tgt_uuid));
+ RETURN(0);
+ }
- if (imp->imp_invalid) {
- CDEBUG(D_CONFIG, "not connecting OSC %s; administratively "
- "disabled\n", obd_uuid2str(tgt_uuid));
- RETURN(0);
- }
-
- rc = obd_connect(NULL, &lov->lov_tgts[index]->ltd_exp, tgt_obd,
- &lov_osc_uuid, data, NULL);
+ rc = obd_connect(NULL, &lov->lov_tgts[index]->ltd_exp, tgt_obd,
+ &lov_osc_uuid, data, lov->lov_cache);
if (rc || !lov->lov_tgts[index]->ltd_exp) {
CERROR("Target %s connect error %d\n",
obd_uuid2str(tgt_uuid), rc);
lov_tgts_getref(obd);
- for (i = 0; i < lov->desc.ld_tgt_count; i++) {
- tgt = lov->lov_tgts[i];
- if (!tgt || obd_uuid_empty(&tgt->ltd_uuid))
- continue;
- /* Flags will be lowest common denominator */
- rc = lov_connect_obd(obd, i, tgt->ltd_activate, &lov->lov_ocd);
+ if (localdata) {
+ lov->lov_cache = localdata;
+ cl_cache_incref(lov->lov_cache);
+ }
+
+ for (i = 0; i < lov->desc.ld_tgt_count; i++) {
+ tgt = lov->lov_tgts[i];
+ if (!tgt || obd_uuid_empty(&tgt->ltd_uuid))
+ continue;
+ /* Flags will be lowest common denominator */
+ rc = lov_connect_osc(obd, i, tgt->ltd_activate, &lov->lov_ocd);
if (rc) {
CERROR("%s: lov connect tgt %d failed: %d\n",
obd->obd_name, i, rc);
struct obd_uuid lov_osc_uuid = {"LOV_OSC_UUID"};
rc = obd_connect(NULL, &tgt->ltd_exp, tgt->ltd_obd,
- &lov_osc_uuid, &lov->lov_ocd, NULL);
+ &lov_osc_uuid, &lov->lov_ocd,
+ lov->lov_cache);
if (rc || tgt->ltd_exp == NULL)
GOTO(out, index = rc);
- rc = obd_set_info_async(NULL, tgt->ltd_exp,
- sizeof(KEY_CACHE_SET),
- KEY_CACHE_SET,
- sizeof(struct cl_client_cache),
- lov->lov_cache, NULL);
- if (rc < 0)
- GOTO(out, index = rc);
}
if (lov->lov_tgts[index]->ltd_activate == activate) {
CDEBUG(D_CONFIG, "idx=%d ltd_gen=%d ld_tgt_count=%d\n",
index, tgt->ltd_gen, lov->desc.ld_tgt_count);
- if (lov->lov_connects == 0) {
- /* lov_connect hasn't been called yet. We'll do the
- lov_connect_obd on this target when that fn first runs,
- because we don't know the connect flags yet. */
- RETURN(0);
- }
+ if (lov->lov_connects == 0) {
+ /* lov_connect hasn't been called yet. We'll do the
+ lov_connect_osc on this target when that fn first runs,
+ because we don't know the connect flags yet. */
+ RETURN(0);
+ }
lov_tgts_getref(obd);
- rc = lov_connect_obd(obd, index, active, &lov->lov_ocd);
+ rc = lov_connect_osc(obd, index, active, &lov->lov_ocd);
if (rc)
GOTO(out, rc);
if (!tgt->ltd_exp)
GOTO(out, rc = 0);
- if (lov->lov_cache != NULL) {
- rc = obd_set_info_async(NULL, tgt->ltd_exp,
- sizeof(KEY_CACHE_SET), KEY_CACHE_SET,
- sizeof(struct cl_client_cache), lov->lov_cache,
- NULL);
- if (rc < 0)
- GOTO(out, rc);
- }
-
rc = lov_notify(obd, tgt->ltd_exp->exp_obd,
active ? OBD_NOTIFY_CONNECT : OBD_NOTIFY_INACTIVE);
lov_tgts_getref(obddev);
- if (KEY_IS(KEY_CHECKSUM)) {
- do_inactive = true;
- } else if (KEY_IS(KEY_CACHE_SET)) {
- LASSERT(lov->lov_cache == NULL);
- lov->lov_cache = val;
+ if (KEY_IS(KEY_CHECKSUM))
do_inactive = true;
- cl_cache_incref(lov->lov_cache);
- }
for (i = 0; i < lov->desc.ld_tgt_count; i++) {
tgt = lov->lov_tgts[i];
RETURN(0);
}
- if (KEY_IS(KEY_CACHE_SET)) {
- struct client_obd *cli = &obd->u.cli;
-
- LASSERT(cli->cl_cache == NULL); /* only once */
- cli->cl_cache = (struct cl_client_cache *)val;
- cl_cache_incref(cli->cl_cache);
- cli->cl_lru_left = &cli->cl_cache->ccc_lru_left;
-
- /* add this osc into entity list */
- LASSERT(list_empty(&cli->cl_lru_osc));
- spin_lock(&cli->cl_cache->ccc_lru_lock);
- list_add(&cli->cl_lru_osc, &cli->cl_cache->ccc_lru);
- spin_unlock(&cli->cl_cache->ccc_lru_lock);
-
- RETURN(0);
- }
-
if (KEY_IS(KEY_CACHE_LRU_SHRINK)) {
struct client_obd *cli = &obd->u.cli;
long nr = atomic_long_read(&cli->cl_lru_in_list) >> 1;
.o_cleanup = osc_cleanup_common,
.o_add_conn = client_import_add_conn,
.o_del_conn = client_import_del_conn,
- .o_connect = client_connect_import,
+ .o_connect = client_connect_import,
.o_reconnect = osc_reconnect,
.o_disconnect = osc_disconnect,
.o_statfs = osc_statfs,