From patchwork Mon Sep 11 21:15:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timofey Titovets X-Patchwork-Id: 9948155 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C397F602C9 for ; Mon, 11 Sep 2017 21:15:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC40728D62 for ; Mon, 11 Sep 2017 21:15:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A135528D65; Mon, 11 Sep 2017 21:15:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4199928D62 for ; Mon, 11 Sep 2017 21:15:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751529AbdIKVPb (ORCPT ); Mon, 11 Sep 2017 17:15:31 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:37389 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751379AbdIKVPa (ORCPT ); Mon, 11 Sep 2017 17:15:30 -0400 Received: by mail-wm0-f68.google.com with SMTP id f4so7810005wmh.4 for ; Mon, 11 Sep 2017 14:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=jd1e8RWod5i7MpRNiCacC6Jcn9KgrycFbVAjaBqLQlk=; b=jpLhusFRhwD2aF0bTRmjJCcS+vUk3l4Gh3QzQ9ns9SDWlOboTfr1Cms8aClPW0VGak irhyQXdd+CCGCXAeIVxM0/Oc8Rnt1KeWSxp4/tTNaokgbulFiofpT/LCYx2X2m+pNzBw nwwurOeqnXId3en9Lzt272uQLYXsfAnPmbtwMUkY7vssR0d/to/vGZ7vfz64iHYIdHy3 Zo/dkw38HhCAce9m3Fjyrx0q79Fpf+aL73658Ft7gLCLZHoX+WBZGR9ySSyhub99kUzC O9xZpBbXoFlrqmI8VupUw8io0TCkfimhyGuPUL/SPatXSND+iD+k+16ac7OLDwpWt2ih OTAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jd1e8RWod5i7MpRNiCacC6Jcn9KgrycFbVAjaBqLQlk=; b=sy1OqhP5un/rzgLqAmpX3A+xqUGPJzCNHsqJNIng2rb8xULXtdUWuhIfK/1b3Om57f GMrbfZBmMm+3/LERZS1X9UZnptXQ406kg9hHAmqm9ALSAUJqLOluqgsaX+Ketb4xhAne 2YTYWLMsJFnr9qUll2vH9ydC68mxXhO5051bryJNog4EbhU8h1wP8rdW1QYU/ooMrP91 gD6fhofZbd+w/7V77K96l4s/us+PusTyIm+VKaFIpmgU0njnHmpsdlR/9j1geJRcZTJN ph4XvPL9KLRBnt5KDJjiwBvMLNNKdzKfGX8KnqlmttB95j6lSxNiNpvc8Obp8jYbsIpn TgqA== X-Gm-Message-State: AHPjjUh5IoM9B5FPXBjL+M1PJf7FK/qhRHrx1HnfWtrzcDZEw2vqHNOg zxPUYBRmoW2ezPsxo2eFxmR9sw== X-Google-Smtp-Source: AOwi7QCG5CEQ+uuXqx8UNpd+9PYrMceBDxnh7df+xffCDC4Q7CsL5jb0/D4iC5AVwD4VHNNtBHLXqA== X-Received: by 10.28.130.130 with SMTP id e124mr8281387wmd.75.1505164529485; Mon, 11 Sep 2017 14:15:29 -0700 (PDT) Received: from titovetst-l.itransition.corp (nat3-minsk-pool-46-53-180-190.telecom.by. [46.53.180.190]) by smtp.gmail.com with ESMTPSA id 55sm12400144wrw.60.2017.09.11.14.15.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Sep 2017 14:15:29 -0700 (PDT) From: Timofey Titovets To: linux-btrfs@vger.kernel.org Cc: Timofey Titovets Subject: [PATCH] Btrfs: compress_file_range() remove dead variable num_bytes Date: Tue, 12 Sep 2017 00:15:17 +0300 Message-Id: <20170911211517.22441-1-nefelim4ag@gmail.com> X-Mailer: git-send-email 2.14.1 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove dead assigment of num_bytes Also as num_bytes only used in will_compress block as copy of total_in just replace that with total_in and drop num_bytes entire Signed-off-by: Timofey Titovets Reviewed-by: Nikolay Borisov --- fs/btrfs/inode.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 17ad018da0a2..1ff4fa461555 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -446,7 +446,6 @@ static noinline void compress_file_range(struct inode *inode, { struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); struct btrfs_root *root = BTRFS_I(inode)->root; - u64 num_bytes; u64 blocksize = fs_info->sectorsize; u64 actual_end; u64 isize = i_size_read(inode); @@ -496,8 +495,6 @@ static noinline void compress_file_range(struct inode *inode, total_compressed = min_t(unsigned long, total_compressed, BTRFS_MAX_UNCOMPRESSED); - num_bytes = ALIGN(end - start + 1, blocksize); - num_bytes = max(blocksize, num_bytes); total_in = 0; ret = 0; @@ -613,7 +610,6 @@ static noinline void compress_file_range(struct inode *inode, */ total_in = ALIGN(total_in, PAGE_SIZE); if (total_compressed + blocksize <= total_in) { - num_bytes = total_in; *num_added += 1; /* @@ -621,12 +617,12 @@ static noinline void compress_file_range(struct inode *inode, * allocation on disk for these compressed pages, and * will submit them to the elevator. */ - add_async_extent(async_cow, start, num_bytes, + add_async_extent(async_cow, start, total_in, total_compressed, pages, nr_pages, compress_type); - if (start + num_bytes < end) { - start += num_bytes; + if (start + total_in < end) { + start += total_in; pages = NULL; cond_resched(); goto again;