Whamcloud - gitweb
b=22891 Objects are not getting deleted for files which have been removed
[fs/lustre-release.git] / lustre / llite / llite_nfs.c
index 36b60a7..25352ae 100644 (file)
@@ -26,7 +26,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
@@ -60,6 +60,12 @@ __u32 get_uuid2int(const char *name, int len)
         return (key0 << 1);
 }
 
+static int ll_nfs_test_inode(struct inode *inode, void *opaque)
+{
+        return lu_fid_eq(&ll_i2info(inode)->lli_fid,
+                         (struct lu_fid *)opaque);
+}
+
 static struct inode *search_inode_for_lustre(struct super_block *sb,
                                              const struct lu_fid *fid)
 {
@@ -67,12 +73,16 @@ static struct inode *search_inode_for_lustre(struct super_block *sb,
         struct ptlrpc_request *req = NULL;
         struct inode          *inode = NULL;
         int                   eadatalen = 0;
-        ino_t                 ino = cl_fid_build_ino(fid);
+        unsigned long         hash = (unsigned long) cl_fid_build_ino(fid);
         struct  md_op_data    *op_data;
         int                   rc;
         ENTRY;
 
-        CDEBUG(D_INFO, "searching inode for:(%lu,"DFID")\n", ino, PFID(fid));
+        CDEBUG(D_INFO, "searching inode for:(%lu,"DFID")\n", hash, PFID(fid));
+
+        inode = ilookup5(sb, hash, ll_nfs_test_inode, (void *)fid);
+        if (inode)
+                RETURN(inode);
 
         rc = ll_get_max_mdsize(sbi, &eadatalen);
         if (rc)