diff options
-rw-r--r-- | fs/xfs/libxfs/xfs_inode_buf.c | 4 | ||||
-rw-r--r-- | fs/xfs/libxfs/xfs_inode_buf.h | 1 | ||||
-rw-r--r-- | fs/xfs/xfs_icache.c | 6 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_inode_item.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_trans_inode.c | 2 |
6 files changed, 9 insertions, 8 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 9113a8d0f148..05fbefa97fbf 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c | |||
@@ -251,7 +251,7 @@ xfs_inode_from_disk( | |||
251 | to->di_flags = be16_to_cpu(from->di_flags); | 251 | to->di_flags = be16_to_cpu(from->di_flags); |
252 | 252 | ||
253 | if (to->di_version == 3) { | 253 | if (to->di_version == 3) { |
254 | to->di_changecount = be64_to_cpu(from->di_changecount); | 254 | inode->i_version = be64_to_cpu(from->di_changecount); |
255 | to->di_crtime.t_sec = be32_to_cpu(from->di_crtime.t_sec); | 255 | to->di_crtime.t_sec = be32_to_cpu(from->di_crtime.t_sec); |
256 | to->di_crtime.t_nsec = be32_to_cpu(from->di_crtime.t_nsec); | 256 | to->di_crtime.t_nsec = be32_to_cpu(from->di_crtime.t_nsec); |
257 | to->di_flags2 = be64_to_cpu(from->di_flags2); | 257 | to->di_flags2 = be64_to_cpu(from->di_flags2); |
@@ -300,7 +300,7 @@ xfs_inode_to_disk( | |||
300 | to->di_flags = cpu_to_be16(from->di_flags); | 300 | to->di_flags = cpu_to_be16(from->di_flags); |
301 | 301 | ||
302 | if (from->di_version == 3) { | 302 | if (from->di_version == 3) { |
303 | to->di_changecount = cpu_to_be64(from->di_changecount); | 303 | to->di_changecount = cpu_to_be64(inode->i_version); |
304 | to->di_crtime.t_sec = cpu_to_be32(from->di_crtime.t_sec); | 304 | to->di_crtime.t_sec = cpu_to_be32(from->di_crtime.t_sec); |
305 | to->di_crtime.t_nsec = cpu_to_be32(from->di_crtime.t_nsec); | 305 | to->di_crtime.t_nsec = cpu_to_be32(from->di_crtime.t_nsec); |
306 | to->di_flags2 = cpu_to_be64(from->di_flags2); | 306 | to->di_flags2 = cpu_to_be64(from->di_flags2); |
diff --git a/fs/xfs/libxfs/xfs_inode_buf.h b/fs/xfs/libxfs/xfs_inode_buf.h index 29fd9f1cf54b..c51bd1213c96 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.h +++ b/fs/xfs/libxfs/xfs_inode_buf.h | |||
@@ -47,7 +47,6 @@ struct xfs_icdinode { | |||
47 | __uint16_t di_dmstate; /* DMIG state info */ | 47 | __uint16_t di_dmstate; /* DMIG state info */ |
48 | __uint16_t di_flags; /* random flags, XFS_DIFLAG_... */ | 48 | __uint16_t di_flags; /* random flags, XFS_DIFLAG_... */ |
49 | 49 | ||
50 | __uint64_t di_changecount; /* number of attribute changes */ | ||
51 | __uint64_t di_flags2; /* more random flags */ | 50 | __uint64_t di_flags2; /* more random flags */ |
52 | 51 | ||
53 | xfs_ictimestamp_t di_crtime; /* time created */ | 52 | xfs_ictimestamp_t di_crtime; /* time created */ |
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 6401e3c07d3a..30eafad7cf19 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c | |||
@@ -138,9 +138,9 @@ xfs_inode_free( | |||
138 | * When we recycle a reclaimable inode, we need to re-initialise the VFS inode | 138 | * When we recycle a reclaimable inode, we need to re-initialise the VFS inode |
139 | * part of the structure. This is made more complex by the fact we store | 139 | * part of the structure. This is made more complex by the fact we store |
140 | * information about the on-disk values in the VFS inode and so we can't just | 140 | * information about the on-disk values in the VFS inode and so we can't just |
141 | * overwrite it's values unconditionally. Hence we save the parameters we | 141 | * overwrite the values unconditionally. Hence we save the parameters we |
142 | * need to retain across reinitialisation, and rewrite them into the VFS inode | 142 | * need to retain across reinitialisation, and rewrite them into the VFS inode |
143 | * after resetting it's state even if resetting fails. | 143 | * after reinitialisation even if it fails. |
144 | */ | 144 | */ |
145 | static int | 145 | static int |
146 | xfs_reinit_inode( | 146 | xfs_reinit_inode( |
@@ -150,11 +150,13 @@ xfs_reinit_inode( | |||
150 | int error; | 150 | int error; |
151 | uint32_t nlink = inode->i_nlink; | 151 | uint32_t nlink = inode->i_nlink; |
152 | uint32_t generation = inode->i_generation; | 152 | uint32_t generation = inode->i_generation; |
153 | uint64_t version = inode->i_version; | ||
153 | 154 | ||
154 | error = inode_init_always(mp->m_super, inode); | 155 | error = inode_init_always(mp->m_super, inode); |
155 | 156 | ||
156 | set_nlink(inode, nlink); | 157 | set_nlink(inode, nlink); |
157 | inode->i_generation = generation; | 158 | inode->i_generation = generation; |
159 | inode->i_version = version; | ||
158 | return error; | 160 | return error; |
159 | } | 161 | } |
160 | 162 | ||
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index dfc5b18c8cc2..8a970056a2c4 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -841,7 +841,7 @@ xfs_ialloc( | |||
841 | ip->i_d.di_flags = 0; | 841 | ip->i_d.di_flags = 0; |
842 | 842 | ||
843 | if (ip->i_d.di_version == 3) { | 843 | if (ip->i_d.di_version == 3) { |
844 | ip->i_d.di_changecount = 1; | 844 | inode->i_version = 1; |
845 | ip->i_d.di_flags2 = 0; | 845 | ip->i_d.di_flags2 = 0; |
846 | ip->i_d.di_crtime.t_sec = (__int32_t)tv.tv_sec; | 846 | ip->i_d.di_crtime.t_sec = (__int32_t)tv.tv_sec; |
847 | ip->i_d.di_crtime.t_nsec = (__int32_t)tv.tv_nsec; | 847 | ip->i_d.di_crtime.t_nsec = (__int32_t)tv.tv_nsec; |
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 6367780b8abb..3415c63bc843 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c | |||
@@ -364,7 +364,7 @@ xfs_inode_to_log_dinode( | |||
364 | to->di_flags = from->di_flags; | 364 | to->di_flags = from->di_flags; |
365 | 365 | ||
366 | if (from->di_version == 3) { | 366 | if (from->di_version == 3) { |
367 | to->di_changecount = from->di_changecount; | 367 | to->di_changecount = inode->i_version; |
368 | to->di_crtime.t_sec = from->di_crtime.t_sec; | 368 | to->di_crtime.t_sec = from->di_crtime.t_sec; |
369 | to->di_crtime.t_nsec = from->di_crtime.t_nsec; | 369 | to->di_crtime.t_nsec = from->di_crtime.t_nsec; |
370 | to->di_flags2 = from->di_flags2; | 370 | to->di_flags2 = from->di_flags2; |
diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c index 3f0d46655ce5..11a3af08b5c7 100644 --- a/fs/xfs/xfs_trans_inode.c +++ b/fs/xfs/xfs_trans_inode.c | |||
@@ -117,7 +117,7 @@ xfs_trans_log_inode( | |||
117 | */ | 117 | */ |
118 | if (!(ip->i_itemp->ili_item.li_desc->lid_flags & XFS_LID_DIRTY) && | 118 | if (!(ip->i_itemp->ili_item.li_desc->lid_flags & XFS_LID_DIRTY) && |
119 | IS_I_VERSION(VFS_I(ip))) { | 119 | IS_I_VERSION(VFS_I(ip))) { |
120 | ip->i_d.di_changecount = ++VFS_I(ip)->i_version; | 120 | VFS_I(ip)->i_version++; |
121 | flags |= XFS_ILOG_CORE; | 121 | flags |= XFS_ILOG_CORE; |
122 | } | 122 | } |
123 | 123 | ||