Skip to content

Commit

Permalink
affs: convert to new i_version API
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Layton <[email protected]>
  • Loading branch information
jtlayton committed Jan 29, 2018
1 parent 2489dba commit 9dffe56
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions fs/affs/amigaffs.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

#include <linux/math64.h>
#include <linux/iversion.h>
#include "affs.h"

/*
Expand Down Expand Up @@ -60,7 +61,7 @@ affs_insert_hash(struct inode *dir, struct buffer_head *bh)
affs_brelse(dir_bh);

dir->i_mtime = dir->i_ctime = current_time(dir);
dir->i_version++;
inode_inc_iversion(dir);
mark_inode_dirty(dir);

return 0;
Expand Down Expand Up @@ -114,7 +115,7 @@ affs_remove_hash(struct inode *dir, struct buffer_head *rem_bh)
affs_brelse(bh);

dir->i_mtime = dir->i_ctime = current_time(dir);
dir->i_version++;
inode_inc_iversion(dir);
mark_inode_dirty(dir);

return retval;
Expand Down
5 changes: 3 additions & 2 deletions fs/affs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*
*/

#include <linux/iversion.h>
#include "affs.h"

static int affs_readdir(struct file *, struct dir_context *);
Expand Down Expand Up @@ -80,7 +81,7 @@ affs_readdir(struct file *file, struct dir_context *ctx)
* we can jump directly to where we left off.
*/
ino = (u32)(long)file->private_data;
if (ino && file->f_version == inode->i_version) {
if (ino && inode_cmp_iversion(inode, file->f_version) == 0) {
pr_debug("readdir() left off=%d\n", ino);
goto inside;
}
Expand Down Expand Up @@ -130,7 +131,7 @@ affs_readdir(struct file *file, struct dir_context *ctx)
} while (ino);
}
done:
file->f_version = inode->i_version;
file->f_version = inode_query_iversion(inode);
file->private_data = (void *)(long)ino;
affs_brelse(fh_bh);

Expand Down
3 changes: 2 additions & 1 deletion fs/affs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/writeback.h>
#include <linux/blkdev.h>
#include <linux/seq_file.h>
#include <linux/iversion.h>
#include "affs.h"

static int affs_statfs(struct dentry *dentry, struct kstatfs *buf);
Expand Down Expand Up @@ -102,7 +103,7 @@ static struct inode *affs_alloc_inode(struct super_block *sb)
if (!i)
return NULL;

i->vfs_inode.i_version = 1;
inode_set_iversion(&i->vfs_inode, 1);
i->i_lc = NULL;
i->i_ext_bh = NULL;
i->i_pa_cnt = 0;
Expand Down

0 comments on commit 9dffe56

Please sign in to comment.