btrfs: Remove redundant local zero structure
authorDulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
Thu, 31 Oct 2013 04:59:38 +0000 (10:29 +0530)
committerChris Mason <chris.mason@fusionio.com>
Tue, 12 Nov 2013 03:11:39 +0000 (22:11 -0500)
Remove redundant local zero structure, replacing it by the kernel's
global ZERO_PAGE.

Signed-off-by: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
Reviewed-by: Zach Brown <zab@redhat.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/ioctl.c

index 9ea05506cb842fe7d4ddbc2e031cc627d6fb29c7..78d20482b72a2d247af8a53f574d7ca4f0b246c5 100644 (file)
@@ -368,9 +368,8 @@ static noinline int btrfs_ioctl_fitrim(struct file *file, void __user *arg)
 
 int btrfs_is_empty_uuid(u8 *uuid)
 {
-       static char empty_uuid[BTRFS_UUID_SIZE] = {0};
-
-       return !memcmp(uuid, empty_uuid, BTRFS_UUID_SIZE);
+       BUILD_BUG_ON(BTRFS_UUID_SIZE > PAGE_SIZE);
+       return !memcmp(uuid, empty_zero_page, BTRFS_UUID_SIZE);
 }
 
 static noinline int create_subvol(struct inode *dir,