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