mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] hpfs: update ctime/mtime of old/new_dir
@ 2015-03-24 21:25 Taesoo Kim
  2015-08-11 19:40 ` Mikulas Patocka
  0 siblings, 1 reply; 2+ messages in thread
From: Taesoo Kim @ 2015-03-24 21:25 UTC (permalink / raw)
  To: mikulas, linux-kernel
  Cc: taesoo, changwoo, sanidhya, blee, csong84, Taesoo Kim

Upon successful rename(), update ctime and mtime of
old/new_dir, as posix specifies.

Signed-off-by: Taesoo Kim <tsgatesv@gmail.com>
---
 fs/hpfs/namei.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c
index bdbc2c3..8d8669c 100644
--- a/fs/hpfs/namei.c
+++ b/fs/hpfs/namei.c
@@ -600,6 +600,12 @@ static int hpfs_rename(struct inode *old_dir, struct dentry *old_dentry,
 	if (S_ISDIR(i->i_mode)) {
 		inc_nlink(new_dir);
 		drop_nlink(old_dir);
+
+		old_dir->i_ctime.tv_sec = old_dir->i_mtime.tv_sec = local_to_gmt(old_dir->i_sb, get_seconds());
+		old_dir->i_ctime.tv_nsec = old_dir->i_mtime.tv_nsec = 0;
+
+		new_dir->i_ctime.tv_sec = new_dir->i_mtime.tv_sec = local_to_gmt(new_dir->i_sb, get_seconds());
+		new_dir->i_ctime.tv_nsec = new_dir->i_mtime.tv_nsec = 0;
 	}
 	if ((fnode = hpfs_map_fnode(i->i_sb, i->i_ino, &bh))) {
 		fnode->up = cpu_to_le32(new_dir->i_ino);
-- 
2.3.3


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

end of thread, other threads:[~2015-08-11 19:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-24 21:25 [PATCH 1/1] hpfs: update ctime/mtime of old/new_dir Taesoo Kim
2015-08-11 19:40 ` Mikulas Patocka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®