From 7ab95c191542deb6ea12c533f04abccfa49751c5 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Sun, 19 Sep 2010 22:09:00 +1000 Subject: [PATCH] Update filesys mtime Do this when inode is dirtied. Maybe this isn't the perfect time, but it is fairly good for now. Signed-off-by: NeilBrown --- inode.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/inode.c b/inode.c index a476873..88312c3 100644 --- a/inode.c +++ b/inode.c @@ -1059,9 +1059,20 @@ void lafs_dirty_inode(struct inode *ino) * the datablock from the inode. * If an update has to wait for the next phase, lock_dblock * (e.g. in setattr) will do that. + * + * We also use this opportunity to update the filesystem modify time. */ + struct timespec now; + struct inode *filesys; set_bit(I_Dirty, &LAFSI(ino)->iflags); ino->i_sb->s_dirt = 1; + + now = current_fs_time(ino->i_sb); + filesys = ino_from_sb(ino->i_sb); + if (!timespec_equal(&filesys->i_mtime, &now)) { + filesys->i_mtime = now; + set_bit(I_Dirty, &LAFSI(filesys)->iflags); + } } int lafs_sync_inode(struct inode *ino, int wait) -- 2.39.5