Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759095AbdLRMry (ORCPT ); Mon, 18 Dec 2017 07:47:54 -0500 Received: from mx2.suse.de ([195.135.220.15]:45937 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758563AbdLRMrx (ORCPT ); Mon, 18 Dec 2017 07:47:53 -0500 Date: Mon, 18 Dec 2017 13:47:51 +0100 From: Jan Kara To: Jeff Layton Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, hch@lst.de, neilb@suse.de, bfields@fieldses.org, amir73il@gmail.com, jack@suse.de, viro@zeniv.linux.org.uk Subject: Re: [PATCH 08/19] ext2: convert to new i_version API Message-ID: <20171218124751.GA30350@quack2.suse.cz> References: <20171213142017.23653-1-jlayton@kernel.org> <20171213142017.23653-9-jlayton@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171213142017.23653-9-jlayton@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2525 Lines: 77 On Wed 13-12-17 09:20:06, Jeff Layton wrote: > From: Jeff Layton > > Signed-off-by: Jeff Layton Looks good. You can add: Reviwed-by: Jan Kara Honza > --- > fs/ext2/dir.c | 8 ++++---- > fs/ext2/super.c | 4 ++-- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c > index 987647986f47..c99f14fec3f3 100644 > --- a/fs/ext2/dir.c > +++ b/fs/ext2/dir.c > @@ -92,7 +92,7 @@ static int ext2_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); > block_write_end(NULL, mapping, pos, len, len, page, NULL); > > if (pos+len > dir->i_size) { > @@ -293,7 +293,7 @@ ext2_readdir(struct file *file, struct dir_context *ctx) > unsigned long npages = dir_pages(inode); > unsigned chunk_mask = ~(ext2_chunk_size(inode)-1); > unsigned char *types = NULL; > - int need_revalidate = file->f_version != inode->i_version; > + bool need_revalidate = inode_cmp_iversion(inode, file->f_version); > > if (pos > inode->i_size - EXT2_DIR_REC_LEN(1)) > return 0; > @@ -319,8 +319,8 @@ ext2_readdir(struct file *file, struct dir_context *ctx) > offset = ext2_validate_entry(kaddr, offset, chunk_mask); > ctx->pos = (n< } > - file->f_version = inode->i_version; > - need_revalidate = 0; > + file->f_version = inode_query_iversion(inode); > + need_revalidate = false; > } > de = (ext2_dirent *)(kaddr+offset); > limit = kaddr + ext2_last_byte(inode, n) - EXT2_DIR_REC_LEN(1); > diff --git a/fs/ext2/super.c b/fs/ext2/super.c > index 7646818ab266..dd7c3c81d918 100644 > --- a/fs/ext2/super.c > +++ b/fs/ext2/super.c > @@ -184,7 +184,7 @@ static struct inode *ext2_alloc_inode(struct super_block *sb) > if (!ei) > return NULL; > ei->i_block_alloc_info = NULL; > - ei->vfs_inode.i_version = 1; > + inode_set_iversion(&ei->vfs_inode, 1); > #ifdef CONFIG_QUOTA > memset(&ei->i_dquot, 0, sizeof(ei->i_dquot)); > #endif > @@ -1569,7 +1569,7 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type, > return err; > if (inode->i_size < off+len-towrite) > i_size_write(inode, off+len-towrite); > - inode->i_version++; > + inode_inc_iversion(inode); > inode->i_mtime = inode->i_ctime = current_time(inode); > mark_inode_dirty(inode); > return len - towrite; > -- > 2.14.3 > -- Jan Kara SUSE Labs, CR