Blame SOURCES/xfsprogs-5.10.0-xfs-move-xfs_log_dinode_to_disk-to-the-log-recovery-.patch

0bf83d
From acaa814953273827f380262ba900f0d50a95bee2 Mon Sep 17 00:00:00 2001
0bf83d
From: "Darrick J. Wong" <darrick.wong@oracle.com>
0bf83d
Date: Tue, 10 Nov 2020 15:13:50 -0500
0bf83d
Subject: [PATCH] xfs: move xfs_log_dinode_to_disk to the log recovery code
0bf83d
0bf83d
Source kernel commit: 88947ea0ba713c9b74b212755b3b58242f0e7a56
0bf83d
0bf83d
Move this function to xfs_inode_item_recover.c since there's only one
0bf83d
caller of it.
0bf83d
0bf83d
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
0bf83d
Reviewed-by: Christoph Hellwig <hch@lst.de>
0bf83d
Reviewed-by: Allison Collins <allison.henderson@oracle.com>
0bf83d
Reviewed-by: Gao Xiang <hsiangkao@redhat.com>
0bf83d
Reviewed-by: Dave Chinner <dchinner@redhat.com>
0bf83d
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
0bf83d
---
0bf83d
0bf83d
diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c
0bf83d
index 975f097..f80ce10 100644
0bf83d
--- a/libxfs/xfs_inode_buf.c
0bf83d
+++ b/libxfs/xfs_inode_buf.c
0bf83d
@@ -318,58 +318,6 @@ xfs_inode_to_disk(
0bf83d
 	}
0bf83d
 }
0bf83d
 
0bf83d
-void
0bf83d
-xfs_log_dinode_to_disk(
0bf83d
-	struct xfs_log_dinode	*from,
0bf83d
-	struct xfs_dinode	*to)
0bf83d
-{
0bf83d
-	to->di_magic = cpu_to_be16(from->di_magic);
0bf83d
-	to->di_mode = cpu_to_be16(from->di_mode);
0bf83d
-	to->di_version = from->di_version;
0bf83d
-	to->di_format = from->di_format;
0bf83d
-	to->di_onlink = 0;
0bf83d
-	to->di_uid = cpu_to_be32(from->di_uid);
0bf83d
-	to->di_gid = cpu_to_be32(from->di_gid);
0bf83d
-	to->di_nlink = cpu_to_be32(from->di_nlink);
0bf83d
-	to->di_projid_lo = cpu_to_be16(from->di_projid_lo);
0bf83d
-	to->di_projid_hi = cpu_to_be16(from->di_projid_hi);
0bf83d
-	memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad));
0bf83d
-
0bf83d
-	to->di_atime.t_sec = cpu_to_be32(from->di_atime.t_sec);
0bf83d
-	to->di_atime.t_nsec = cpu_to_be32(from->di_atime.t_nsec);
0bf83d
-	to->di_mtime.t_sec = cpu_to_be32(from->di_mtime.t_sec);
0bf83d
-	to->di_mtime.t_nsec = cpu_to_be32(from->di_mtime.t_nsec);
0bf83d
-	to->di_ctime.t_sec = cpu_to_be32(from->di_ctime.t_sec);
0bf83d
-	to->di_ctime.t_nsec = cpu_to_be32(from->di_ctime.t_nsec);
0bf83d
-
0bf83d
-	to->di_size = cpu_to_be64(from->di_size);
0bf83d
-	to->di_nblocks = cpu_to_be64(from->di_nblocks);
0bf83d
-	to->di_extsize = cpu_to_be32(from->di_extsize);
0bf83d
-	to->di_nextents = cpu_to_be32(from->di_nextents);
0bf83d
-	to->di_anextents = cpu_to_be16(from->di_anextents);
0bf83d
-	to->di_forkoff = from->di_forkoff;
0bf83d
-	to->di_aformat = from->di_aformat;
0bf83d
-	to->di_dmevmask = cpu_to_be32(from->di_dmevmask);
0bf83d
-	to->di_dmstate = cpu_to_be16(from->di_dmstate);
0bf83d
-	to->di_flags = cpu_to_be16(from->di_flags);
0bf83d
-	to->di_gen = cpu_to_be32(from->di_gen);
0bf83d
-
0bf83d
-	if (from->di_version == 3) {
0bf83d
-		to->di_changecount = cpu_to_be64(from->di_changecount);
0bf83d
-		to->di_crtime.t_sec = cpu_to_be32(from->di_crtime.t_sec);
0bf83d
-		to->di_crtime.t_nsec = cpu_to_be32(from->di_crtime.t_nsec);
0bf83d
-		to->di_flags2 = cpu_to_be64(from->di_flags2);
0bf83d
-		to->di_cowextsize = cpu_to_be32(from->di_cowextsize);
0bf83d
-		to->di_ino = cpu_to_be64(from->di_ino);
0bf83d
-		to->di_lsn = cpu_to_be64(from->di_lsn);
0bf83d
-		memcpy(to->di_pad2, from->di_pad2, sizeof(to->di_pad2));
0bf83d
-		uuid_copy(&to->di_uuid, &from->di_uuid);
0bf83d
-		to->di_flushiter = 0;
0bf83d
-	} else {
0bf83d
-		to->di_flushiter = cpu_to_be16(from->di_flushiter);
0bf83d
-	}
0bf83d
-}
0bf83d
-
0bf83d
 static xfs_failaddr_t
0bf83d
 xfs_dinode_verify_fork(
0bf83d
 	struct xfs_dinode	*dip,
0bf83d
diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h
0bf83d
index c9ac69c..0343368 100644
0bf83d
--- a/libxfs/xfs_inode_buf.h
0bf83d
+++ b/libxfs/xfs_inode_buf.h
0bf83d
@@ -59,8 +59,6 @@ void	xfs_dinode_calc_crc(struct xfs_mount *, struct xfs_dinode *);
0bf83d
 void	xfs_inode_to_disk(struct xfs_inode *ip, struct xfs_dinode *to,
0bf83d
 			  xfs_lsn_t lsn);
0bf83d
 void	xfs_inode_from_disk(struct xfs_inode *ip, struct xfs_dinode *from);
0bf83d
-void	xfs_log_dinode_to_disk(struct xfs_log_dinode *from,
0bf83d
-			       struct xfs_dinode *to);
0bf83d
 
0bf83d
 bool	xfs_dinode_good_version(struct xfs_mount *mp, __u8 version);
0bf83d