From b43e064ecc0bdfa425f9fde9652dd4bf147a410b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 29 Oct 2009 10:21:52 +0000 Subject: [PATCH] * Attribute changes now also change the status change time. * While Ingo already convinced me to use the modified time for this instead (see People files, for example), I did not do so for two reasons: 1) The file modification date is important to the user; more or less hidden attribute changes shouldn't have an effect on this. 2) Efficiency: the last_modified field is indexed whereas status_change is not. Speed would suffer noticeably else. * We might want to think about a new "stat::st_attrtim" field, though, instead. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33825 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp b/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp index 20bd6ccb83..bb59261b95 100644 --- a/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp @@ -3,6 +3,7 @@ * This file may be used under the terms of the MIT License. */ + //! file system interface to Haiku's vnode layer @@ -1810,12 +1811,18 @@ bfs_write_attr(fs_volume* _volume, fs_vnode* _file, void* _cookie, status_t status = attribute.Write(transaction, cookie, pos, (const uint8*)buffer, _length); if (status == B_OK) { + // Update status time on attribute write + inode->Node().status_change_time = HOST_ENDIAN_TO_BFS_INT64( + bfs_inode::ToInode(real_time_clock_usecs())); + inode->WriteBack(transaction); + status = transaction.Done(); if (status == B_OK) { notify_attribute_changed(volume->ID(), inode->ID(), cookie->name, B_ATTR_CHANGED); // TODO: B_ATTR_CREATED is not yet taken into account // (we don't know what Attribute::Write() does exactly) + notify_stat_changed(volume->ID(), inode->ID(), B_STAT_CHANGE_TIME); } }