Whamcloud - gitweb
Move inode_update_time() to filter_io_24.c, as this is a VFS function in 2.6.
authoradilger <adilger>
Thu, 4 Sep 2003 18:47:11 +0000 (18:47 +0000)
committeradilger <adilger>
Thu, 4 Sep 2003 18:47:11 +0000 (18:47 +0000)
lustre/obdfilter/filter_io_24.c

index dd1a185..a109ef6 100644 (file)
 #include "filter_internal.h"
 
 
+/* We should only change the file mtime (and not the ctime, like
+ * update_inode_times() in generic_file_write()) when we only change data. */
+void inode_update_time(struct inode *inode, int ctime_too)
+{
+        time_t now = CURRENT_TIME;
+        if (inode->i_mtime == now && (!ctime_too || inode->i_ctime == now))
+                return;
+        inode->i_mtime = now;
+        if (ctime_too)
+                inode->i_ctime = now;
+        mark_inode_dirty_sync(inode);
+}
+
 int ext3_map_inode_page(struct inode *inode, struct page *page,
                         unsigned long *blocks, int *created, int create);
 int filter_direct_io(int rw, struct inode *inode, struct kiobuf *iobuf)