Commit ed97bd37 authored by Andreas Mohr's avatar Andreas Mohr Committed by Linus Torvalds
Browse files

[PATCH] fs/inode.c tweaks

Only touch inode's i_mtime and i_ctime to make them equal to "now" in case
they aren't yet (don't just update timestamp unconditionally).  Uninline
the hash function to save 259 Bytes.

This tiny inode change which may improve cache behaviour also shaves off 8
Bytes from file_update_time() on i386.

Included a tiny codestyle cleanup, too.
Signed-off-by: default avatarAndreas Mohr <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 07acaf28
......@@ -657,7 +657,7 @@ static struct inode * get_new_inode_fast(struct super_block *sb, struct hlist_he
return inode;
static inline unsigned long hash(struct super_block *sb, unsigned long hashval)
static unsigned long hash(struct super_block *sb, unsigned long hashval)
unsigned long tmp;
......@@ -1003,7 +1003,7 @@ void generic_delete_inode(struct inode *inode)
inode->i_state |= I_FREEING;
......@@ -1210,13 +1210,15 @@ void file_update_time(struct file *file)
now = current_fs_time(inode->i_sb);
if (!timespec_equal(&inode->i_mtime, &now))
if (!timespec_equal(&inode->i_mtime, &now)) {
inode->i_mtime = now;
sync_it = 1;
inode->i_mtime = now;
if (!timespec_equal(&inode->i_ctime, &now))
if (!timespec_equal(&inode->i_ctime, &now)) {
inode->i_ctime = now;
sync_it = 1;
inode->i_ctime = now;
if (sync_it)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment