From: Valerie Aurora <val@versity.com>
To: rpdfs-devel@lists.linux.dev
Subject: [PATCH 2/6] rpdfs: add inode change debugging routine
Date: Thu, 7 May 2026 15:21:49 +0200 [thread overview]
Message-ID: <20260507132153.1161324-3-val@versity.com> (raw)
In-Reply-To: <20260507132153.1161324-1-val@versity.com>
print_inode_change() can be added to copy_vfs_inode_to_rinode() to
log what has changed since the last inode update.
Signed-off-by: Valerie Aurora <val@versity.com>
---
fs/rpdfs/inode.c | 42 +++++++++++++++++++++++++++++++++++++-----
1 file changed, 37 insertions(+), 5 deletions(-)
diff --git a/fs/rpdfs/inode.c b/fs/rpdfs/inode.c
index 428c9081fd75..a2baa862f6a4 100644
--- a/fs/rpdfs/inode.c
+++ b/fs/rpdfs/inode.c
@@ -87,6 +87,43 @@ static __le64 cpu_ts64_to_le64_ns(struct timespec64 ts)
return cpu_to_le64(timespec64_to_ns(&ts));
}
+static u64 ts64_to_ns(struct timespec64 ts)
+{
+ return timespec64_to_ns(&ts);
+}
+
+__always_unused
+static inline void print_diff64(char *name, u64 new, u64 old)
+{
+ if (old != new)
+ rpdfs_prd("%s: %llu -> %llu (%lld)", name, old, new, new - old);
+}
+
+__always_unused
+static void print_inode_change(struct inode *inode, struct rpdfs_inode *rinode)
+{
+ struct rpdfs_inode_info *ri = RPDFS_I(inode);
+
+ rpdfs_prd("copying inode %lu to rinode", inode->i_ino);
+
+ print_diff64("ino", le64_to_cpu(ri->ig.ino), le64_to_cpu(rinode->ig.ino));
+ print_diff64("gen", le64_to_cpu(ri->ig.gen), le64_to_cpu(rinode->ig.gen));
+ print_diff64("i_size", i_size_read(inode), le64_to_cpu(rinode->size));
+ print_diff64("nlink", inode->i_nlink, le32_to_cpu(rinode->nlink));
+ print_diff64("uid", i_uid_read(inode), le32_to_cpu(rinode->uid));
+ print_diff64("gid", i_gid_read(inode), le32_to_cpu(rinode->gid));
+ print_diff64("mode", inode->i_mode, le32_to_cpu(rinode->mode));
+
+ print_diff64("atime", ts64_to_ns(inode_get_atime(inode)), le64_to_cpu(rinode->atime_nsec));
+ print_diff64("mtime", ts64_to_ns(inode_get_mtime(inode)), le64_to_cpu(rinode->mtime_nsec));
+ print_diff64("ctime", ts64_to_ns(inode_get_ctime(inode)), le64_to_cpu(rinode->ctime_nsec));
+ print_diff64("crtime", le64_to_cpu(ri->crtime_nsec), le64_to_cpu(rinode->crtime_nsec));
+
+ print_diff64("dirents", le64_to_cpu(ri->dirents.ref.bnr), le64_to_cpu(rinode->dirents.ref.bnr));
+ print_diff64("xattrs", le64_to_cpu(ri->xattrs.ref.bnr), le64_to_cpu(rinode->xattrs.ref.bnr));
+ print_diff64("xattr_creates", le64_to_cpu(ri->xattr_creates), le64_to_cpu(rinode->xattr_creates));
+}
+
static void copy_vfs_inode_to_rinode(struct rpdfs_inode *rinode, struct inode *inode)
{
struct rpdfs_inode_info *ri = RPDFS_I(inode);
@@ -132,11 +169,6 @@ void rpdfs_inode_init_ops(struct inode *inode)
}
}
-static u64 ts64_to_ns(struct timespec64 ts)
-{
- return timespec64_to_ns(&ts);
-}
-
/*
* Update the vfs inode if the caller's persistent version of the rinode
* is more recent. A lot of tasks can be checking a shared inode to see
--
2.49.0
next prev parent reply other threads:[~2026-05-07 13:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-07 13:21 [PATCH 0/6] File data read/write version 2 Valerie Aurora
2026-05-07 13:21 ` [PATCH 1/6] rpdfs: add rpdfs_file_llseek Valerie Aurora
2026-05-07 13:21 ` Valerie Aurora [this message]
2026-05-07 13:21 ` [PATCH 3/6] rpdfs: add basic file data initialization Valerie Aurora
2026-05-07 13:21 ` [PATCH 4/6] rpdfs: add file data allocation and lookup routines Valerie Aurora
2026-05-07 13:21 ` [PATCH 5/6] rpdfs: add rpdfs_write_iter/rpdfs_read_iter Valerie Aurora
2026-05-07 13:21 ` [PATCH 6/6] rpdfs: add read_folio, dirty_folio, write_begin, write_end Valerie Aurora
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=20260507132153.1161324-3-val@versity.com \
--to=val@versity.com \
--cc=rpdfs-devel@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.