CDEBUG(D_OTHER, "GETATTR for "DLID4" %s\n",
OLID4(id), obj ? "(splitted)" : "");
- /* if object is splitted, then we loop over all the slaves and gather
+ /*
+ * if object is splitted, then we loop over all the slaves and gather
* size attribute. In ideal world we would have to gather also mds field
* from all slaves, as object is spread over the cluster and this is
* definitely interesting information and it is not good to loss it,
- * but...*/
+ * but...
+ */
if (obj) {
struct mds_body *body;
op_data->name, OLID4(&op_data->id1));
rc = md_create(lmv->tgts[id_group(&op_data->id1)].ltd_exp,
- op_data, data, datalen, mode, uid, gid, rdev, request);
+ op_data, data, datalen, mode, uid, gid, rdev,
+ request);
if (rc == 0) {
if (*request == NULL)
RETURN(rc);
body = lustre_msg_buf((*request)->rq_repmsg, 0,
sizeof(*body));
- LASSERT(body != NULL);
+ if (body == NULL)
+ RETURN(-ENOMEM);
CDEBUG(D_OTHER, "created. "DLID4"\n", OLID4(&op_data->id1));
-
-/* LASSERT(body->valid & OBD_MD_MDS ||
- body->mds == id_group(&op_data->id1));*/
} else if (rc == -ERESTART) {
- /* directory got splitted. time to update local object and
- * repeat the request with proper MDS */
+ /*
+ * directory got splitted. time to update local object and
+ * repeat the request with proper MDS.
+ */
rc = lmv_get_mea_and_update_object(exp, &op_data->id1);
if (rc == 0) {
ptlrpc_req_finished(*request);
RETURN(rc);
}
+/*
+ * commented for a while, as it will not work in the case when splitted dir is
+ * created from ll_mkdir_stripe(), because mds_reint_create() returns 0 inthis
+ * case even if there is created splitted dir with passed number of stripes. So
+ * mds_reint_create() and lmv_create() need to be fixed first.
+ */
int lmv_put_inode(struct obd_export *exp, struct lustre_id *id)
{
ENTRY;
- lmv_delete_obj(exp, id);
+// lmv_delete_obj(exp, id);
RETURN(0);
}
/* mds asks to remove slave objects */
rc = lmv_unlink_slaves(exp, data, request);
RETURN(rc);
- } else if (data->namelen != 0) {
+ }
+
+ if (data->namelen != 0) {
struct lmv_obj *obj;
obj = lmv_grab_obj(obd, &data->id1);
RETURN(ERR_PTR(rc));
obd = lmv->tgts[0].ltd_exp->exp_obd;
EXIT;
+
return obd;
}
-int lmv_init_ea_size(struct obd_export *exp, int easize, int cookiesize)
+int lmv_init_ea_size(struct obd_export *exp, int easize,
+ int cookiesize)
{
struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv;
LASSERT(mea->mea_magic == MEA_MAGIC_LAST_CHAR
|| mea->mea_magic == MEA_MAGIC_ALL_CHARS);
- OBD_SLAB_ALLOC(obj, obj_cache, GFP_NOFS, sizeof(*obj));
+ OBD_SLAB_ALLOC(obj, obj_cache, GFP_NOFS,
+ sizeof(*obj));
if (!obj)
return NULL;
if (obj->state & O_FREEING)
continue;
+ /*
+ * we should make sure, that we have found object belong to
+ * passed obd. It is possible that, object manager will have two
+ * objects with the same fid belong to different obds, if client
+ * and mds runs on the same host. May be it is good idea to have
+ * objects list assosiated with obd.
+ */
+ if (obj->obd != obd)
+ continue;
+
/* check if this is what we're looking for. */
if (id_equal_fid(&obj->id, id))
return __get_obj(obj);
return obj;
}
-/* looks for object with @id and orders to destroy it. It is possible the
- * object will not be destroyed right now, because it is still using by
- * someone. In this case it will be marked as "freeing" and will not be
- * accessible anymore for subsequent callers of lmv_grab_obj(). */
+/*
+ * looks for object with @id and orders to destroy it. It is possible the object
+ * will not be destroyed right now, because it is still using by someone. In
+ * this case it will be marked as "freeing" and will not be accessible anymore
+ * for subsequent callers of lmv_grab_obj().
+ */
int
lmv_delete_obj(struct obd_export *exp, struct lustre_id *id)
{
__put_obj(obj);
rc = 1;
}
-
spin_unlock(&obj_list_lock);
+
RETURN(rc);
}
int
lmv_setup_mgr(struct obd_device *obd)
{
+ ENTRY;
LASSERT(obd != NULL);
CDEBUG(D_INFO, "LMV object manager setup (%s)\n",
obd->obd_uuid.uuid);
- return 0;
+ RETURN(0);
}
void
lmv_cleanup_mgr(struct obd_device *obd)
{
- struct lmv_obj *obj;
struct list_head *cur, *tmp;
+ struct lmv_obj *obj;
+ ENTRY;
CDEBUG(D_INFO, "LMV object manager cleanup (%s)\n",
obd->obd_uuid.uuid);
__put_obj(obj);
}
spin_unlock(&obj_list_lock);
+ EXIT;
}