Whamcloud - gitweb
- updating lli_fid in ll_update_inode(), what would update client's inode FID not...
authoryury <yury>
Tue, 23 May 2006 13:28:50 +0000 (13:28 +0000)
committeryury <yury>
Tue, 23 May 2006 13:28:50 +0000 (13:28 +0000)
lustre/llite/llite_lib.c
lustre/llite/namei.c
lustre/lmv/lmv_intent.c
lustre/mdt/mdt_handler.c

index d2103f1..67109d1 100644 (file)
@@ -1301,6 +1301,11 @@ void ll_update_inode(struct inode *inode, struct lustre_md *md)
 
         if (body->valid & OBD_MD_FLSIZE)
                 set_bit(LLI_F_HAVE_MDS_SIZE_LOCK, &lli->lli_flags);
+
+        if (body->valid & OBD_MD_FLID)
+                lli->lli_fid = body->fid1;
+        
+        LASSERT(fid_seq(&lli->lli_fid) != 0);
 }
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
index 5b67cb4..6953ce4 100644 (file)
@@ -71,11 +71,8 @@ struct inode *ll_iget(struct super_block *sb, ino_t hash,
                 if (inode->i_state & I_NEW) {
                         lli = ll_i2info(inode);
                         ll_read_inode2(inode, md);
-                        lli->lli_fid = md->body->fid1;
                         unlock_new_inode(inode);
                 } else {
-                        /* inode is not new, no chamges to fid 
-                         * should take place. */
                         ll_update_inode(inode, md);
                 }
                 CDEBUG(D_VFSTRACE, "inode: %lu/%u(%p)\n",
@@ -93,12 +90,8 @@ struct inode *ll_iget(struct super_block *sb, ino_t hash,
 
         inode = iget4(sb, hash, NULL, md);
         if (inode) {
-                if (!(inode->i_state & (I_FREEING | I_CLEAR))) {
+                if (!(inode->i_state & (I_FREEING | I_CLEAR)))
                         ll_update_inode(inode, md);
-                        down(&inode->i_sem);
-                        lli->lli_fid = md->body->fid1;
-                        up(&inode->i_sem);
-                }
 
                 CDEBUG(D_VFSTRACE, "inode: %lu/%u(%p)\n",
                        inode->i_ino, inode->i_generation, inode);
index f91bd52..255d245 100644 (file)
@@ -216,8 +216,8 @@ repeat:
         LASSERT(body != NULL);
 
         /* could not find object, FID is not present in response. */
-/*        if (!(body->valid & OBD_MD_FID))
-                RETURN(0);*/
+        if (!(body->valid & OBD_MD_FLID))
+                RETURN(0);
 
         cid = &body->fid1;
         obj = lmv_obj_grab(obd, cid);
@@ -348,8 +348,8 @@ int lmv_intent_getattr(struct obd_export *exp, struct lu_fid *pid,
         LASSERT(body != NULL);
 
         /* could not find object, FID is not present in response. */
-/*        if (!(body->valid & OBD_MD_FID))
-                RETURN(0);*/
+        if (!(body->valid & OBD_MD_FLID))
+                RETURN(0);
 
         cid = &body->fid1;
         obj2 = lmv_obj_grab(obd, cid);
@@ -410,7 +410,7 @@ int lmv_lookup_slaves(struct obd_export *exp, struct ptlrpc_request **reqp)
 
         body = lustre_msg_buf((*reqp)->rq_repmsg, 1, sizeof(*body));
         LASSERT(body != NULL);
-//        LASSERT((body->valid & OBD_MD_FID) != 0);
+        LASSERT((body->valid & OBD_MD_FLID) != 0);
 
         obj = lmv_obj_grab(obd, &body->fid1);
         LASSERT(obj != NULL);
@@ -605,7 +605,7 @@ repeat:
                 /* wow! this is splitted dir, we'd like to handle it */
                 body = lustre_msg_buf((*reqp)->rq_repmsg, 1, sizeof(*body));
                 LASSERT(body != NULL);
-//                LASSERT((body->valid & OBD_MD_FID) != 0);
+                LASSERT((body->valid & OBD_MD_FLID) != 0);
 
                 obj = lmv_obj_grab(obd, &body->fid1);
                 if (!obj) {
index 0d1a91d..acde89e 100644 (file)
@@ -176,9 +176,10 @@ static int mdt_getattr(struct mdt_thread_info *info,
                 result = mo_attr_get(info->mti_ctxt, next, &info->mti_attr);
                 if (result == 0) {
                         info->mti_body = lustre_msg_buf(req->rq_repmsg, 0,
-                                                       sizeof(struct mdt_body));
+                                                        sizeof(struct mdt_body));
                         mdt_pack_attr2body(info->mti_body, &info->mti_attr);
                         info->mti_body->fid1 = *mdt_object_fid(info->mti_object);
+                        info->mti_body->valid |= OBD_MD_FLID;
                 }
         }
         RETURN(result);
@@ -220,6 +221,7 @@ static int mdt_getattr_name(struct mdt_thread_info *info,
                         if (result == 0) {
                                 mdt_pack_attr2body(body, &info->mti_attr);
                                 body->fid1 = *mdt_object_fid(child);
+                                body->valid |= OBD_MD_FLID;
                         }
                         mdt_object_put(info->mti_ctxt, child);
                 }