Unionfs: add un/likely conditionals on headers
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 25 Sep 2007 04:47:01 +0000 (00:47 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 23 Mar 2008 03:48:39 +0000 (23:48 -0400)
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 51b2bd8a21fe00a8c3cd6280453de1bc48c833a4..8e0da399a1438a8cf200ed7893262ce026f9c211 100644 (file)
@@ -474,7 +474,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 */
@@ -486,7 +486,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);