diff --git a/fs/inode.c b/fs/inode.c index f0e64ca413db7153bcb4370d9cd83783e939d0bb..381236295c5714d39fa03693c1e1f7c781125ab2 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -433,11 +433,8 @@ static void inode_lru_list_add(struct inode *inode) if (list_lru_add(&inode->i_sb->s_inode_lru, &inode->i_lru)) this_cpu_inc(nr_unused); else { - inode->i_state |= I_REFERENCED; -#ifdef CONFIG_KIDLED /* Keep KIDLED_YOUNG and REFERENCED set synchronously */ - inode->i_state |= I_KIDLED_YOUNG; -#endif + inode->i_state |= (I_REFERENCED | I_KIDLED_YOUNG); } } @@ -797,7 +794,7 @@ static enum lru_status inode_lru_isolate(struct list_head *item, * through the LRU as we canot reclaim them now. */ if (atomic_read(&inode->i_count) || - (inode->i_state & ~I_REFERENCED)) { + (inode->i_state & ~(I_REFERENCED | I_KIDLED_YOUNG))) { list_lru_isolate(lru, &inode->i_lru); spin_unlock(&inode->i_lock); this_cpu_dec(nr_unused); @@ -805,8 +802,8 @@ static enum lru_status inode_lru_isolate(struct list_head *item, } /* recently referenced inodes get one more pass */ - if (inode->i_state & I_REFERENCED) { - inode->i_state &= ~I_REFERENCED; + if (inode->i_state & (I_REFERENCED | I_KIDLED_YOUNG)) { + inode->i_state &= ~(I_REFERENCED | I_KIDLED_YOUNG); spin_unlock(&inode->i_lock); return LRU_ROTATE; } diff --git a/include/linux/fs.h b/include/linux/fs.h index f876989151eacd22e74d40550f95e61d7bd0a4e9..af7c3d4b80e4f71c095f8e07792772459d79b104 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2355,7 +2355,9 @@ static inline void kiocb_clone(struct kiocb *kiocb, struct kiocb *kiocb_src, #define I_LRU_ISOLATING (1 << __I_LRU_ISOLATING) #ifdef CONFIG_KIDLED -#define I_KIDLED_YOUNG (1 << 31) +#define I_KIDLED_YOUNG (1UL << 31) +#else +#define I_KIDLED_YOUNG 0 #endif #define I_DIRTY_INODE (I_DIRTY_SYNC | I_DIRTY_DATASYNC)