diff mbox

btrfs: Remove some dead code

Message ID 20161101102606.27006-1-christophe.jaillet@wanadoo.fr (mailing list archive)
State Superseded
Headers show

Commit Message

Christophe JAILLET Nov. 1, 2016, 10:26 a.m. UTC
'btrfs_iget()' can not return an error pointer, so this test can be
removed.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 fs/btrfs/free-space-cache.c | 2 --
 1 file changed, 2 deletions(-)

Comments

David Sterba Nov. 2, 2016, 2:30 p.m. UTC | #1
On Tue, Nov 01, 2016 at 11:26:06AM +0100, Christophe JAILLET wrote:
> 'btrfs_iget()' can not return an error pointer, so this test can be
> removed.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Reviewed-by: David Sterba <dsterba@suse.com>
--
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
Tobias Klauser Nov. 3, 2016, 12:43 p.m. UTC | #2
On 2016-11-01 at 11:26:06 +0100, Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:
> 'btrfs_iget()' can not return an error pointer, so this test can be
> removed.

This descrption does not match what the patch actually does. Shouldn't
it say "...can not return NULL, so this test can be removed."?


> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  fs/btrfs/free-space-cache.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
> index e4b48f377d3a..afd8b0c10acd 100644
> --- a/fs/btrfs/free-space-cache.c
> +++ b/fs/btrfs/free-space-cache.c
> @@ -75,8 +75,6 @@ static struct inode *__lookup_free_space_inode(struct btrfs_root *root,
>  	btrfs_release_path(path);
>  
>  	inode = btrfs_iget(root->fs_info->sb, &location, root, NULL);
> -	if (!inode)
> -		return ERR_PTR(-ENOENT);
>  	if (IS_ERR(inode))
>  		return inode;
>  	if (is_bad_inode(inode)) {
> -- 
> 2.9.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
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
Christophe JAILLET Nov. 3, 2016, 6:24 p.m. UTC | #3
Le 03/11/2016 à 13:43, Tobias Klauser a écrit :
> On 2016-11-01 at 11:26:06 +0100, Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:
>> 'btrfs_iget()' can not return an error pointer, so this test can be
>> removed.
> This descrption does not match what the patch actually does. Shouldn't
> it say "...can not return NULL, so this test can be removed."?
>
You are obviously correct. Cut'n'Paste error while sending other patches.
I will send a V2 with an updated description.

Thanks for the review.

CJ
--
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 mbox

Patch

diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index e4b48f377d3a..afd8b0c10acd 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -75,8 +75,6 @@  static struct inode *__lookup_free_space_inode(struct btrfs_root *root,
 	btrfs_release_path(path);
 
 	inode = btrfs_iget(root->fs_info->sb, &location, root, NULL);
-	if (!inode)
-		return ERR_PTR(-ENOENT);
 	if (IS_ERR(inode))
 		return inode;
 	if (is_bad_inode(inode)) {