* request to the right MDS */
mds = raw_name2idx(obj->objcount, (char *)name, len);
CDEBUG(D_OTHER, "forward to MDS #%u\n", mds);
-
rpfid = obj->objs[mds].fid;
lmv_put_obj(obj);
}
flags, reqp, cb_blocking);
if (rc != 0) {
LASSERT(rc < 0);
+ CERROR("can't handle remote %s: dir %lu/%lu/%lu(%lu/%lu/%lu):"
+ "%*s: %d\n", LL_IT2STR(it),
+ (unsigned long) pfid->mds,
+ (unsigned long) pfid->id,
+ (unsigned long) pfid->generation,
+ (unsigned long) rpfid.mds,
+ (unsigned long) rpfid.id,
+ (unsigned long) rpfid.generation,
+ len, name, rc);
RETURN(rc);
}
{
/* update size */
body->size += obj->size;
-
- /* update atime */
- /* update ctime */
- /* update mtime */
- /* update nlink */
+/* body->atime = obj->atime;
+ body->ctime = obj->ctime;
+ body->mtime = obj->mtime;
+ body->nlink = obj->nlink;*/
}
int lmv_lookup_slaves(struct obd_export *exp, struct ptlrpc_request **reqp)
* attributes to be returned from the slaves it's important that lookup
* is called in two cases:
- * - for first time (dcache has no such a resolving yet.
+ * - for first time (dcache has no such a resolving yet).
* - ->d_revalidate() returned false.
* last case possible only if all the objs (master and all slaves aren't
NULL, 0, NULL, 0, &fid, &it, 0, &req,
lmv_dirobj_blocking_ast);
- lockh = (struct lustre_handle *) &it.d.lustre.it_lock_handle;
+ lockh = (struct lustre_handle *)&it.d.lustre.it_lock_handle;
if (rc > 0) {
/* nice, this slave is valid */
LASSERT(req == NULL);
LASSERT(body2);
obj->objs[i].size = body2->size;
+
CDEBUG(D_OTHER, "fresh: %lu\n",
(unsigned long)obj->objs[i].size);
* because returned values will be put in struct inode */
obj = lmv_grab_obj(obd, pfid);
- if (obj && len) {
- /* directory is already splitted. calculate mds */
- mds = raw_name2idx(obj->objcount, (char *)name, len);
- rpfid = obj->objs[mds].fid;
+ if (obj) {
+ if (len) {
+ /* directory is already splitted. calculate mds */
+ mds = raw_name2idx(obj->objcount, (char *)name, len);
+ rpfid = obj->objs[mds].fid;
+ }
lmv_put_obj(obj);
}
CWARN("lookup for %lu/%lu/%lu and data should be uptodate\n",
(unsigned long)rpfid.mds, (unsigned long)rpfid.id,
(unsigned long)rpfid.generation);
-
LASSERT(*reqp == NULL);
RETURN(rc);
}
obj = lmv_create_obj(exp, &rpfid, NULL);
if (IS_ERR(obj))
RETURN(PTR_ERR(obj));
-
+ lmv_put_obj(obj);
goto repeat;
}
obj = lmv_create_obj(exp, &body->fid1, mea);
if (IS_ERR(obj))
RETURN(PTR_ERR(obj));
- } else {
- lmv_put_obj(obj);
}
+ lmv_put_obj(obj);
}
RETURN(rc);
struct ptlrpc_request *mreq = *reqp;
struct lmv_obd *lmv = &obd->u.lmv;
struct lustre_handle master_lockh;
- unsigned long size = 0;
struct ldlm_lock *lock;
+ unsigned long size = 0;
struct mds_body *body;
struct ll_uctxt uctxt;
struct lmv_obj *obj;
/* it even got the reply refresh attrs
* from that reply */
body = lustre_msg_buf(mreq->rq_repmsg,
- 1,sizeof(*body));
+ 1, sizeof(*body));
LASSERT(body != NULL);
goto update;
}
update:
obj->objs[i].size = body->size;
+
CDEBUG(D_OTHER, "fresh: %lu\n",
(unsigned long)obj->objs[i].size);
ptlrpc_req_finished(req);
release_lock:
size += obj->objs[i].size;
+
if (it.d.lustre.it_lock_mode)
ldlm_lock_decref(lockh, it.d.lustre.it_lock_mode);
}
/* some attrs got refreshed, we have reply and it's time to put
* fresh attrs to it */
CDEBUG(D_OTHER, "return refreshed attrs: size = %lu\n",
- (unsigned long) size);
+ (unsigned long)size);
+
body = lustre_msg_buf((*reqp)->rq_repmsg, 1, sizeof(*body));
LASSERT(body);
- /* FIXME: what about another attributes? */
+ /* FIXME: what about other attributes? */
body->size = size;
+
if (mreq == NULL) {
/* very important to maintain lli->mds the same because
* of revalidation. mreq == NULL means that caller has