From patchwork Tue Jun 13 20:56:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timofey Titovets X-Patchwork-Id: 9784653 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 11375602C9 for ; Tue, 13 Jun 2017 20:56:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03AFB283AD for ; Tue, 13 Jun 2017 20:56:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECE5D285B1; Tue, 13 Jun 2017 20:56:29 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 9A7BB283AD for ; Tue, 13 Jun 2017 20:56:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752695AbdFMU4Z (ORCPT ); Tue, 13 Jun 2017 16:56:25 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36442 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751793AbdFMU4Y (ORCPT ); Tue, 13 Jun 2017 16:56:24 -0400 Received: by mail-wr0-f194.google.com with SMTP id 77so3398046wrb.3 for ; Tue, 13 Jun 2017 13:56:23 -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:in-reply-to:references; bh=Szel2Y2EGT0+S9qRHg6Tifg7fQfiNqFltn8gjO7svGU=; b=YIUoPyHVaqJm+ev5M5Hf6MHKwBmpVQ0HZj+8eaticEoVNZ/INrBOR9aisQ6hWGeh/o 2GtnxadWTb5GaUlmHLzBnZ3fqrsrMB2jWOdzRONoudQlWkZRblhaGcYN0UIZvxM/voiJ ODpZVb3oshDDruTYYWOZrnOXVMBDXG4Z67eZ59S7N06Znnv5nItC+4ZpmKTYZxKOkKBv Rdv0hwlU/MeSiHc2Huwb8QRF/YY3701ry3DNyKAUNs1/hzGrMkc6Y78hCih6Wdi+C40M mPybqBA3fpEBeODAh3sp7oRRXXBpBAoJlG0uGsEtAQAEPJmu5N0Q/KcFVCCHVWqHd7W9 75lg== 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:in-reply-to :references; bh=Szel2Y2EGT0+S9qRHg6Tifg7fQfiNqFltn8gjO7svGU=; b=aiuQj9zIyMg193m8vw9kKPecN0HWy/8QXO9ApdUeBm2gRbyht4w+q7WumjrY5SGePL 9w3yQ1MGFkFKkSqfbjadjoUxUy/yAmHbCMExIR9QYFz59Pc2sIx9iN7LkzzyU6Jn6ClB XoKnED5zRBq+4z8Cqnm5pQ7MUF24a5Oc5+dUUxF8CqVY0RWSmLxpbkgwPDxQonOqCjTT yWSQiZJkBLodUg7j2JTpb8sc8f3BqcLNReG6vWgSaZZ1vSquorBxcXDO0u058AKb+oYs xdLtJqOWaP5/E3DmjhpCQWJeub4dm5gdiUx5wwAnNPNDGCEAawuFOz9iZZTqgbTx9hMc jiFA== X-Gm-Message-State: AKS2vOwh+xW8KDY6dKFAlxththjSqQ0djdtHmY27v++4hSbCW3nqhe6I wZka3IsMnjuO1AlT X-Received: by 10.28.232.8 with SMTP id f8mr12532711wmh.51.1497387382534; Tue, 13 Jun 2017 13:56:22 -0700 (PDT) Received: from localhost.localdomain ([91.215.176.151]) by smtp.gmail.com with ESMTPSA id o4sm1922431wrb.27.2017.06.13.13.56.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jun 2017 13:56:22 -0700 (PDT) From: Timofey Titovets To: linux-btrfs@vger.kernel.org Cc: Timofey Titovets Subject: [PATCH v2 2/2] Btrfs: add_all_parents skip compare Date: Tue, 13 Jun 2017 23:56:08 +0300 Message-Id: <20170613205608.28483-3-nefelim4ag@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170613205608.28483-1-nefelim4ag@gmail.com> References: <20170613205608.28483-1-nefelim4ag@gmail.com> 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 Simplify code to make it more readable Signed-off-by: Timofey Titovets --- fs/btrfs/backref.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.13.1 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 0005b8851..2081a8de7 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -588,10 +588,10 @@ static int add_all_parents(struct btrfs_root *root, struct btrfs_path *path, ret = btrfs_next_old_item(root, path, time_seq); } - if (ret > 0) - ret = 0; - else if (ret < 0) + if (ret < 0) free_inode_elem_list(eie); + else + ret = 0; return ret; }