All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rpdfs: Set the inode creation time
@ 2026-03-17 18:26 Valerie Aurora
  2026-03-25 21:37 ` Zach Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Valerie Aurora @ 2026-03-17 18:26 UTC (permalink / raw)
  To: rpdfs-devel; +Cc: Valerie Aurora

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-25 21:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-17 18:26 [PATCH] rpdfs: Set the inode creation time Valerie Aurora
2026-03-25 21:37 ` Zach Brown

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.