linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: Liu Bo <bo.li.liu@oracle.com>,
	linux-btrfs@vger.kernel.org, linux_lkml_grp@oracle.com
Subject: Re: [PATCH] Btrfs: free btrfs_device in place
Date: Wed, 11 Oct 2017 14:56:34 +0800	[thread overview]
Message-ID: <a0b1173b-40ca-f051-ce66-3856c5985cee@oracle.com> (raw)
In-Reply-To: <20171010215103.20828-2-bo.li.liu@oracle.com>



On 10/11/2017 05:51 AM, Liu Bo wrote:
> It's pointless to defer it to a kthread helper as we're not under any
> special context.

  Reviewed-by: Anand Jain <anand.jain@oracle.com>

Thanks, Anand

> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> ---
>   fs/btrfs/volumes.c | 14 ++------------
>   1 file changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index d983cea..4a72c45 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -836,26 +836,16 @@ void btrfs_close_extra_devices(struct btrfs_fs_devices *fs_devices, int step)
>   	mutex_unlock(&uuid_mutex);
>   }
>   
> -static void __free_device(struct work_struct *work)
> +static void free_device(struct rcu_head *head)
>   {
>   	struct btrfs_device *device;
>   
> -	device = container_of(work, struct btrfs_device, rcu_work);
> +	device = container_of(head, struct btrfs_device, rcu);
>   	rcu_string_free(device->name);
>   	bio_put(device->flush_bio);
>   	kfree(device);
>   }
>   
> -static void free_device(struct rcu_head *head)
> -{
> -	struct btrfs_device *device;
> -
> -	device = container_of(head, struct btrfs_device, rcu);
> -
> -	INIT_WORK(&device->rcu_work, __free_device);
> -	schedule_work(&device->rcu_work);
> -}
> -
>   static void btrfs_close_bdev(struct btrfs_device *device)
>   {
>   	if (device->bdev && device->writeable) {
> 

  reply	other threads:[~2017-10-11  6:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10 21:51 [PATCH] Btrfs: free btrfs_device in place Liu Bo
2017-10-11  6:56 ` Anand Jain [this message]
2017-10-11 17:54 ` David Sterba
2017-10-11 17:21   ` Liu Bo
2017-10-11 18:13 ` [PATCH v2] " Liu Bo
2017-10-20 17:52   ` David Sterba
2017-10-24  5:02 ` [PATCH v3] " Liu Bo
2017-10-25 13:13   ` David Sterba

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=a0b1173b-40ca-f051-ce66-3856c5985cee@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=bo.li.liu@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux_lkml_grp@oracle.com \
    /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).