Whamcloud - gitweb
liblustre:
authorericm <ericm>
Wed, 3 Mar 2004 14:33:55 +0000 (14:33 +0000)
committerericm <ericm>
Wed, 3 Mar 2004 14:33:55 +0000 (14:33 +0000)
 - don't blindly drop inode
 - fix iget
 - root inode checking

lustre/liblustre/file.c
lustre/liblustre/super.c

index de3f35e..9a5162d 100644 (file)
@@ -305,7 +305,8 @@ int llu_file_release(struct inode *inode)
         CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%lu\n", lli->lli_st_ino,
                lli->lli_st_generation);
 
-        /* XXX don't do anything for '/'. but how to find the root pnode? */
+        if (llu_is_root_inode(inode))
+                RETURN(0);
 
         /* still opened by others? */
         if (--lli->lli_open_count)
@@ -327,8 +328,8 @@ int llu_iop_close(struct inode *inode)
         int rc;
 
         rc = llu_file_release(inode);
-        if (!llu_i2info(inode)->lli_open_count)
-                llu_i2info(inode)->lli_stale_flag = 1;
+        /* if open count == 0 && stale_flag is set, should we
+         * remove the inode immediately? */
         return rc;
 }
 
index d3b6adf..82ab7ca 100644 (file)
@@ -1236,12 +1236,15 @@ struct inode *llu_iget(struct filesys *fs, struct lustre_md *md)
 
         inode = _sysio_i_find(fs, &fileid);
         if (inode) {
-                if (llu_i2info(inode)->lli_st_generation ==
-                    md->body->generation) {
+                struct llu_inode_info *lli = llu_i2info(inode);
+
+                if (lli->lli_stale_flag ||
+                    lli->lli_st_generation == md->body->generation)
+                        I_RELE(inode);
+                else {
                         llu_update_inode(inode, md->body, md->lsm);
                         return inode;
-                } else
-                        I_RELE(inode);
+                }
         }
 
         inode = llu_new_inode(fs, &fid);
@@ -1494,3 +1497,4 @@ static struct inode_ops llu_inode_ops = {
         inop_gone:      llu_iop_gone,
 };
 
+#warning "time_after() defined in liblustre.h need to be rewrite in userspace"