提交 e98d5e88 编写于 作者: C Christoph Hellwig 提交者: Darrick J. Wong

xfs: move the di_crtime field to struct xfs_inode

Move the crtime field from struct xfs_icdinode into stuct xfs_inode and
remove the now entirely unused struct xfs_icdinode.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NDarrick J. Wong <djwong@kernel.org>
Signed-off-by: NDarrick J. Wong <djwong@kernel.org>
上级 3e09ab8f
...@@ -955,9 +955,8 @@ static inline time64_t xfs_bigtime_to_unix(uint64_t ondisk_seconds) ...@@ -955,9 +955,8 @@ static inline time64_t xfs_bigtime_to_unix(uint64_t ondisk_seconds)
* attribute use the XFS_DFORK_DPTR, XFS_DFORK_APTR, and XFS_DFORK_PTR macros * attribute use the XFS_DFORK_DPTR, XFS_DFORK_APTR, and XFS_DFORK_PTR macros
* below. * below.
* *
* There is a very similar struct icdinode in xfs_inode which matches the * There is a very similar struct xfs_log_dinode which matches the layout of
* layout of the first 96 bytes of this structure, but is kept in native * this structure, but is kept in native format instead of big endian.
* format instead of big endian.
* *
* Note: di_flushiter is only used by v1/2 inodes - it's effectively a zeroed * Note: di_flushiter is only used by v1/2 inodes - it's effectively a zeroed
* padding field for v3 inodes. * padding field for v3 inodes.
......
...@@ -173,7 +173,6 @@ xfs_inode_from_disk( ...@@ -173,7 +173,6 @@ xfs_inode_from_disk(
struct xfs_inode *ip, struct xfs_inode *ip,
struct xfs_dinode *from) struct xfs_dinode *from)
{ {
struct xfs_icdinode *to = &ip->i_d;
struct inode *inode = VFS_I(ip); struct inode *inode = VFS_I(ip);
int error; int error;
xfs_failaddr_t fa; xfs_failaddr_t fa;
...@@ -239,7 +238,7 @@ xfs_inode_from_disk( ...@@ -239,7 +238,7 @@ xfs_inode_from_disk(
if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) { if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) {
inode_set_iversion_queried(inode, inode_set_iversion_queried(inode,
be64_to_cpu(from->di_changecount)); be64_to_cpu(from->di_changecount));
to->di_crtime = xfs_inode_from_disk_ts(from, from->di_crtime); ip->i_crtime = xfs_inode_from_disk_ts(from, from->di_crtime);
ip->i_diflags2 = be64_to_cpu(from->di_flags2); ip->i_diflags2 = be64_to_cpu(from->di_flags2);
ip->i_cowextsize = be32_to_cpu(from->di_cowextsize); ip->i_cowextsize = be32_to_cpu(from->di_cowextsize);
} }
...@@ -286,7 +285,6 @@ xfs_inode_to_disk( ...@@ -286,7 +285,6 @@ xfs_inode_to_disk(
struct xfs_dinode *to, struct xfs_dinode *to,
xfs_lsn_t lsn) xfs_lsn_t lsn)
{ {
struct xfs_icdinode *from = &ip->i_d;
struct inode *inode = VFS_I(ip); struct inode *inode = VFS_I(ip);
to->di_magic = cpu_to_be16(XFS_DINODE_MAGIC); to->di_magic = cpu_to_be16(XFS_DINODE_MAGIC);
...@@ -318,7 +316,7 @@ xfs_inode_to_disk( ...@@ -318,7 +316,7 @@ xfs_inode_to_disk(
if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) { if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) {
to->di_version = 3; to->di_version = 3;
to->di_changecount = cpu_to_be64(inode_peek_iversion(inode)); to->di_changecount = cpu_to_be64(inode_peek_iversion(inode));
to->di_crtime = xfs_inode_to_disk_ts(ip, from->di_crtime); to->di_crtime = xfs_inode_to_disk_ts(ip, ip->i_crtime);
to->di_flags2 = cpu_to_be64(ip->i_diflags2); to->di_flags2 = cpu_to_be64(ip->i_diflags2);
to->di_cowextsize = cpu_to_be32(ip->i_cowextsize); to->di_cowextsize = cpu_to_be32(ip->i_cowextsize);
to->di_ino = cpu_to_be64(ip->i_ino); to->di_ino = cpu_to_be64(ip->i_ino);
......
...@@ -9,16 +9,6 @@ ...@@ -9,16 +9,6 @@
struct xfs_inode; struct xfs_inode;
struct xfs_dinode; struct xfs_dinode;
/*
* In memory representation of the XFS inode. This is held in the in-core struct
* xfs_inode and represents the current on disk values but the structure is not
* in on-disk format. That is, this structure is always translated to on-disk
* format specific structures at the appropriate time.
*/
struct xfs_icdinode {
struct timespec64 di_crtime; /* time created */
};
/* /*
* Inode location information. Stored in the inode and passed to * Inode location information. Stored in the inode and passed to
* xfs_imap_to_bp() to get a buffer and dinode for a given inode. * xfs_imap_to_bp() to get a buffer and dinode for a given inode.
......
...@@ -70,7 +70,7 @@ xfs_trans_ichgtime( ...@@ -70,7 +70,7 @@ xfs_trans_ichgtime(
if (flags & XFS_ICHGTIME_CHG) if (flags & XFS_ICHGTIME_CHG)
inode->i_ctime = tv; inode->i_ctime = tv;
if (flags & XFS_ICHGTIME_CREATE) if (flags & XFS_ICHGTIME_CREATE)
ip->i_d.di_crtime = tv; ip->i_crtime = tv;
} }
/* /*
......
...@@ -843,7 +843,7 @@ xfs_init_new_inode( ...@@ -843,7 +843,7 @@ xfs_init_new_inode(
if (xfs_sb_version_has_v3inode(&mp->m_sb)) { if (xfs_sb_version_has_v3inode(&mp->m_sb)) {
inode_set_iversion(inode, 1); inode_set_iversion(inode, 1);
ip->i_cowextsize = 0; ip->i_cowextsize = 0;
ip->i_d.di_crtime = tv; ip->i_crtime = tv;
} }
flags = XFS_ILOG_CORE; flags = XFS_ILOG_CORE;
......
...@@ -66,8 +66,7 @@ typedef struct xfs_inode { ...@@ -66,8 +66,7 @@ typedef struct xfs_inode {
uint8_t i_forkoff; /* attr fork offset >> 3 */ uint8_t i_forkoff; /* attr fork offset >> 3 */
uint16_t i_diflags; /* XFS_DIFLAG_... */ uint16_t i_diflags; /* XFS_DIFLAG_... */
uint64_t i_diflags2; /* XFS_DIFLAG2_... */ uint64_t i_diflags2; /* XFS_DIFLAG2_... */
struct timespec64 i_crtime; /* time created */
struct xfs_icdinode i_d; /* most of ondisk inode */
/* VFS inode */ /* VFS inode */
struct inode i_vnode; /* embedded VFS inode */ struct inode i_vnode; /* embedded VFS inode */
......
...@@ -350,7 +350,6 @@ xfs_inode_to_log_dinode( ...@@ -350,7 +350,6 @@ xfs_inode_to_log_dinode(
struct xfs_log_dinode *to, struct xfs_log_dinode *to,
xfs_lsn_t lsn) xfs_lsn_t lsn)
{ {
struct xfs_icdinode *from = &ip->i_d;
struct inode *inode = VFS_I(ip); struct inode *inode = VFS_I(ip);
to->di_magic = XFS_DINODE_MAGIC; to->di_magic = XFS_DINODE_MAGIC;
...@@ -386,7 +385,7 @@ xfs_inode_to_log_dinode( ...@@ -386,7 +385,7 @@ xfs_inode_to_log_dinode(
if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) { if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) {
to->di_version = 3; to->di_version = 3;
to->di_changecount = inode_peek_iversion(inode); to->di_changecount = inode_peek_iversion(inode);
to->di_crtime = xfs_inode_to_log_dinode_ts(ip, from->di_crtime); to->di_crtime = xfs_inode_to_log_dinode_ts(ip, ip->i_crtime);
to->di_flags2 = ip->i_diflags2; to->di_flags2 = ip->i_diflags2;
to->di_cowextsize = ip->i_cowextsize; to->di_cowextsize = ip->i_cowextsize;
to->di_ino = ip->i_ino; to->di_ino = ip->i_ino;
......
...@@ -599,7 +599,7 @@ xfs_vn_getattr( ...@@ -599,7 +599,7 @@ xfs_vn_getattr(
if (xfs_sb_version_has_v3inode(&mp->m_sb)) { if (xfs_sb_version_has_v3inode(&mp->m_sb)) {
if (request_mask & STATX_BTIME) { if (request_mask & STATX_BTIME) {
stat->result_mask |= STATX_BTIME; stat->result_mask |= STATX_BTIME;
stat->btime = ip->i_d.di_crtime; stat->btime = ip->i_crtime;
} }
} }
......
...@@ -60,7 +60,6 @@ xfs_bulkstat_one_int( ...@@ -60,7 +60,6 @@ xfs_bulkstat_one_int(
struct xfs_bstat_chunk *bc) struct xfs_bstat_chunk *bc)
{ {
struct user_namespace *sb_userns = mp->m_super->s_user_ns; struct user_namespace *sb_userns = mp->m_super->s_user_ns;
struct xfs_icdinode *dic; /* dinode core info pointer */
struct xfs_inode *ip; /* incore inode pointer */ struct xfs_inode *ip; /* incore inode pointer */
struct inode *inode; struct inode *inode;
struct xfs_bulkstat *buf = bc->buf; struct xfs_bulkstat *buf = bc->buf;
...@@ -81,8 +80,6 @@ xfs_bulkstat_one_int( ...@@ -81,8 +80,6 @@ xfs_bulkstat_one_int(
ASSERT(ip->i_imap.im_blkno != 0); ASSERT(ip->i_imap.im_blkno != 0);
inode = VFS_I(ip); inode = VFS_I(ip);
dic = &ip->i_d;
/* xfs_iget returns the following without needing /* xfs_iget returns the following without needing
* further change. * further change.
*/ */
...@@ -111,8 +108,8 @@ xfs_bulkstat_one_int( ...@@ -111,8 +108,8 @@ xfs_bulkstat_one_int(
buf->bs_version = XFS_BULKSTAT_VERSION_V5; buf->bs_version = XFS_BULKSTAT_VERSION_V5;
if (xfs_sb_version_has_v3inode(&mp->m_sb)) { if (xfs_sb_version_has_v3inode(&mp->m_sb)) {
buf->bs_btime = dic->di_crtime.tv_sec; buf->bs_btime = ip->i_crtime.tv_sec;
buf->bs_btime_nsec = dic->di_crtime.tv_nsec; buf->bs_btime_nsec = ip->i_crtime.tv_nsec;
if (ip->i_diflags2 & XFS_DIFLAG2_COWEXTSIZE) if (ip->i_diflags2 & XFS_DIFLAG2_COWEXTSIZE)
buf->bs_cowextsize_blks = ip->i_cowextsize; buf->bs_cowextsize_blks = ip->i_cowextsize;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册