From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH 14/15] xfs: move di_changecount to VFS inode
Date: Wed, 17 Feb 2016 18:20:51 +1100 [thread overview]
Message-ID: <1455693652-3899-15-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1455693652-3899-1-git-send-email-david@fromorbit.com>
From: Dave Chinner <dchinner@redhat.com>
Source kernel commit 83e06f21b439b7b308eda06332a4feef35739e94
We can store the di_changecount in the i_version field of the VFS
inode and remove another 8 bytes from the xfs_icdinode.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
---
include/xfs_inode.h | 1 +
libxfs/util.c | 4 ++--
libxfs/xfs_inode_buf.c | 4 ++--
libxfs/xfs_inode_buf.h | 1 -
repair/phase6.c | 6 +++---
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/xfs_inode.h b/include/xfs_inode.h
index f7ad924..0290f97 100644
--- a/include/xfs_inode.h
+++ b/include/xfs_inode.h
@@ -36,6 +36,7 @@ struct xfs_dir_ops;
struct inode {
uint32_t i_nlink;
uint32_t i_generation;
+ uint64_t i_version;
struct timespec i_atime;
struct timespec i_mtime;
struct timespec i_ctime;
diff --git a/libxfs/util.c b/libxfs/util.c
index 3263ae7..9c2f1d2 100644
--- a/libxfs/util.c
+++ b/libxfs/util.c
@@ -255,7 +255,7 @@ libxfs_ialloc(
if (ip->i_d.di_version == 3) {
ASSERT(ip->i_d.di_ino == ino);
ASSERT(uuid_equal(&ip->i_d.di_uuid, &mp->m_sb.sb_meta_uuid));
- ip->i_d.di_changecount = 1;
+ VFS_I(ip)->i_version = 1;
ip->i_d.di_flags2 = 0;
ip->i_d.di_crtime.t_sec = (__int32_t)VFS_I(ip)->i_mtime.tv_sec;
ip->i_d.di_crtime.t_nsec = (__int32_t)VFS_I(ip)->i_mtime.tv_nsec;
@@ -431,7 +431,7 @@ libxfs_iflush_int(xfs_inode_t *ip, xfs_buf_t *bp)
/* bump the change count on v3 inodes */
if (ip->i_d.di_version == 3)
- ip->i_d.di_changecount++;
+ VFS_I(ip)->i_version++;
/*
* Copy the dirty parts of the inode into the on-disk
diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c
index 224edd3..da9edcd 100644
--- a/libxfs/xfs_inode_buf.c
+++ b/libxfs/xfs_inode_buf.c
@@ -260,7 +260,7 @@ xfs_inode_from_disk(
to->di_flags = be16_to_cpu(from->di_flags);
if (to->di_version == 3) {
- to->di_changecount = be64_to_cpu(from->di_changecount);
+ inode->i_version = be64_to_cpu(from->di_changecount);
to->di_crtime.t_sec = be32_to_cpu(from->di_crtime.t_sec);
to->di_crtime.t_nsec = be32_to_cpu(from->di_crtime.t_nsec);
to->di_flags2 = be64_to_cpu(from->di_flags2);
@@ -309,7 +309,7 @@ xfs_inode_to_disk(
to->di_flags = cpu_to_be16(from->di_flags);
if (from->di_version == 3) {
- to->di_changecount = cpu_to_be64(from->di_changecount);
+ to->di_changecount = cpu_to_be64(inode->i_version);
to->di_crtime.t_sec = cpu_to_be32(from->di_crtime.t_sec);
to->di_crtime.t_nsec = cpu_to_be32(from->di_crtime.t_nsec);
to->di_flags2 = cpu_to_be64(from->di_flags2);
diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h
index 83ae8ed..ad98fdd 100644
--- a/libxfs/xfs_inode_buf.h
+++ b/libxfs/xfs_inode_buf.h
@@ -47,7 +47,6 @@ struct xfs_icdinode {
__uint16_t di_dmstate; /* DMIG state info */
__uint16_t di_flags; /* random flags, XFS_DIFLAG_... */
- __uint64_t di_changecount; /* number of attribute changes */
__uint64_t di_flags2; /* more random flags */
xfs_ictimestamp_t di_crtime; /* time created */
diff --git a/repair/phase6.c b/repair/phase6.c
index 7e14346..7415199 100644
--- a/repair/phase6.c
+++ b/repair/phase6.c
@@ -519,7 +519,7 @@ mk_rbmino(xfs_mount_t *mp)
times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD;
if (ip->i_d.di_version == 3) {
- ip->i_d.di_changecount = 1;
+ VFS_I(ip)->i_version = 1;
ip->i_d.di_flags2 = 0;
times |= XFS_ICHGTIME_CREATE;
}
@@ -772,7 +772,7 @@ mk_rsumino(xfs_mount_t *mp)
times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD;
if (ip->i_d.di_version == 3) {
- ip->i_d.di_changecount = 1;
+ VFS_I(ip)->i_version = 1;
ip->i_d.di_flags2 = 0;
times |= XFS_ICHGTIME_CREATE;
}
@@ -881,7 +881,7 @@ mk_root_dir(xfs_mount_t *mp)
times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD;
if (ip->i_d.di_version == 3) {
- ip->i_d.di_changecount = 1;
+ VFS_I(ip)->i_version = 1;
ip->i_d.di_flags2 = 0;
times |= XFS_ICHGTIME_CREATE;
}
--
2.7.0
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2016-02-17 7:21 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-17 7:20 [PATCH 00/15] xfsprogs: libxfs kernel sync to 4.6-for-next Dave Chinner
2016-02-17 7:20 ` [PATCH 01/15] xfs: wire up Q_XGETNEXTQUOTA / get_nextdqblk Dave Chinner
2016-02-17 7:25 ` Christoph Hellwig
2016-02-17 7:20 ` [PATCH 02/15] xfs: handle errors from ->free_blocks in xfs_btree_kill_iroot Dave Chinner
2016-02-17 7:20 ` [PATCH 03/15] xfs: factor btree block freeing into a helper Dave Chinner
2016-02-17 7:20 ` [PATCH 04/15] xfs: move buffer invalidation to xfs_btree_free_block Dave Chinner
2016-02-17 7:20 ` [PATCH 05/15] xfs: remove unused function definitions Dave Chinner
2016-02-17 7:20 ` [PATCH 06/15] xfs: RT bitmap and summary buffers are not typed Dave Chinner
2016-02-17 7:20 ` [PATCH 07/15] xfs: RT bitmap and summary buffers need verifiers Dave Chinner
2016-02-17 7:20 ` [PATCH 08/15] xfs: introduce inode log format object Dave Chinner
2016-02-17 7:20 ` [PATCH 09/15] xfs: remove timestamps from incore inode Dave Chinner
2016-02-26 18:02 ` Brian Foster
2016-02-26 19:35 ` Darrick J. Wong
2016-02-17 7:20 ` [PATCH 10/15] xfs: cull unnecessary icdinode fields Dave Chinner
2016-02-17 7:20 ` [PATCH 11/15] xfs: move v1 inode conversion to xfs_inode_from_disk Dave Chinner
2016-02-17 7:32 ` Christoph Hellwig
2016-02-17 7:48 ` Dave Chinner
2016-02-17 8:30 ` Dave Chinner
2016-02-17 8:33 ` Christoph Hellwig
2016-02-17 9:30 ` Dave Chinner
2016-02-17 7:20 ` [PATCH 12/15] xfs: use vfs inode nlink field everywhere Dave Chinner
2016-02-17 7:35 ` Christoph Hellwig
2016-02-17 7:49 ` Dave Chinner
2016-02-17 7:20 ` [PATCH 13/15] xfs: move inode generation count to VFS inode Dave Chinner
2016-02-17 7:20 ` Dave Chinner [this message]
2016-02-17 7:20 ` [PATCH 15/15] xfs: mode di_mode to vfs inode Dave Chinner
2016-02-17 7:56 ` [PATCH 00/15] xfsprogs: libxfs kernel sync to 4.6-for-next Christoph Hellwig
2016-02-17 8:16 ` Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455693652-3899-15-git-send-email-david@fromorbit.com \
--to=david@fromorbit.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox