All of lore.kernel.org
 help / color / mirror / Atom feed
From: Valerie Aurora <val@versity.com>
To: rpdfs-devel@lists.linux.dev
Cc: Valerie Aurora <val@versity.com>
Subject: [PATCH] rpdfs: Set the inode creation time
Date: Tue, 17 Mar 2026 19:26:30 +0100	[thread overview]
Message-ID: <20260317182630.3910-1-val@versity.com> (raw)

Setting inode creation time is slightly trickier than a/m/ctime
because it's not tracked in the VFS inode. Add a field in the rpdfs
private inode info to track it.

Signed-off-by: Valerie Aurora <val@versity.com>
---
 fs/rpdfs/inode.c | 3 +++
 fs/rpdfs/inode.h | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/fs/rpdfs/inode.c b/fs/rpdfs/inode.c
index bdd31ce0b6da..2f41706a59c2 100644
--- a/fs/rpdfs/inode.c
+++ b/fs/rpdfs/inode.c
@@ -71,6 +71,7 @@ static void copy_rinode_to_vfs_inode(struct inode *inode, struct rpdfs_inode *ri
 	inode_set_atime_to_ts(inode, ns_to_timespec64(le64_to_cpu(rinode->atime_nsec)));
 	inode_set_ctime_to_ts(inode, ns_to_timespec64(le64_to_cpu(rinode->ctime_nsec)));
 	inode_set_mtime_to_ts(inode, ns_to_timespec64(le64_to_cpu(rinode->mtime_nsec)));
+	ri->crtime_nsec = rinode->crtime_nsec;
 
 	ri->dirents = rinode->dirents;
 
@@ -97,6 +98,7 @@ static void copy_vfs_inode_to_rinode(struct rpdfs_inode *rinode, struct inode *i
 	rinode->atime_nsec = cpu_ts64_to_le64_ns(inode_get_atime(inode));
 	rinode->ctime_nsec = cpu_ts64_to_le64_ns(inode_get_ctime(inode));
 	rinode->mtime_nsec = cpu_ts64_to_le64_ns(inode_get_mtime(inode));
+	rinode->crtime_nsec = ri->crtime_nsec;
 
 	rinode->dirents = ri->dirents;
 
@@ -303,6 +305,7 @@ struct inode *rpdfs_new_inode(struct super_block *sb, struct rpdfs_ino_gen *ig)
 	ts = inode_set_ctime_current(inode);
 	inode_set_mtime_to_ts(inode, ts);
 	inode_set_atime_to_ts(inode, ts);
+	ri->crtime_nsec = cpu_ts64_to_le64_ns(ts);
 
 	ret = insert_inode_locked4(inode, ig_hashval(ig), rpdfs_iget_test, ig);
 	if (ret < 0) {
diff --git a/fs/rpdfs/inode.h b/fs/rpdfs/inode.h
index 6b0fddb7f0fb..366f4b405e57 100644
--- a/fs/rpdfs/inode.h
+++ b/fs/rpdfs/inode.h
@@ -18,6 +18,9 @@ struct rpdfs_inode_info {
 	/* Uniquifier to avoid xattr name hash collisions */
 	__le64 xattr_creates;
 
+	/* Creation time is not tracked in VFS inode, do it here */
+	__le64 crtime_nsec;
+
 	struct rpdfs_ino_gen ig;
 	struct rpdfs_btree_root dirents;
 	struct rpdfs_btree_root xattrs;
-- 
2.49.0


             reply	other threads:[~2026-03-17 18:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-17 18:26 Valerie Aurora [this message]
2026-03-25 21:37 ` [PATCH] rpdfs: Set the inode creation time Zach Brown

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=20260317182630.3910-1-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.