Skip to content

Commit

Permalink
exofs: switch 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 c7f88c4 commit 317bc94
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions fs/exofs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

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

static inline unsigned exofs_chunk_size(struct inode *inode)
Expand Down Expand Up @@ -60,7 +61,7 @@ static int exofs_commit_chunk(struct page *page, loff_t pos, unsigned len)
struct inode *dir = mapping->host;
int err = 0;

dir->i_version++;
inode_inc_iversion(dir);

if (!PageUptodate(page))
SetPageUptodate(page);
Expand Down Expand Up @@ -241,7 +242,7 @@ exofs_readdir(struct file *file, struct dir_context *ctx)
unsigned long n = pos >> PAGE_SHIFT;
unsigned long npages = dir_pages(inode);
unsigned chunk_mask = ~(exofs_chunk_size(inode)-1);
int need_revalidate = (file->f_version != inode->i_version);
bool need_revalidate = inode_cmp_iversion(inode, file->f_version);

if (pos > inode->i_size - EXOFS_DIR_REC_LEN(1))
return 0;
Expand All @@ -264,8 +265,8 @@ exofs_readdir(struct file *file, struct dir_context *ctx)
chunk_mask);
ctx->pos = (n<<PAGE_SHIFT) + offset;
}
file->f_version = inode->i_version;
need_revalidate = 0;
file->f_version = inode_query_iversion(inode);
need_revalidate = false;
}
de = (struct exofs_dir_entry *)(kaddr + offset);
limit = kaddr + exofs_last_byte(inode, n) -
Expand Down
3 changes: 2 additions & 1 deletion fs/exofs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <linux/module.h>
#include <linux/exportfs.h>
#include <linux/slab.h>
#include <linux/iversion.h>

#include "exofs.h"

Expand Down Expand Up @@ -159,7 +160,7 @@ static struct inode *exofs_alloc_inode(struct super_block *sb)
if (!oi)
return NULL;

oi->vfs_inode.i_version = 1;
inode_set_iversion(&oi->vfs_inode, 1);
return &oi->vfs_inode;
}

Expand Down

0 comments on commit 317bc94

Please sign in to comment.