From ab1cd6cbbfc126c32b400adfdb30f1ec19de3b69 Mon Sep 17 00:00:00 2001 From: meijia Date: Mon, 23 Jun 2003 11:56:54 +0000 Subject: [PATCH] [liblustre]: - treat an closed inode as invalid. - reap inode right after unlink/rmdir and when found stale ones. --- lustre/liblustre/namei.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/lustre/liblustre/namei.c b/lustre/liblustre/namei.c index 38e0417..eb6f724 100644 --- a/lustre/liblustre/namei.c +++ b/lustre/liblustre/namei.c @@ -135,6 +135,17 @@ int llu_pb_revalidate(struct pnode *pnode, int flags, struct lookup_intent *it) RETURN(0); } + /* if the inode has been marked as staled, simply reap it */ + if (llu_i2info(pb->pb_ino)->lli_stale_flag) { + struct inode *inode = pb->pb_ino; + + pb->pb_ino = NULL; + I_RELE(inode); + _sysio_i_gone(inode); + + RETURN(0); + } + /* This is due to bad interaction with libsysio. remove this when we * switched to libbsdio */ @@ -189,11 +200,12 @@ int llu_pb_revalidate(struct pnode *pnode, int flags, struct lookup_intent *it) } RETURN(1); } - /* - if (S_ISDIR(de->d_inode->i_mode)) - ll_invalidate_inode_pages(de->d_inode); - d_unhash_aliases(de->d_inode); - */ + + /* remove the staled inode right away */ + pb->pb_ino = NULL; + I_RELE(inode); + _sysio_i_gone(inode); + RETURN(0); } -- 1.8.3.1