From patchwork Thu Feb 14 09:12:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyungsik Lee X-Patchwork-Id: 2140851 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 427DE3FCFC for ; Thu, 14 Feb 2013 09:12:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756683Ab3BNJMl (ORCPT ); Thu, 14 Feb 2013 04:12:41 -0500 Received: from LGEMRELSE6Q.lge.com ([156.147.1.121]:44905 "EHLO LGEMRELSE6Q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756496Ab3BNJMi (ORCPT ); Thu, 14 Feb 2013 04:12:38 -0500 X-AuditID: 9c930179-b7c24ae00000119c-a8-511caa8443ab Received: from localhost.localdomain ( [10.177.225.63]) by LGEMRELSE6Q.lge.com (Symantec Brightmail Gateway) with SMTP id 12.60.04508.48AAC115; Thu, 14 Feb 2013 18:12:36 +0900 (KST) From: Kyungsik Lee To: Chris Mason , Li Zefan , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Cc: hyojun.im@lge.com, chan.jeong@lge.com, raphael.andy.lee@gmail.com, Kyungsik Lee Subject: [PATCH] btrfs: fix decompress buffer size Date: Thu, 14 Feb 2013 18:12:19 +0900 Message-Id: <1360833139-5850-1-git-send-email-kyungsik.lee@lge.com> X-Mailer: git-send-email 1.8.0.3 X-Brightmail-Tracker: AAAAAA== Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org lzo1x_1_compress() is unnecessarily used for allocating decompress buffer. Signed-off-by: Kyungsik Lee --- fs/btrfs/lzo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c index 743b86f..223893a 100644 --- a/fs/btrfs/lzo.c +++ b/fs/btrfs/lzo.c @@ -55,7 +55,7 @@ static struct list_head *lzo_alloc_workspace(void) return ERR_PTR(-ENOMEM); workspace->mem = vmalloc(LZO1X_MEM_COMPRESS); - workspace->buf = vmalloc(lzo1x_worst_compress(PAGE_CACHE_SIZE)); + workspace->buf = vmalloc(PAGE_CACHE_SIZE); workspace->cbuf = vmalloc(lzo1x_worst_compress(PAGE_CACHE_SIZE)); if (!workspace->mem || !workspace->buf || !workspace->cbuf) goto fail; @@ -349,7 +349,7 @@ cont: } } - out_len = lzo1x_worst_compress(PAGE_CACHE_SIZE); + out_len = PAGE_CACHE_SIZE; ret = lzo1x_decompress_safe(buf, in_len, workspace->buf, &out_len); if (need_unmap)