From: Eric Dumazet <dada1@cosmosbay.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] avoid one conditional branch in touch_atime()
Date: Fri, 15 Dec 2006 19:38:54 +0100 [thread overview]
Message-ID: <200612151938.55010.dada1@cosmosbay.com> (raw)
In-Reply-To: <200612151851.58741.dada1@cosmosbay.com>
[-- Attachment #1: Type: text/plain, Size: 279 bytes --]
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 <dada1@cosmosbay.com>
[-- Attachment #2: touch_atime.patch --]
[-- Type: text/plain, Size: 1093 bytes --]
--- linux-2.6.20-rc1-mm1/fs/inode.c 2006-12-14 02:14:23.000000000 +0100
+++ linux-2.6.20-rc1-mm1-ed/fs/inode.c 2006-12-15 20:14:31.000000000 +0100
@@ -1160,11 +1160,9 @@ void touch_atime(struct vfsmount *mnt, s
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;
--- linux-2.6.20-rc1-mm1/include/linux/fs.h 2006-12-15 15:46:16.000000000 +0100
+++ linux-2.6.20-rc1-mm1-ed/include/linux/fs.h 2006-12-15 20:16:13.000000000 +0100
@@ -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)
prev parent reply other threads:[~2006-12-15 18:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200612150823.kBF8NV2u011171@shell0.pdx.osdl.net>
2006-12-15 8:31 ` + schedule_on_each_cpu-use-preempt_disable.patch added to -mm tree Ingo Molnar
2006-12-15 16:11 ` Andrew Morton
2006-12-15 16:24 ` Ingo Molnar
2006-12-15 19:27 ` Andrew Morton
2006-12-15 17:51 ` [PATCH] struct vfsmount : keep mnt_count & mnt_expiry_mark away from mnt_flags Eric Dumazet
2006-12-15 18:38 ` Eric Dumazet [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200612151938.55010.dada1@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®