p = &parent->rb_right;
                else {
                        WARN_ON(!(entry->vfs_inode.i_state &
-                                 (I_WILL_FREE | I_FREEING | I_CLEAR)));
+                                 (I_WILL_FREE | I_FREEING)));
                        rb_erase(parent, &root->inode_tree);
                        RB_CLEAR_NODE(parent);
                        spin_unlock(&root->inode_lock);
 
 
        spin_lock(&inode_lock);
        list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
-               if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW))
+               if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW))
                        continue;
                if (inode->i_mapping->nrpages == 0)
                        continue;
 
 
        spin_lock(&inode_lock);
        inode->i_state &= ~I_SYNC;
-       if (!(inode->i_state & (I_FREEING | I_CLEAR))) {
+       if (!(inode->i_state & I_FREEING)) {
                if ((inode->i_state & I_DIRTY_PAGES) && wbc->for_kupdate) {
                        /*
                         * More pages get dirtied by a fast dirtier.
                if (inode_dirtied_after(inode, wbc->wb_start))
                        return 1;
 
-               BUG_ON(inode->i_state & (I_FREEING | I_CLEAR));
+               BUG_ON(inode->i_state & I_FREEING);
                __iget(inode);
                pages_skipped = wbc->pages_skipped;
                writeback_single_inode(inode, wbc);
                        if (hlist_unhashed(&inode->i_hash))
                                goto out;
                }
-               if (inode->i_state & (I_FREEING|I_CLEAR))
+               if (inode->i_state & I_FREEING)
                        goto out;
 
                /*
        list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
                struct address_space *mapping;
 
-               if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW))
+               if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW))
                        continue;
                mapping = inode->i_mapping;
                if (mapping->nrpages == 0)
 
        struct gfs2_skip_data *data = opaque;
 
        if (ip->i_no_addr == data->no_addr) {
-               if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE)){
+               if (inode->i_state & (I_FREEING|I_WILL_FREE)){
                        data->skipped = 1;
                        return 0;
                }
 
                bd_forget(inode);
        if (S_ISCHR(inode->i_mode) && inode->i_cdev)
                cd_forget(inode);
-       inode->i_state = I_CLEAR;
+       inode->i_state = I_FREEING | I_CLEAR;
 }
 EXPORT_SYMBOL(clear_inode);
 
                        continue;
                if (!test(inode, data))
                        continue;
-               if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE)) {
+               if (inode->i_state & (I_FREEING|I_WILL_FREE)) {
                        __wait_on_freeing_inode(inode);
                        goto repeat;
                }
                        continue;
                if (inode->i_sb != sb)
                        continue;
-               if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE)) {
+               if (inode->i_state & (I_FREEING|I_WILL_FREE)) {
                        __wait_on_freeing_inode(inode);
                        goto repeat;
                }
 struct inode *igrab(struct inode *inode)
 {
        spin_lock(&inode_lock);
-       if (!(inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE)))
+       if (!(inode->i_state & (I_FREEING|I_WILL_FREE)))
                __iget(inode);
        else
                /*
                                continue;
                        if (old->i_sb != sb)
                                continue;
-                       if (old->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE))
+                       if (old->i_state & (I_FREEING|I_WILL_FREE))
                                continue;
                        break;
                }
                                continue;
                        if (!test(old, data))
                                continue;
-                       if (old->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE))
+                       if (old->i_state & (I_FREEING|I_WILL_FREE))
                                continue;
                        break;
                }
        hlist_del_init(&inode->i_hash);
        spin_unlock(&inode_lock);
        wake_up_inode(inode);
-       BUG_ON(inode->i_state != I_CLEAR);
+       BUG_ON(inode->i_state != (I_FREEING | I_CLEAR));
        destroy_inode(inode);
 }
 EXPORT_SYMBOL(generic_delete_inode);
 void iput(struct inode *inode)
 {
        if (inode) {
-               BUG_ON(inode->i_state == I_CLEAR);
+               BUG_ON(inode->i_state & I_CLEAR);
 
                if (atomic_dec_and_lock(&inode->i_count, &inode_lock))
                        iput_final(inode);
 
        struct inode *gcdat = nilfs->ns_gc_dat;
        struct nilfs_inode_info *gii = NILFS_I(gcdat);
 
-       gcdat->i_state = I_CLEAR;
+       gcdat->i_state = I_FREEING | I_CLEAR;
        gii->i_flags = 0;
 
        nilfs_palloc_clear_cache(gcdat);
 
                struct inode *need_iput_tmp;
 
                /*
-                * We cannot __iget() an inode in state I_CLEAR, I_FREEING,
+                * We cannot __iget() an inode in state I_FREEING,
                 * I_WILL_FREE, or I_NEW which is fine because by that point
                 * the inode cannot have any associated watches.
                 */
-               if (inode->i_state & (I_CLEAR|I_FREEING|I_WILL_FREE|I_NEW))
+               if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW))
                        continue;
 
                /*
                /* In case the dropping of a reference would nuke next_i. */
                if ((&next_i->i_sb_list != list) &&
                    atomic_read(&next_i->i_count) &&
-                   !(next_i->i_state & (I_CLEAR | I_FREEING | I_WILL_FREE))) {
+                   !(next_i->i_state & (I_FREEING | I_WILL_FREE))) {
                        __iget(next_i);
                        need_iput = next_i;
                }
 
                struct list_head *watches;
 
                /*
-                * We cannot __iget() an inode in state I_CLEAR, I_FREEING,
+                * We cannot __iget() an inode in state I_FREEING,
                 * I_WILL_FREE, or I_NEW which is fine because by that point
                 * the inode cannot have any associated watches.
                 */
-               if (inode->i_state & (I_CLEAR|I_FREEING|I_WILL_FREE|I_NEW))
+               if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW))
                        continue;
 
                /*
                /* In case the dropping of a reference would nuke next_i. */
                if ((&next_i->i_sb_list != list) &&
                                atomic_read(&next_i->i_count) &&
-                               !(next_i->i_state & (I_CLEAR | I_FREEING |
-                                       I_WILL_FREE))) {
+                               !(next_i->i_state & (I_FREEING|I_WILL_FREE))) {
                        __iget(next_i);
                        need_iput = next_i;
                }
 
 
        spin_lock(&inode_lock);
        list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
-               if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW))
+               if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW))
                        continue;
 #ifdef CONFIG_QUOTA_DEBUG
                if (unlikely(inode_get_rsv_space(inode) > 0))
 
 {
        struct inode    *inode = VFS_I(ip);
 
-       if (!(inode->i_state & (I_WILL_FREE|I_FREEING|I_CLEAR)))
+       if (!(inode->i_state & (I_WILL_FREE|I_FREEING)))
                mark_inode_dirty_sync(inode);
 }
 
 {
        struct inode    *inode = VFS_I(ip);
 
-       if (!(inode->i_state & (I_WILL_FREE|I_FREEING|I_CLEAR)))
+       if (!(inode->i_state & (I_WILL_FREE|I_FREEING)))
                mark_inode_dirty(inode);
 }
 
 
  * I_FREEING           Set when inode is about to be freed but still has dirty
  *                     pages or buffers attached or the inode itself is still
  *                     dirty.
- * I_CLEAR             Set by clear_inode().  In this state the inode is clean
- *                     and can be destroyed.
+ * I_CLEAR             Added by clear_inode().  In this state the inode is clean
+ *                     and can be destroyed.  Inode keeps I_FREEING.
  *
  *                     Inodes that are I_WILL_FREE, I_FREEING or I_CLEAR are
  *                     prohibited for many purposes.  iget() must wait for