From patchwork Fri Apr 18 23:14:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rakesh Pandit X-Patchwork-Id: 4018931 X-Patchwork-Delegate: dave@jikos.cz Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5776DBFF02 for ; Fri, 18 Apr 2014 23:14:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 81BB52026F for ; Fri, 18 Apr 2014 23:14:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3BAD2026C for ; Fri, 18 Apr 2014 23:14:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754234AbaDRXOS (ORCPT ); Fri, 18 Apr 2014 19:14:18 -0400 Received: from nbl-ex10-fe02.nebula.fi ([188.117.32.122]:50728 "EHLO ex10.nebula.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752254AbaDRXOQ (ORCPT ); Fri, 18 Apr 2014 19:14:16 -0400 Received: from hercules.tuxera.com (88.195.159.123) by ex10.nebula.fi (188.117.32.115) with Microsoft SMTP Server (TLS) id 14.3.174.1; Sat, 19 Apr 2014 02:14:15 +0300 Date: Sat, 19 Apr 2014 02:14:14 +0300 From: Rakesh Pandit To: Subject: [PATCH 2/2] Btrfs-progs: receive: remove return type of close_inode_for_write Message-ID: <20140418231413.GA1885@hercules.tuxera.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [88.195.159.123] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP "close_inode_for_write" always returns 0, so just remove its return value and remove dead checking in caller. Signed-off-by: Rakesh Pandit --- cmds-receive.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/cmds-receive.c b/cmds-receive.c index 7a23823..39309f2 100644 --- a/cmds-receive.c +++ b/cmds-receive.c @@ -612,19 +612,14 @@ out: return ret; } -static int close_inode_for_write(struct btrfs_receive *r) +static void close_inode_for_write(struct btrfs_receive *r) { - int ret = 0; - if(r->write_fd == -1) - goto out; + return; close(r->write_fd); r->write_fd = -1; r->write_path[0] = 0; - -out: - return ret; } static int process_write(const char *path, const void *data, u64 offset, @@ -1017,9 +1012,7 @@ static int do_receive(struct btrfs_receive *r, const char *tomnt, int r_fd) if (ret) end = 1; - ret = close_inode_for_write(r); - if (ret < 0) - goto out; + close_inode_for_write(r); ret = finish_subvol(r); if (ret < 0) goto out;