From patchwork Tue Apr 10 03:31:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gu Jinxiang X-Patchwork-Id: 10332273 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 EC9F46037F for ; Tue, 10 Apr 2018 03:34:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDFFB28A8E for ; Tue, 10 Apr 2018 03:34:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0C2E28C52; Tue, 10 Apr 2018 03:34:59 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 585B128A8E for ; Tue, 10 Apr 2018 03:34:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751844AbeDJDe4 (ORCPT ); Mon, 9 Apr 2018 23:34:56 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:45896 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751652AbeDJDe4 (ORCPT ); Mon, 9 Apr 2018 23:34:56 -0400 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="38731170" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 10 Apr 2018 11:34:54 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id A51A94D0EFD1 for ; Tue, 10 Apr 2018 11:34:49 +0800 (CST) Received: from ubuntu.g08.fujitsu.local (10.167.226.132) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 10 Apr 2018 11:34:48 +0800 From: Gu Jinxiang To: Subject: [PATCH] btrfs-progs: remove meaningless field write of scrub status file Date: Tue, 10 Apr 2018 11:31:43 +0800 Message-ID: <1523331103-20857-1-git-send-email-gujx@cn.fujitsu.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.167.226.132] X-yoursite-MailScanner-ID: A51A94D0EFD1.A8D24 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: gujx@cn.fujitsu.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 Since ret must be 0 when goes to scrub status file's write, so scrub_write_buf(fd, buf, ret) writes nothing. And when I check the process for read scrub status file, there is no process for this field. So, remove it. Signed-off-by: Gu Jinxiang --- cmds-scrub.c | 1 - 1 file changed, 1 deletion(-) diff --git a/cmds-scrub.c b/cmds-scrub.c index 8cf1e5df..efd7db94 100644 --- a/cmds-scrub.c +++ b/cmds-scrub.c @@ -753,7 +753,6 @@ static int scrub_write_file(int fd, const char *fsid, scrub_write_buf(fd, ":", 1) || scrub_writev(fd, buf, sizeof(buf), "%lld", use->scrub_args.devid) || - scrub_write_buf(fd, buf, ret) || _SCRUB_KVWRITE(fd, buf, data_extents_scrubbed, use) || _SCRUB_KVWRITE(fd, buf, tree_extents_scrubbed, use) || _SCRUB_KVWRITE(fd, buf, data_bytes_scrubbed, use) ||