struct lustre_md md;
kdev_t devno;
int err;
+ ENTRY;
obd = class_name2obd(lmv);
if (!obd) {
CERROR("could not register mount in /proc/lustre");
}
- err = obd_connect(&lmv_conn, obd, &sbi->ll_sb_uuid, 0);
+ err = obd_connect(&lmv_conn, obd, &sbi->ll_sb_uuid, OBD_OPT_REAL_CLIENT);
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_lmv, err);
}
- err = obd_connect(&lov_conn, obd, &sbi->ll_sb_uuid, 0);
+ err = obd_connect(&lov_conn, obd, &sbi->ll_sb_uuid, OBD_OPT_REAL_CLIENT);
if (err == -EBUSY) {
CERROR("An OST (osc %s) is performing recovery, of which this"
" client is not a part. Please wait for recovery to "
GOTO(out_lov, err);
}
- LASSERT(sbi->ll_rootid.li_stc.u.e3s.l3s_ino != 0);
- root = ll_iget(sb, sbi->ll_rootid.li_stc.u.e3s.l3s_ino, &md);
+ LASSERT(id_ino(&sbi->ll_rootid) != 0);
+ root = ll_iget(sb, id_ino(&sbi->ll_rootid), &md);
ptlrpc_req_finished(request);
#endif
RETURN(err);
-
out_root:
if (root)
iput(root);
obd_disconnect(sbi->ll_lmv_exp, 0);
out:
lprocfs_unregister_mountpoint(sbi);
- RETURN(err);
+ return err;
}
void lustre_common_put_super(struct super_block *sb)
}
err = lustre_common_fill_super(sb, lmv, lov);
+ EXIT;
out:
if (err)
lustre_free_sbi(sb);
OBD_FREE(lmv, strlen(lmv) + 1);
if (lov)
OBD_FREE(lov, strlen(lov) + 1);
- RETURN(err);
+ return err;
} /* ll_read_super */
static int lustre_process_log(struct lustre_mount_data *lmd, char *profile,
CERROR("class_config_process_llog failed: rc = %d\n", rc);
err = obd_disconnect(exp, 0);
-
+
+ EXIT;
out_cleanup:
LCFG_INIT(lcfg, LCFG_CLEANUP, name);
err = class_process_config(&lcfg);
if (rc == 0)
rc = err;
- RETURN(rc);
+ return rc;
}
int lustre_fill_super(struct super_block *sb, void *data, int silent)
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
inode->i_dev = (kdev_t)id_group(&lli->lli_id);
#endif
+ LASSERT(id_fid(&lli->lli_id) != 0);
+
LASSERT(!sbi->ll_lmv_desc.ld_tgt_count ||
id_group(&lli->lli_id) < sbi->ll_lmv_desc.ld_tgt_count);
}
}
}
-void ll_delete_inode(struct inode *inode)
+void ll_put_inode(struct inode *inode)
{
- int rc;
- struct lustre_id id;
struct ll_sb_info *sbi = ll_i2sbi(inode);
+ struct lustre_id id;
+ int rc;
ENTRY;
-
- ll_inode2id(&id, inode);
- rc = md_delete_object(sbi->ll_lmv_exp, &id);
- if (rc) {
- CERROR("md_delete_object() failed, error %d.\n",
- rc);
+ /*
+ * notifying metadata target that any in memory data assosiated
+ * with object @id should be removed.
+ */
+ if (atomic_read(&inode->i_count) == 1) {
+ ll_inode2id(&id, inode);
+
+ rc = md_put_inode(sbi->ll_lmv_exp, &id);
+ if (rc) {
+ CDEBUG("md_put_inode() failed, error %d\n",
+ rc);
+ }
}
- clear_inode(inode);
EXIT;
}
RETURN(rc);
}
+
+int ll_get_fid(struct obd_export *exp, struct lustre_id *idp,
+ char *filename, struct lustre_id *ret)
+{
+ struct ptlrpc_request *request = NULL;
+ struct mds_body *body;
+ int valid = 0;
+ int rc;
+
+ valid |= OBD_MD_FID;
+
+ rc = md_getattr_lock(exp, idp, filename, strlen(filename) + 1,
+ valid, 0, &request);
+ if (rc < 0) {
+ CDEBUG(D_INFO, "md_getattr_lock failed on %s: rc %d\n",
+ filename, rc);
+ return rc;
+ }
+
+ body = lustre_msg_buf(request->rq_repmsg, 0, sizeof(*body));
+ LASSERT(body != NULL);
+ LASSERT_REPSWABBED(request, 0);
+
+ *ret = body->id1;
+ ptlrpc_req_finished(request);
+
+ return rc;
+}