Whamcloud - gitweb
- more fixes about lmv_put_inode()
[fs/lustre-release.git] / lustre / llite / llite_lib.c
index b98c467..80f368e 100644 (file)
@@ -1374,22 +1374,27 @@ void ll_read_inode2(struct inode *inode, void *opaque)
         }
 }
 
-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;
 }