From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH 7/8] xfs: move di_changecount to VFS inode
Date: Tue, 12 Jan 2016 20:01:19 +1100 [thread overview]
Message-ID: <1452589280-30167-8-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1452589280-30167-1-git-send-email-david@fromorbit.com>
From: Dave Chinner <dchinner@redhat.com>
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>
---
fs/xfs/libxfs/xfs_inode_buf.c | 4 ++--
fs/xfs/libxfs/xfs_inode_buf.h | 1 -
fs/xfs/xfs_inode.c | 2 +-
fs/xfs/xfs_inode_item.c | 2 +-
fs/xfs/xfs_trans_inode.c | 2 +-
5 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c
index 0cf5a16..a2b10e3 100644
--- a/fs/xfs/libxfs/xfs_inode_buf.c
+++ b/fs/xfs/libxfs/xfs_inode_buf.c
@@ -245,7 +245,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);
@@ -294,7 +294,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/fs/xfs/libxfs/xfs_inode_buf.h b/fs/xfs/libxfs/xfs_inode_buf.h
index 68da576..e49c229 100644
--- a/fs/xfs/libxfs/xfs_inode_buf.h
+++ b/fs/xfs/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/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index c8fa5d6..f0b9ccb 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -832,7 +832,7 @@ xfs_ialloc(
ip->i_d.di_flags = 0;
if (ip->i_d.di_version == 3) {
- ip->i_d.di_changecount = 1;
+ inode->i_version = 1;
ip->i_d.di_flags2 = 0;
ip->i_d.di_crtime.t_sec = (__int32_t)tv.tv_sec;
ip->i_d.di_crtime.t_nsec = (__int32_t)tv.tv_nsec;
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c
index 5cdf5ef..334d657 100644
--- a/fs/xfs/xfs_inode_item.c
+++ b/fs/xfs/xfs_inode_item.c
@@ -364,7 +364,7 @@ xfs_inode_to_log_dinode(
to->di_flags = from->di_flags;
if (from->di_version == 3) {
- to->di_changecount = from->di_changecount;
+ to->di_changecount = inode->i_version;
to->di_crtime.t_sec = from->di_crtime.t_sec;
to->di_crtime.t_nsec = from->di_crtime.t_nsec;
to->di_flags2 = from->di_flags2;
diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c
index 3f0d466..11a3af0 100644
--- a/fs/xfs/xfs_trans_inode.c
+++ b/fs/xfs/xfs_trans_inode.c
@@ -117,7 +117,7 @@ xfs_trans_log_inode(
*/
if (!(ip->i_itemp->ili_item.li_desc->lid_flags & XFS_LID_DIRTY) &&
IS_I_VERSION(VFS_I(ip))) {
- ip->i_d.di_changecount = ++VFS_I(ip)->i_version;
+ VFS_I(ip)->i_version++;
flags |= XFS_ILOG_CORE;
}
--
2.5.0
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2016-01-12 9:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-12 9:01 [RFC PATCH 0/8] xfs: shrink the struct xfs_icdinode Dave Chinner
2016-01-12 9:01 ` [PATCH 1/8] xfs: introduce inode log format object Dave Chinner
2016-01-12 9:01 ` [PATCH 2/8] xfs: remove timestamps from incore inode Dave Chinner
2016-01-12 9:01 ` [PATCH 3/8] xfs; cull unnecessary icdinode fields Dave Chinner
2016-01-12 9:01 ` [PATCH 4/8] xfs: move v1 inode conversion to xfs_inode_from_disk Dave Chinner
2016-01-12 9:01 ` [PATCH 5/8] xfs: use vfs inode nlink field everywhere Dave Chinner
2016-01-12 9:01 ` [PATCH 6/8] xfs: move inode generation count to VFS inode Dave Chinner
2016-01-12 9:01 ` Dave Chinner [this message]
2016-01-12 9:01 ` [PATCH 8/8] xfs: mode di_mode to vfs inode Dave Chinner
2016-01-12 15:30 ` [RFC PATCH 0/8] xfs: shrink the struct xfs_icdinode Christoph Hellwig
2016-01-12 21:05 ` Dave Chinner
-- strict thread matches above, loose matches on Subject: below --
2016-01-14 6:09 [PATCH v2 0/8] xfs: shrink the xfs_icdinode Dave Chinner
2016-01-14 6:09 ` [PATCH 7/8] xfs: move di_changecount to VFS inode Dave Chinner
2016-01-25 18:25 ` Brian Foster
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=1452589280-30167-8-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