From: wangdi Date: Thu, 9 Oct 2003 14:24:12 +0000 (+0000) Subject: fix some flaws in llite_nfs.c X-Git-Tag: v1_7_110~1^13~95 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=f8c85e9a86c0be91fc28e239628137b68b9b5ed2;p=fs%2Flustre-release.git fix some flaws in llite_nfs.c --- diff --git a/lustre/llite/llite_nfs.c b/lustre/llite/llite_nfs.c index 046e959..2b56d2c 100644 --- a/lustre/llite/llite_nfs.c +++ b/lustre/llite/llite_nfs.c @@ -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;