Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=37756ced1f145aec18917812c3b8a96dbb47990d Commit: 37756ced1f145aec18917812c3b8a96dbb47990d Parent: 4ba4d4c0c52201009232fe9e781a281054a24e75 Author: Eric Dumazet <[EMAIL PROTECTED]> AuthorDate: Sat Feb 10 01:44:49 2007 -0800 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Sun Feb 11 10:51:25 2007 -0800
[PATCH] avoid one conditional branch in touch_atime() I added IS_NOATIME(inode) macro definition in include/linux/fs.h, true if the inode superblock is marked readonly or noatime. This new macro is then used in touch_atime() instead of separatly testing MS_RDONLY and MS_NOATIME Signed-off-by: Eric Dumazet <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- fs/inode.c | 4 +--- include/linux/fs.h | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index bf21dc6..6cacdab 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1160,11 +1160,9 @@ void touch_atime(struct vfsmount *mnt, struct dentry *dentry) struct inode *inode = dentry->d_inode; struct timespec now; - if (IS_RDONLY(inode)) - return; if (inode->i_flags & S_NOATIME) return; - if (inode->i_sb->s_flags & MS_NOATIME) + if (IS_NOATIME(inode)) return; if ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode)) return; diff --git a/include/linux/fs.h b/include/linux/fs.h index 1410e53..822c545 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -169,6 +169,7 @@ extern int dir_notify_enable; #define IS_DIRSYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \ ((inode)->i_flags & (S_SYNC|S_DIRSYNC))) #define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK) +#define IS_NOATIME(inode) __IS_FLG(inode, MS_RDONLY|MS_NOATIME) #define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA) #define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html