valsize = sizeof(desc);
rc = obd_get_info(sbi->ll_osc_exp, strlen("lovdesc") + 1, "lovdesc",
&valsize, &desc);
- if (rc == 0) {
- obd_init_ea_size(sbi->ll_mdc_exp,
- obd_size_diskmd(sbi->ll_osc_exp, NULL),
- desc.ld_tgt_count*sizeof(struct llog_cookie));
-
- /* declare ourself as real client. not connection
- * from another MDS
- * FIXME: remove fake valsize, mdsize --bzzz */
- rc = obd_set_info(sbi->ll_mdc_exp, strlen("client"),
- "client", valsize, &desc);
- }
- RETURN(rc);
-}
-#if CONFIG_SNAPFS
-int lustre_set_clone_info(struct super_block *sb, int clone_index)
-{
- struct ll_sb_info *sbi = ll_s2sbi(sb);
-
- ENTRY;
-
- CDEBUG(D_INFO, "set clone index %d\n", clone_index);
- if (!clone_index)
- RETURN(0);
-
- if (sbi->ll_mdc_exp) {
- struct obd_import *climp = class_exp2cliimp(sbi->ll_mdc_exp);
- struct client_obd *cl_obd = &climp->imp_obd->u.cli;
-
- OBD_ALLOC(cl_obd->cl_clone_info, sizeof(struct clonefs_info));
- if (!cl_obd->cl_clone_info)
- RETURN(-ENOMEM);
- SET_CLONE_INDEX(cl_obd->cl_clone_info, clone_index);
- SET_CLONE_FLAGS(cl_obd->cl_clone_info, SM_CLONE_FS);
- }
-
- if (sbi->ll_osc_exp) {
- struct obd_import *climp = class_exp2cliimp(sbi->ll_osc_exp);
- struct client_obd *cl_obd = &climp->imp_obd->u.cli;
-
- OBD_ALLOC(cl_obd->cl_clone_info, sizeof(struct clonefs_info));
- if (!cl_obd->cl_clone_info)
- RETURN(-ENOMEM);
- SET_CLONE_INDEX(cl_obd->cl_clone_info, clone_index);
- SET_CLONE_FLAGS(cl_obd->cl_clone_info, SM_CLONE_FS);
- }
- RETURN(0);
-}
-
-int lustre_cleanup_clone_info(struct super_block *sb)
-{
- struct ll_sb_info *sbi = ll_s2sbi(sb);
-
- ENTRY;
-
- if (sbi->ll_mdc_exp) {
- struct obd_import *climp = class_exp2cliimp(sbi->ll_mdc_exp);
- struct client_obd *cl_obd = &climp->imp_obd->u.cli;
+ if (rc)
+ RETURN(rc);
+ obd_init_ea_size(sbi->ll_mdc_exp, obd_size_diskmd(sbi->ll_osc_exp, NULL),
+ desc.ld_tgt_count*sizeof(struct llog_cookie));
- if (!cl_obd->cl_clone_info)
- RETURN(0);
- CDEBUG(D_INFO, "clean clone info %p\n", cl_obd->cl_clone_info);
- OBD_FREE(cl_obd->cl_clone_info, sizeof(struct clonefs_info));
- }
-
- if (sbi->ll_osc_exp) {
- struct obd_import *climp = class_exp2cliimp(sbi->ll_osc_exp);
- struct client_obd *cl_obd = &climp->imp_obd->u.cli;
-
- if (!cl_obd->cl_clone_info)
- RETURN(0);
- CDEBUG(D_INFO, "clean clone info %p\n", cl_obd->cl_clone_info);
- OBD_FREE(cl_obd->cl_clone_info, sizeof(struct clonefs_info));
- }
- RETURN(0);
+ RETURN(rc);
}
-#endif
-
int lustre_common_fill_super(struct super_block *sb, char *mdc, char *osc)
{
CERROR("could not register mount in /proc/lustre");
}
- err = obd_connect(&mdc_conn, obd, &sbi->ll_sb_uuid);
+ err = obd_connect(&mdc_conn, obd, &sbi->ll_sb_uuid, 0);
if (err == -EBUSY) {
CERROR("An MDS (mdc %s) is performing recovery, of which this"
" client is not a part. Please wait for recovery to "
GOTO(out_mdc, err);
}
- err = obd_connect(&osc_conn, obd, &sbi->ll_sb_uuid);
+ err = obd_connect(&osc_conn, obd, &sbi->ll_sb_uuid, 0);
if (err == -EBUSY) {
CERROR("An OST (osc %s) is performing recovery, of which this"
" client is not a part. Please wait for recovery to "
}
err = lustre_common_fill_super(sb, mdc, osc);
-#if CONFIG_SNAPFS
- if (clone_opts) {
- int clone_index = 0;
- char *endp;
-
- /*set clone info to the super block*/
- clone_index = simple_strtoul(clone_opts, &endp, 0);
- err = lustre_set_clone_info(sb, clone_index);
- }
-#endif
out:
if (err)
lustre_free_sbi(sb);
if (err)
GOTO(out_cleanup, err);
- err = obd_connect(&mdc_conn, obd, &mdc_uuid);
+ err = obd_connect(&mdc_conn, obd, &mdc_uuid, 0);
if (err) {
CERROR("cannot connect to %s: rc = %d\n", lmd->lmd_mds, err);
GOTO(out_cleanup, err);
if (err)
GOTO(out_free, err);
-
-#if CONFIG_SNAPFS
- if (lmd->lmd_clone_index) {
- err = lustre_set_clone_info(sb, lmd->lmd_clone_index);
- }
-
- if (err)
- GOTO(out_free, err);
-#endif
out_dev:
if (mdc)
}
OBD_FREE(sbi->ll_lmd, sizeof(*sbi->ll_lmd));
}
-#if CONFIG_SNAPFS
- lustre_cleanup_clone_info(sb);
-#endif
lustre_free_sbi(sb);
goto out_dev;
force_umount = obd->obd_no_recov;
obd = NULL;
-#if CONFIG_SNAPFS
- lustre_cleanup_clone_info(sb);
-#endif
-
lustre_common_put_super(sb);
if (sbi->ll_lmd != NULL) {
char * cln_prof;
int null_if_equal(struct ldlm_lock *lock, void *data)
{
- if (data == lock->l_ast_data)
+ if (data == lock->l_ast_data) {
lock->l_ast_data = NULL;
- if (lock->l_req_mode != lock->l_granted_mode)
- return LDLM_ITER_STOP;
+ if (lock->l_req_mode != lock->l_granted_mode)
+ LDLM_ERROR(lock,"clearing inode with ungranted lock\n");
+ }
return LDLM_ITER_CONTINUE;
}
return 0;
}
-void dump_lsm(int level, struct lov_stripe_md *lsm)
-{
- CDEBUG(level, "objid "LPX64", maxbytes "LPX64", magic 0x%08X, "
- "stripe_size %u, stripe_count %u\n",
- lsm->lsm_object_id, lsm->lsm_maxbytes, lsm->lsm_magic,
- lsm->lsm_stripe_size, lsm->lsm_stripe_count);
-}
-
void ll_update_inode(struct inode *inode, struct lustre_md *md)
{
struct ll_inode_info *lli = ll_i2info(inode);