Unionfs: add un/likely conditionals on headers
authorErez Zadok <ezk@cs.sunysb.edu>
Mon, 24 Sep 2007 06:21:09 +0000 (02:21 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 6 Mar 2011 08:42:45 +0000 (03:42 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/fanout.h
fs/unionfs/union.h

index 51aa0de12ffc7599b423e9cd97e138cdeacc1710..640539936855ad0f8d173fb4f6527f2296b39df7 100644 (file)
@@ -308,17 +308,20 @@ static inline void unionfs_copy_attr_times(struct inode *upper)
        int bindex;
        struct inode *lower;
 
-       if (!upper || ibstart(upper) < 0)
+       if (unlikely(!upper || ibstart(upper) < 0))
                return;
        for (bindex=ibstart(upper); bindex <= ibend(upper); bindex++) {
                lower = unionfs_lower_inode_idx(upper, bindex);
-               if (!lower)
+               if (unlikely(!lower))
                        continue; /* not all lower dir objects may exist */
-               if (timespec_compare(&upper->i_mtime, &lower->i_mtime) < 0)
+               if (unlikely(timespec_compare(&upper->i_mtime,
+                                             &lower->i_mtime) < 0))
                        upper->i_mtime = lower->i_mtime;
-               if (timespec_compare(&upper->i_ctime, &lower->i_ctime) < 0)
+               if (likely(timespec_compare(&upper->i_ctime,
+                                           &lower->i_ctime) < 0))
                        upper->i_ctime = lower->i_ctime;
-               if (timespec_compare(&upper->i_atime, &lower->i_atime) < 0)
+               if (likely(timespec_compare(&upper->i_atime,
+                                           &lower->i_atime) < 0))
                        upper->i_atime = lower->i_atime;
        }
 }
index 870fe563a26087c2aee5983facd4dc8c443b7d00..c371bef1907ac8f03be34aaf4d585aa36bd3c472 100644 (file)
@@ -476,7 +476,7 @@ static inline struct vfsmount *unionfs_mntget(struct dentry *dentry,
 
        mnt = mntget(unionfs_lower_mnt_idx(dentry, bindex));
 #ifdef CONFIG_UNION_FS_DEBUG
-       if (!mnt)
+       if (unlikely(!mnt))
                printk(KERN_DEBUG "unionfs_mntget: mnt=%p bindex=%d\n",
                       mnt, bindex);
 #endif /* CONFIG_UNION_FS_DEBUG */
@@ -488,7 +488,7 @@ static inline void unionfs_mntput(struct dentry *dentry, int bindex)
 {
        struct vfsmount *mnt;
 
-       if (!dentry && bindex < 0)
+       if (unlikely(!dentry && bindex < 0))
                return;
        BUG_ON(!dentry || bindex < 0);