Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ocfs2: convert to new i_version API

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>

+14 -10
+8 -7
fs/ocfs2/dir.c
··· 42 42 #include <linux/highmem.h> 43 43 #include <linux/quotaops.h> 44 44 #include <linux/sort.h> 45 + #include <linux/iversion.h> 45 46 46 47 #include <cluster/masklog.h> 47 48 ··· 1175 1174 le16_add_cpu(&pde->rec_len, 1176 1175 le16_to_cpu(de->rec_len)); 1177 1176 de->inode = 0; 1178 - dir->i_version++; 1177 + inode_inc_iversion(dir); 1179 1178 ocfs2_journal_dirty(handle, bh); 1180 1179 goto bail; 1181 1180 } ··· 1730 1729 if (ocfs2_dir_indexed(dir)) 1731 1730 ocfs2_recalc_free_list(dir, handle, lookup); 1732 1731 1733 - dir->i_version++; 1732 + inode_inc_iversion(dir); 1734 1733 ocfs2_journal_dirty(handle, insert_bh); 1735 1734 retval = 0; 1736 1735 goto bail; ··· 1776 1775 * readdir(2), then we might be pointing to an invalid 1777 1776 * dirent right now. Scan from the start of the block 1778 1777 * to make sure. */ 1779 - if (*f_version != inode->i_version) { 1778 + if (inode_cmp_iversion(inode, *f_version)) { 1780 1779 for (i = 0; i < i_size_read(inode) && i < offset; ) { 1781 1780 de = (struct ocfs2_dir_entry *) 1782 1781 (data->id_data + i); ··· 1792 1791 i += le16_to_cpu(de->rec_len); 1793 1792 } 1794 1793 ctx->pos = offset = i; 1795 - *f_version = inode->i_version; 1794 + *f_version = inode_query_iversion(inode); 1796 1795 } 1797 1796 1798 1797 de = (struct ocfs2_dir_entry *) (data->id_data + ctx->pos); ··· 1870 1869 * readdir(2), then we might be pointing to an invalid 1871 1870 * dirent right now. Scan from the start of the block 1872 1871 * to make sure. */ 1873 - if (*f_version != inode->i_version) { 1872 + if (inode_cmp_iversion(inode, *f_version)) { 1874 1873 for (i = 0; i < sb->s_blocksize && i < offset; ) { 1875 1874 de = (struct ocfs2_dir_entry *) (bh->b_data + i); 1876 1875 /* It's too expensive to do a full ··· 1887 1886 offset = i; 1888 1887 ctx->pos = (ctx->pos & ~(sb->s_blocksize - 1)) 1889 1888 | offset; 1890 - *f_version = inode->i_version; 1889 + *f_version = inode_query_iversion(inode); 1891 1890 } 1892 1891 1893 1892 while (ctx->pos < i_size_read(inode) ··· 1941 1940 */ 1942 1941 int ocfs2_dir_foreach(struct inode *inode, struct dir_context *ctx) 1943 1942 { 1944 - u64 version = inode->i_version; 1943 + u64 version = inode_query_iversion(inode); 1945 1944 ocfs2_dir_foreach_blk(inode, &version, ctx, true); 1946 1945 return 0; 1947 1946 }
+2 -1
fs/ocfs2/inode.c
··· 28 28 #include <linux/highmem.h> 29 29 #include <linux/pagemap.h> 30 30 #include <linux/quotaops.h> 31 + #include <linux/iversion.h> 31 32 32 33 #include <asm/byteorder.h> 33 34 ··· 303 302 OCFS2_I(inode)->ip_attr = le32_to_cpu(fe->i_attr); 304 303 OCFS2_I(inode)->ip_dyn_features = le16_to_cpu(fe->i_dyn_features); 305 304 306 - inode->i_version = 1; 305 + inode_set_iversion(inode, 1); 307 306 inode->i_generation = le32_to_cpu(fe->i_generation); 308 307 inode->i_rdev = huge_decode_dev(le64_to_cpu(fe->id1.dev1.i_rdev)); 309 308 inode->i_mode = le16_to_cpu(fe->i_mode);
+2 -1
fs/ocfs2/namei.c
··· 41 41 #include <linux/slab.h> 42 42 #include <linux/highmem.h> 43 43 #include <linux/quotaops.h> 44 + #include <linux/iversion.h> 44 45 45 46 #include <cluster/masklog.h> 46 47 ··· 1521 1520 mlog_errno(status); 1522 1521 goto bail; 1523 1522 } 1524 - new_dir->i_version++; 1523 + inode_inc_iversion(new_dir); 1525 1524 1526 1525 if (S_ISDIR(new_inode->i_mode)) 1527 1526 ocfs2_set_links_count(newfe, 0);
+2 -1
fs/ocfs2/quota_global.c
··· 12 12 #include <linux/writeback.h> 13 13 #include <linux/workqueue.h> 14 14 #include <linux/llist.h> 15 + #include <linux/iversion.h> 15 16 16 17 #include <cluster/masklog.h> 17 18 ··· 290 289 mlog_errno(err); 291 290 return err; 292 291 } 293 - gqinode->i_version++; 292 + inode_inc_iversion(gqinode); 294 293 ocfs2_mark_inode_dirty(handle, gqinode, oinfo->dqi_gqi_bh); 295 294 return len; 296 295 }