Unionfs: add un/likely conditionals on xattr ops
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 27 Nov 2007 00:54:38 +0000 (19:54 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 27 Nov 2007 00:54:38 +0000 (19:54 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/xattr.c

index a141241c4aa63ef9a79f84fedd3c9993b64f7b3d..6884023a8eb672ba334e74ae20ec218c9aac0d92 100644 (file)
@@ -25,14 +25,14 @@ void *unionfs_xattr_alloc(size_t size, size_t limit)
 {
        void *ptr;
 
-       if (size > limit)
+       if (unlikely(size > limit))
                return ERR_PTR(-E2BIG);
 
        if (!size)              /* size request, no buffer is needed */
                return NULL;
 
        ptr = kmalloc(size, GFP_KERNEL);
-       if (!ptr)
+       if (unlikely(!ptr))
                return ERR_PTR(-ENOMEM);
        return ptr;
 }
@@ -50,7 +50,7 @@ ssize_t unionfs_getxattr(struct dentry *dentry, const char *name, void *value,
        unionfs_read_lock(dentry->d_sb);
        unionfs_lock_dentry(dentry);
 
-       if (!__unionfs_d_revalidate_chain(dentry, NULL, false)) {
+       if (unlikely(!__unionfs_d_revalidate_chain(dentry, NULL, false))) {
                err = -ESTALE;
                goto out;
        }
@@ -79,7 +79,7 @@ int unionfs_setxattr(struct dentry *dentry, const char *name,
        unionfs_read_lock(dentry->d_sb);
        unionfs_lock_dentry(dentry);
 
-       if (!__unionfs_d_revalidate_chain(dentry, NULL, false)) {
+       if (unlikely(!__unionfs_d_revalidate_chain(dentry, NULL, false))) {
                err = -ESTALE;
                goto out;
        }
@@ -108,7 +108,7 @@ int unionfs_removexattr(struct dentry *dentry, const char *name)
        unionfs_read_lock(dentry->d_sb);
        unionfs_lock_dentry(dentry);
 
-       if (!__unionfs_d_revalidate_chain(dentry, NULL, false)) {
+       if (unlikely(!__unionfs_d_revalidate_chain(dentry, NULL, false))) {
                err = -ESTALE;
                goto out;
        }
@@ -137,7 +137,7 @@ ssize_t unionfs_listxattr(struct dentry *dentry, char *list, size_t size)
        unionfs_read_lock(dentry->d_sb);
        unionfs_lock_dentry(dentry);
 
-       if (!__unionfs_d_revalidate_chain(dentry, NULL, false)) {
+       if (unlikely(!__unionfs_d_revalidate_chain(dentry, NULL, false))) {
                err = -ESTALE;
                goto out;
        }