From patchwork Thu Jul 13 15:17:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Whitney X-Patchwork-Id: 787838 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3x7fV52FGKz9s4q for ; Fri, 14 Jul 2017 01:13:49 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aY99q7wj"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752595AbdGMPNr (ORCPT ); Thu, 13 Jul 2017 11:13:47 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:35374 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752082AbdGMPNq (ORCPT ); Thu, 13 Jul 2017 11:13:46 -0400 Received: by mail-qk0-f195.google.com with SMTP id 16so8455471qkg.2 for ; Thu, 13 Jul 2017 08:13:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=5ULQ4U1DWgnUnviFpiOKBih8vAyMOOt8JiDml2huVwQ=; b=aY99q7wjYdQMksyqj/aBQF66fQB+Fk3Ois33a3H2sz8dYZdVd+Xaa/Z1hRZmMyTm+B wJvh2d+ngfRQ1SOaqZUojb6APU10iSUmNGxSgLLSukbJon29IZoaxCwQStmzhdA4qx92 dZbFfVK77PY/gb2UF5EsnTGsyvhIuwkGNoP8cH8O/C9Q76frsp+CQPz6t6OlBJ15sk+h 855M9PnAsjObiuTXKOxR+GbQVZfSpj25lf0l9gaziD9gjNdERXgWSBHwyzKaL76Qmlyx S/v1npnQFdVOBjsp3IvAol4LRyw6ey0nGhWf564U6nBvCPMjGTKXxaUMYdJWnX0tKoYH /JIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=5ULQ4U1DWgnUnviFpiOKBih8vAyMOOt8JiDml2huVwQ=; b=IMKmxE4lud8avtQTtWNLrH95gvYCIbrgixjUXKJO/rSYuVWVhjf7Bmlz1RQPhCmV1r wYH1lrj1JjtP0w7KAzqU4xYn+5GoeY7FyAA09PSRsUAda7h35R4fpi5PgYSyq5Y0q+3y UnUlyHdmhv6u28/3M/se8PrMxStGVH/cXCA7z6ddc06I8HhiPyJJu/YFw1GekRLLeK+Y RFM2xFa2lI/9Hla3CSsQAfXb5DTeOC+Giru2VghhkB/AuAlrfIdbMOIq8wcpsx11RhOB rPKAGVvq8BMI6MYf8frfuhit2R1/r3mDQURn+2mEOyETXLtKBKXhptWQsa9Vthz3+Vax iaQQ== X-Gm-Message-State: AIVw111AqU8fK5/RzhQtW0qr0AvZIiAIfquQxUUSE/0TfLi2gronLh+8 zjSEkemf+zlM/RIY X-Received: by 10.55.73.131 with SMTP id w125mr5160686qka.264.1499958825160; Thu, 13 Jul 2017 08:13:45 -0700 (PDT) Received: from localhost.localdomain (c-73-60-235-182.hsd1.nh.comcast.net. [73.60.235.182]) by smtp.gmail.com with ESMTPSA id l31sm4737550qtc.64.2017.07.13.08.13.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jul 2017 08:13:44 -0700 (PDT) Date: Thu, 13 Jul 2017 11:17:03 -0400 From: Eric Whitney To: linux-ext4@vger.kernel.org Cc: tytso@mit.edu Subject: [PATCH] ext4: clean up ext4_remove_blocks() return Message-ID: <20170713151703.GA6383@localhost.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org ext4_remove_blocks() never returns anything other than 0, signifying success. Convert the function to void type to make this immediately obvious at the call site. Signed-off-by: Eric Whitney --- fs/ext4/extents.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index e0a8425..27da180 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -2496,10 +2496,10 @@ static inline int get_default_free_blocks_flags(struct inode *inode) return 0; } -static int ext4_remove_blocks(handle_t *handle, struct inode *inode, - struct ext4_extent *ex, - long long *partial_cluster, - ext4_lblk_t from, ext4_lblk_t to) +static void ext4_remove_blocks(handle_t *handle, struct inode *inode, + struct ext4_extent *ex, + long long *partial_cluster, + ext4_lblk_t from, ext4_lblk_t to) { struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); unsigned short ee_len = ext4_ext_get_actual_len(ex); @@ -2592,7 +2592,6 @@ static int ext4_remove_blocks(handle_t *handle, struct inode *inode, ext4_error(sbi->s_sb, "strange request: removal(2) " "%u-%u from %u:%u", from, to, le32_to_cpu(ex->ee_block), ee_len); - return 0; } @@ -2720,10 +2719,7 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode, if (err) goto out; - err = ext4_remove_blocks(handle, inode, ex, partial_cluster, - a, b); - if (err) - goto out; + ext4_remove_blocks(handle, inode, ex, partial_cluster, a, b); if (num == 0) /* this extent is removed; mark slot entirely unused */