[PATCH 2/3] btrfs: qgroups, remove unnecessary memset before btrfs_init_work

2018-05-02 Thread jeffm
From: Jeff Mahoney 

btrfs_init_work clears the work struct except for ->wq, so the memset
before calling btrfs_init_work in qgroup_rescan_init is unnecessary.

We'll also initialize ->wq in btrfs_init_work so that it's obvious.

Signed-off-by: Jeff Mahoney 
---
 fs/btrfs/async-thread.c | 1 +
 fs/btrfs/qgroup.c   | 3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
index d5540749f0e5..c614fb7b9b9d 100644
--- a/fs/btrfs/async-thread.c
+++ b/fs/btrfs/async-thread.c
@@ -354,6 +354,7 @@ void btrfs_init_work(struct btrfs_work *work, 
btrfs_work_func_t uniq_func,
INIT_WORK(>normal_work, uniq_func);
INIT_LIST_HEAD(>ordered_list);
work->flags = 0;
+   work->wq = NULL;
 }
 
 static inline void __btrfs_queue_work(struct __btrfs_workqueue *wq,
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 466744741873..3d47700c6a30 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -2102,9 +2102,6 @@ static void queue_rescan_worker(struct btrfs_fs_info 
*fs_info)
init_completion(_info->qgroup_rescan_completion);
mutex_unlock(_info->qgroup_rescan_lock);
 
-   memset(_info->qgroup_rescan_work, 0,
-  sizeof(fs_info->qgroup_rescan_work));
-
btrfs_init_work(_info->qgroup_rescan_work,
btrfs_qgroup_rescan_helper,
btrfs_qgroup_rescan_worker, NULL, NULL);
-- 
2.12.3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] btrfs: qgroups, remove unnecessary memset before btrfs_init_work

2018-04-26 Thread Nikolay Borisov


On 26.04.2018 22:23, je...@suse.com wrote:
> From: Jeff Mahoney 
> 
> btrfs_init_work clears the work struct except for ->wq, so the memset
> before calling btrfs_init_work in qgroup_rescan_init is unnecessary.
> 
> We'll also initialize ->wq in btrfs_init_work so that it's obvious.
> 
> Signed-off-by: Jeff Mahoney 

Reviewed-by: Nikolay Borisov 

> ---
>  fs/btrfs/async-thread.c | 1 +
>  fs/btrfs/qgroup.c   | 2 --
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
> index d5540749f0e5..c614fb7b9b9d 100644
> --- a/fs/btrfs/async-thread.c
> +++ b/fs/btrfs/async-thread.c
> @@ -354,6 +354,7 @@ void btrfs_init_work(struct btrfs_work *work, 
> btrfs_work_func_t uniq_func,
>   INIT_WORK(>normal_work, uniq_func);
>   INIT_LIST_HEAD(>ordered_list);
>   work->flags = 0;
> + work->wq = NULL;
>  }
>  
>  static inline void __btrfs_queue_work(struct __btrfs_workqueue *wq,
> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
> index be491b6c020a..8de423a0c7e3 100644
> --- a/fs/btrfs/qgroup.c
> +++ b/fs/btrfs/qgroup.c
> @@ -2740,8 +2740,6 @@ qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 
> progress_objectid,
>   spin_unlock(_info->qgroup_lock);
>   mutex_unlock(_info->qgroup_rescan_lock);
>  
> - memset(_info->qgroup_rescan_work, 0,
> -sizeof(fs_info->qgroup_rescan_work));
>   btrfs_init_work(_info->qgroup_rescan_work,
>   btrfs_qgroup_rescan_helper,
>   btrfs_qgroup_rescan_worker, NULL, NULL);
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] btrfs: qgroups, remove unnecessary memset before btrfs_init_work

2018-04-26 Thread jeffm
From: Jeff Mahoney 

btrfs_init_work clears the work struct except for ->wq, so the memset
before calling btrfs_init_work in qgroup_rescan_init is unnecessary.

We'll also initialize ->wq in btrfs_init_work so that it's obvious.

Signed-off-by: Jeff Mahoney 
---
 fs/btrfs/async-thread.c | 1 +
 fs/btrfs/qgroup.c   | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
index d5540749f0e5..c614fb7b9b9d 100644
--- a/fs/btrfs/async-thread.c
+++ b/fs/btrfs/async-thread.c
@@ -354,6 +354,7 @@ void btrfs_init_work(struct btrfs_work *work, 
btrfs_work_func_t uniq_func,
INIT_WORK(>normal_work, uniq_func);
INIT_LIST_HEAD(>ordered_list);
work->flags = 0;
+   work->wq = NULL;
 }
 
 static inline void __btrfs_queue_work(struct __btrfs_workqueue *wq,
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index be491b6c020a..8de423a0c7e3 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -2740,8 +2740,6 @@ qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 
progress_objectid,
spin_unlock(_info->qgroup_lock);
mutex_unlock(_info->qgroup_rescan_lock);
 
-   memset(_info->qgroup_rescan_work, 0,
-  sizeof(fs_info->qgroup_rescan_work));
btrfs_init_work(_info->qgroup_rescan_work,
btrfs_qgroup_rescan_helper,
btrfs_qgroup_rescan_worker, NULL, NULL);
-- 
2.12.3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html