2525#include <linux/fs.h>
2626#include <linux/buffer_head.h>
2727#include <linux/slab.h>
28+ #include <linux/iversion.h>
2829#include "ext4.h"
2930#include "xattr.h"
3031
@@ -208,7 +209,7 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx)
208209 * readdir(2), then we might be pointing to an invalid
209210 * dirent right now. Scan from the start of the block
210211 * to make sure. */
211- if (file -> f_version != inode -> i_version ) {
212+ if (inode_cmp_iversion ( inode , file -> f_version ) ) {
212213 for (i = 0 ; i < sb -> s_blocksize && i < offset ; ) {
213214 de = (struct ext4_dir_entry_2 * )
214215 (bh -> b_data + i );
@@ -227,7 +228,7 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx)
227228 offset = i ;
228229 ctx -> pos = (ctx -> pos & ~(sb -> s_blocksize - 1 ))
229230 | offset ;
230- file -> f_version = inode -> i_version ;
231+ file -> f_version = inode_query_iversion ( inode ) ;
231232 }
232233
233234 while (ctx -> pos < inode -> i_size
@@ -568,10 +569,10 @@ static int ext4_dx_readdir(struct file *file, struct dir_context *ctx)
568569 * cached entries.
569570 */
570571 if ((!info -> curr_node ) ||
571- ( file -> f_version != inode -> i_version )) {
572+ inode_cmp_iversion ( inode , file -> f_version )) {
572573 info -> curr_node = NULL ;
573574 free_rb_tree_fname (& info -> root );
574- file -> f_version = inode -> i_version ;
575+ file -> f_version = inode_query_iversion ( inode ) ;
575576 ret = ext4_htree_fill_tree (file , info -> curr_hash ,
576577 info -> curr_minor_hash ,
577578 & info -> next_hash );
0 commit comments