aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_inode_buf.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/libxfs/xfs_inode_buf.c')
-rw-r--r--fs/xfs/libxfs/xfs_inode_buf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c
index 05fbefa97fbf..9d9559eb2835 100644
--- a/fs/xfs/libxfs/xfs_inode_buf.c
+++ b/fs/xfs/libxfs/xfs_inode_buf.c
@@ -202,13 +202,12 @@ xfs_inode_from_disk(
202 struct xfs_icdinode *to = &ip->i_d; 202 struct xfs_icdinode *to = &ip->i_d;
203 struct inode *inode = VFS_I(ip); 203 struct inode *inode = VFS_I(ip);
204 204
205 to->di_mode = be16_to_cpu(from->di_mode);
206 to->di_version = from ->di_version;
207 205
208 /* 206 /*
209 * Convert v1 inodes immediately to v2 inode format as this is the 207 * Convert v1 inodes immediately to v2 inode format as this is the
210 * minimum inode version format we support in the rest of the code. 208 * minimum inode version format we support in the rest of the code.
211 */ 209 */
210 to->di_version = from->di_version;
212 if (to->di_version == 1) { 211 if (to->di_version == 1) {
213 set_nlink(inode, be16_to_cpu(from->di_onlink)); 212 set_nlink(inode, be16_to_cpu(from->di_onlink));
214 to->di_projid_lo = 0; 213 to->di_projid_lo = 0;
@@ -238,6 +237,7 @@ xfs_inode_from_disk(
238 inode->i_ctime.tv_sec = (int)be32_to_cpu(from->di_ctime.t_sec); 237 inode->i_ctime.tv_sec = (int)be32_to_cpu(from->di_ctime.t_sec);
239 inode->i_ctime.tv_nsec = (int)be32_to_cpu(from->di_ctime.t_nsec); 238 inode->i_ctime.tv_nsec = (int)be32_to_cpu(from->di_ctime.t_nsec);
240 inode->i_generation = be32_to_cpu(from->di_gen); 239 inode->i_generation = be32_to_cpu(from->di_gen);
240 inode->i_mode = be16_to_cpu(from->di_mode);
241 241
242 to->di_size = be64_to_cpu(from->di_size); 242 to->di_size = be64_to_cpu(from->di_size);
243 to->di_nblocks = be64_to_cpu(from->di_nblocks); 243 to->di_nblocks = be64_to_cpu(from->di_nblocks);
@@ -270,7 +270,6 @@ xfs_inode_to_disk(
270 to->di_magic = cpu_to_be16(XFS_DINODE_MAGIC); 270 to->di_magic = cpu_to_be16(XFS_DINODE_MAGIC);
271 to->di_onlink = 0; 271 to->di_onlink = 0;
272 272
273 to->di_mode = cpu_to_be16(from->di_mode);
274 to->di_version = from->di_version; 273 to->di_version = from->di_version;
275 to->di_format = from->di_format; 274 to->di_format = from->di_format;
276 to->di_uid = cpu_to_be32(from->di_uid); 275 to->di_uid = cpu_to_be32(from->di_uid);
@@ -287,6 +286,7 @@ xfs_inode_to_disk(
287 to->di_ctime.t_nsec = cpu_to_be32(inode->i_ctime.tv_nsec); 286 to->di_ctime.t_nsec = cpu_to_be32(inode->i_ctime.tv_nsec);
288 to->di_nlink = cpu_to_be32(inode->i_nlink); 287 to->di_nlink = cpu_to_be32(inode->i_nlink);
289 to->di_gen = cpu_to_be32(inode->i_generation); 288 to->di_gen = cpu_to_be32(inode->i_generation);
289 to->di_mode = cpu_to_be16(inode->i_mode);
290 290
291 to->di_size = cpu_to_be64(from->di_size); 291 to->di_size = cpu_to_be64(from->di_size);
292 to->di_nblocks = cpu_to_be64(from->di_nblocks); 292 to->di_nblocks = cpu_to_be64(from->di_nblocks);
@@ -501,7 +501,7 @@ xfs_iread(
501 * the inode is already free and not try to mess 501 * the inode is already free and not try to mess
502 * with the uninitialized part of it. 502 * with the uninitialized part of it.
503 */ 503 */
504 ip->i_d.di_mode = 0; 504 VFS_I(ip)->i_mode = 0;
505 } 505 }
506 506
507 ASSERT(ip->i_d.di_version >= 2); 507 ASSERT(ip->i_d.di_version >= 2);