linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Whitney <enwlinux@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu
Subject: [PATCH] ext4: clean up ext4_remove_blocks() return
Date: Thu, 13 Jul 2017 11:17:03 -0400	[thread overview]
Message-ID: <20170713151703.GA6383@localhost.localdomain> (raw)

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 <enwlinux@gmail.com>
---
 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 */
-- 
2.1.4

             reply	other threads:[~2017-07-13 15:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 15:17 Eric Whitney [this message]
2017-07-13 22:33 ` [PATCH] ext4: clean up ext4_remove_blocks() return Theodore Ts'o
2017-07-14 21:01   ` Eric Whitney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170713151703.GA6383@localhost.localdomain \
    --to=enwlinux@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).