[haiku-commits] r33825 - haiku/trunk/src/add-ons/kernel/file_systems/bfs

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 29 Oct 2009 11:21:52 +0100 (CET)

Author: axeld
Date: 2009-10-29 11:21:52 +0100 (Thu, 29 Oct 2009)
New Revision: 33825
Changeset: http://dev.haiku-os.org/changeset/33825/haiku

Modified:
   haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp
Log:
* 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.


Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp        
2009-10-29 10:11:24 UTC (rev 33824)
+++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp        
2009-10-29 10:21:52 UTC (rev 33825)
@@ -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 @@
        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);
                }
        }
 


Other related posts:

  • » [haiku-commits] r33825 - haiku/trunk/src/add-ons/kernel/file_systems/bfs - axeld