Re: [PATCH] btrfs/volumes: Improve unlocking of a mutex in __btrfs_balance()

2017-11-06 Thread SF Markus Elfring
>> @@ -3682,7 +3678,7 @@ static int __btrfs_balance(struct btrfs_fs_info >> *fs_info) >> counting = false; >> goto again; >> } >> -error: >> +free_path: >> btrfs_free_path(path); >> if (enospc_errors) { >> btrfs_info(fs_info, "%d enospc errors

[PATCH] btrfs/volumes: Improve unlocking of a mutex in __btrfs_balance()

2017-11-06 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 5 Nov 2017 22:03:22 +0100 * Adjust jump targets so that a call of the function "mutex_unlock" can be better reused for error cases at the end of this function. * Replace three calls by goto statements. This issue was detected by using the Coccinelle software.

[PATCH v2] btrfs: Use common error handling code in update_ref_path()

2017-08-21 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 21 Aug 2017 15:45:23 +0200 Add a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- v2: Do you find this refactoring accep

Re: btrfs: Delete an unnecessary variable initialisation in tree_mod_log_eb_copy()

2017-08-21 Thread SF Markus Elfring
> Don't needed, and you did miss several similar places (L573 & L895) in > that file with explicit initialisation. Would you like to adjust any remaining places in such source files? Regards, Markus -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message

Re: btrfs: Adjust 32 checks for null pointers

2017-08-21 Thread SF Markus Elfring
> That's will work, Thanks for your acknowledgement. > but that's don't improve anything. Do you like a small source code reduction here? Regards, Markus -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordo

[PATCH 5/5] btrfs: Use common error handling code in btrfs_mark_extent_written()

2017-08-21 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 21 Aug 2017 14:15:23 +0200 Add jump targets so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- fs/btrfs/file.c | 62 ++

[PATCH 4/5] btrfs: Use common error handling code in update_ref_path()

2017-08-21 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 21 Aug 2017 13:34:29 +0200 Add a jump target so that a bit of exception handling can be better reused in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- fs/btrfs/send.c | 8 1 file changed, 4 i

[PATCH 3/5] btrfs: Use common error handling code in btrfs_update_root()

2017-08-21 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 21 Aug 2017 13:10:15 +0200 Add a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- fs/btrfs/root-tree.c | 27 +++-

[PATCH 2/5] btrfs: Use common error handling code in __btrfs_free_extent()

2017-08-21 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 21 Aug 2017 10:03:00 +0200 Add a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- fs/btrfs/extent-tree.c | 69 ++

[PATCH 1/5] btrfs: Use common error handling code in tree_mod_log_eb_copy()

2017-08-21 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 21 Aug 2017 09:36:48 +0200 Add a jump target so that a bit of exception handling can be better reused in this function. Signed-off-by: Markus Elfring --- fs/btrfs/ctree.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/fs/btrfs

[PATCH 0/5] BTRFS: Fine-tuning for five function implementations

2017-08-21 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 21 Aug 2017 14:30:12 +0200 A few update suggestions were taken into account from static source code analysis. Markus Elfring (5): Use common error handling code in tree_mod_log_eb_copy() Use common error handling code in __btrfs_free_extent() Use common erro

[PATCH 4/4] btrfs: Delete an unnecessary variable initialisation in tree_mod_log_eb_copy()

2017-08-20 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 20 Aug 2017 22:02:54 +0200 The variable "tm_list" will eventually be set to an appropriate pointer a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring --- fs/btrfs/ctree.c | 2 +- 1 file changed, 1 insertion(+), 1 d

[PATCH 3/4] btrfs: Improve eight size determinations

2017-08-20 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 20 Aug 2017 21:55:56 +0200 Replace the specification of data types by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. This issue was detected b

[PATCH 2/4] btrfs: Adjust 32 checks for null pointers

2017-08-20 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 20 Aug 2017 21:36:31 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script “checkpatch.pl” pointed information out like the following. Comparison to NULL could be written … Thus fix the affected source code pla

[PATCH 1/4] btrfs: Delete an error message for a failed memory allocation in btrfsic_process_superblock()

2017-08-20 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 20 Aug 2017 21:10:17 +0200 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- fs/btrfs/check-integrity.c | 4 +--- 1 file changed, 1 insertion(+), 3

[PATCH 0/4] BTRFS: Adjustments for several function implementations

2017-08-20 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 20 Aug 2017 22:11:33 +0200 Some update suggestions were taken into account from static source code analysis. Markus Elfring (4): Delete an error message for a failed memory allocation in btrfsic_process_superblock() Adjust 32 checks for null pointers Improv

Re: [PATCH 00/39] drop null test before destroy functions

2015-09-14 Thread SF Markus Elfring
> Recent commits to kernel/git/torvalds/linux.git have made the following > functions able to tolerate NULL arguments: > > kmem_cache_destroy (commit 3942d29918522) > mempool_destroy (commit 4e3ca3e033d1) > dma_pool_destroy (commit 44d7175da6ea) How do you think about to extend an other SmPL scrip

Re: [PATCH] fs: btrfs: free-space-cache.c: remove two unnecessary checks before calling kfree()

2015-02-11 Thread SF Markus Elfring
>> https://lkml.org/lkml/2014/10/31/606 >> http://article.gmane.org/gmane.linux.kernel/1818924 >> https://systeme.lip6.fr/pipermail/cocci/2014-October/001321.html > > Oh, I see you already made the exact same change. Would you like to add any tags to my update suggestion? Regards, Markus -- To u

Re: [PATCH] fs: btrfs: free-space-cache.c: remove two unnecessary checks before calling kfree()

2015-02-11 Thread SF Markus Elfring
> kfree checks whether the pointer it is passed is NULL. The two foregoing > checks are therefore unnecessary. > > This issue was detected using Coccinelle. Would you like to integrate my update suggestion "btrfs: Deletion of unnecessary checks before six function calls"? https://lkml.org/lkml/20

[PATCH 1/1] btrfs: Deletion of unnecessary checks before six function calls

2014-10-31 Thread SF Markus Elfring
The following functions test whether their argument is NULL and then return immediately. * btrfs_free_path() * free_extent_buffer() * free_extent_map() * free_extent_state() * iput() * kfree() Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.