Whamcloud - gitweb
fix some flaws in llite_nfs.c
authorwangdi <wangdi>
Thu, 9 Oct 2003 14:24:12 +0000 (14:24 +0000)
committerwangdi <wangdi>
Thu, 9 Oct 2003 14:24:12 +0000 (14:24 +0000)
lustre/llite/llite_nfs.c

index 046e959..2b56d2c 100644 (file)
@@ -49,7 +49,11 @@ static struct inode * search_inode_for_lustre(struct super_block *sb,
         int eadatalen = 0, rc;
         struct inode *inode = NULL;
 
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+        inode = ilookup5(sb, ino, NULL, NULL);
+#else
         inode = ilookup4(sb, ino, NULL, NULL);
+#endif
         if (inode)
                 return inode;
         if (S_ISREG(mode)) {
@@ -112,7 +116,11 @@ static struct dentry *ll_iget_for_nfs(struct super_block *sb, unsigned long ino,
         spin_lock(&dcache_lock);
         for (lp = inode->i_dentry.next; lp != &inode->i_dentry ; lp=lp->next) {
                 result = list_entry(lp,struct dentry, d_alias);
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+                if (!(result->d_flags & DCACHE_DISCONNECTED)) {
+#else
                 if (!(result->d_flags & DCACHE_NFSD_DISCONNECTED)) {
+#endif
                         dget_locked(result);
                         result->d_vfs_flags |= DCACHE_REFERENCED;
                         spin_unlock(&dcache_lock);
@@ -126,7 +134,11 @@ static struct dentry *ll_iget_for_nfs(struct super_block *sb, unsigned long ino,
                 iput(inode);
                 return ERR_PTR(-ENOMEM);
         }
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+        result->d_flags |= DCACHE_DISCONNECTED;
+#else
         result->d_flags |= DCACHE_NFSD_DISCONNECTED;
+#endif
         ll_set_dd(result);
         result->d_op = &ll_d_ops;
         return result;