From cfbc246eaae2a1089911016094b74b3055e8a906 Mon Sep 17 00:00:00 2001 From: Chris Mason Date: Thu, 30 Oct 2008 13:22:14 -0400 Subject: Btrfs: walk compressed pages based on the nr_pages count instead of bytes The byte walk counting was awkward and error prone. This uses the number of pages sent the higher layer to build bios. Signed-off-by: Chris Mason --- fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/btrfs/inode.c') diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 9797592dc86b..6739424c0fe6 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -338,7 +338,7 @@ again: if (!btrfs_test_flag(inode, NOCOMPRESS) && btrfs_test_opt(root, COMPRESS)) { WARN_ON(pages); - pages = kmalloc(sizeof(struct page *) * nr_pages, GFP_NOFS); + pages = kzalloc(sizeof(struct page *) * nr_pages, GFP_NOFS); /* we want to make sure the amount of IO required to satisfy * a random read is reasonably small, so we limit the size -- cgit v1.2.1