From fbd6c68a6b77a8555c7fe6b2d67b875afaed93ff Mon Sep 17 00:00:00 2001 From: adilger Date: Thu, 4 Sep 2003 18:47:11 +0000 Subject: [PATCH] Move inode_update_time() to filter_io_24.c, as this is a VFS function in 2.6. --- lustre/obdfilter/filter_io_24.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lustre/obdfilter/filter_io_24.c b/lustre/obdfilter/filter_io_24.c index dd1a185..a109ef6 100644 --- a/lustre/obdfilter/filter_io_24.c +++ b/lustre/obdfilter/filter_io_24.c @@ -40,6 +40,19 @@ #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) -- 1.8.3.1