Btrfs: switch to kvfree() helper
authorWang Shilong <wangshilong1991@gmail.com>
Sat, 22 Nov 2014 13:13:10 +0000 (21:13 +0800)
committerDavid Sterba <dsterba@suse.cz>
Mon, 16 Feb 2015 17:48:43 +0000 (18:48 +0100)
A new helper kvfree() in mm/utils.c will do this.

Signed-off-by: Wang Shilong <wangshilong1991@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
fs/btrfs/check-integrity.c
fs/btrfs/raid56.c

index d897ef803b3b6f3efcb0e8fc3d05bbeff994da35..77ba1634c9ab1eee00ffd91b4b78e9f702613835 100644 (file)
@@ -3241,8 +3241,5 @@ void btrfsic_unmount(struct btrfs_root *root,
 
        mutex_unlock(&btrfsic_mutex);
 
-       if (is_vmalloc_addr(state))
-               vfree(state);
-       else
-               kfree(state);
+       kvfree(state);
 }
index 5264858ed7683f2306ccba372bf510c4509862fa..1ccc40bb61f5956c169c7285cf57aa574cccd2f2 100644 (file)
@@ -237,12 +237,8 @@ int btrfs_alloc_stripe_hash_table(struct btrfs_fs_info *info)
        }
 
        x = cmpxchg(&info->stripe_hash_table, NULL, table);
-       if (x) {
-               if (is_vmalloc_addr(x))
-                       vfree(x);
-               else
-                       kfree(x);
-       }
+       if (x)
+               kvfree(x);
        return 0;
 }
 
@@ -453,10 +449,7 @@ void btrfs_free_stripe_hash_table(struct btrfs_fs_info *info)
        if (!info->stripe_hash_table)
                return;
        btrfs_clear_rbio_cache(info);
-       if (is_vmalloc_addr(info->stripe_hash_table))
-               vfree(info->stripe_hash_table);
-       else
-               kfree(info->stripe_hash_table);
+       kvfree(info->stripe_hash_table);
        info->stripe_hash_table = NULL;
 }