All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Brian Norris <briannorris@chromium.org>
Cc: dm-devel@redhat.com, linux-kernel@vger.kernel.org,
	Alasdair Kergon <agk@redhat.com>
Subject: Re: dm: move dm_table_destroy() to same header as dm_table_create()
Date: Tue, 28 Mar 2017 15:31:51 -0400	[thread overview]
Message-ID: <20170328193150.GA21445@redhat.com> (raw)
In-Reply-To: <20170328183102.80620-1-briannorris@chromium.org>

On Tue, Mar 28 2017 at  2:31pm -0400,
Brian Norris <briannorris@chromium.org> wrote:

> If anyone is going to use dm_table_create(), they probably should be
> able to use dm_table_destroy() too. Move the dm_table_destroy()
> definition outside the private header, near dm_table_create()
> 
> Signed-off-by: Brian Norris <briannorris@chromium.org>

Not seeing why we need dm_table_create() exposed.  So I think you went
the wrong way with this.  Unless you have an actual need, I'd prefer to
see dm_table_create() moved from include/linux/device-mapper.h to
drivers/md/dm.h

Mike


> ---
>  drivers/md/dm.h               | 1 -
>  include/linux/device-mapper.h | 5 +++++
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/md/dm.h b/drivers/md/dm.h
> index f298b01f7ab3..c54d2f1934ce 100644
> --- a/drivers/md/dm.h
> +++ b/drivers/md/dm.h
> @@ -48,7 +48,6 @@ struct dm_md_mempools;
>  /*-----------------------------------------------------------------
>   * Internal table functions.
>   *---------------------------------------------------------------*/
> -void dm_table_destroy(struct dm_table *t);
>  void dm_table_event_callback(struct dm_table *t,
>  			     void (*fn)(void *), void *context);
>  struct dm_target *dm_table_get_target(struct dm_table *t, unsigned int index);
> diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
> index a7e6903866fd..70cb6af56f67 100644
> --- a/include/linux/device-mapper.h
> +++ b/include/linux/device-mapper.h
> @@ -472,6 +472,11 @@ void dm_table_set_type(struct dm_table *t, unsigned type);
>  int dm_table_complete(struct dm_table *t);
>  
>  /*
> + * Destroy the table when finished.
> + */
> +void dm_table_destroy(struct dm_table *t);
> +
> +/*
>   * Target may require that it is never sent I/O larger than len.
>   */
>  int __must_check dm_set_target_max_io_len(struct dm_target *ti, sector_t len);
> -- 
> 2.12.2.564.g063fe858b8-goog
> 

WARNING: multiple messages have this Message-ID (diff)
From: Mike Snitzer <snitzer@redhat.com>
To: Brian Norris <briannorris@chromium.org>
Cc: Alasdair Kergon <agk@redhat.com>,
	dm-devel@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: dm: move dm_table_destroy() to same header as dm_table_create()
Date: Tue, 28 Mar 2017 15:31:51 -0400	[thread overview]
Message-ID: <20170328193150.GA21445@redhat.com> (raw)
In-Reply-To: <20170328183102.80620-1-briannorris@chromium.org>

On Tue, Mar 28 2017 at  2:31pm -0400,
Brian Norris <briannorris@chromium.org> wrote:

> If anyone is going to use dm_table_create(), they probably should be
> able to use dm_table_destroy() too. Move the dm_table_destroy()
> definition outside the private header, near dm_table_create()
> 
> Signed-off-by: Brian Norris <briannorris@chromium.org>

Not seeing why we need dm_table_create() exposed.  So I think you went
the wrong way with this.  Unless you have an actual need, I'd prefer to
see dm_table_create() moved from include/linux/device-mapper.h to
drivers/md/dm.h

Mike


> ---
>  drivers/md/dm.h               | 1 -
>  include/linux/device-mapper.h | 5 +++++
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/md/dm.h b/drivers/md/dm.h
> index f298b01f7ab3..c54d2f1934ce 100644
> --- a/drivers/md/dm.h
> +++ b/drivers/md/dm.h
> @@ -48,7 +48,6 @@ struct dm_md_mempools;
>  /*-----------------------------------------------------------------
>   * Internal table functions.
>   *---------------------------------------------------------------*/
> -void dm_table_destroy(struct dm_table *t);
>  void dm_table_event_callback(struct dm_table *t,
>  			     void (*fn)(void *), void *context);
>  struct dm_target *dm_table_get_target(struct dm_table *t, unsigned int index);
> diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
> index a7e6903866fd..70cb6af56f67 100644
> --- a/include/linux/device-mapper.h
> +++ b/include/linux/device-mapper.h
> @@ -472,6 +472,11 @@ void dm_table_set_type(struct dm_table *t, unsigned type);
>  int dm_table_complete(struct dm_table *t);
>  
>  /*
> + * Destroy the table when finished.
> + */
> +void dm_table_destroy(struct dm_table *t);
> +
> +/*
>   * Target may require that it is never sent I/O larger than len.
>   */
>  int __must_check dm_set_target_max_io_len(struct dm_target *ti, sector_t len);
> -- 
> 2.12.2.564.g063fe858b8-goog
> 

  reply	other threads:[~2017-03-28 19:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-28 18:31 [PATCH] dm: move dm_table_destroy() to same header as dm_table_create() Brian Norris
2017-03-28 18:31 ` Brian Norris
2017-03-28 19:31 ` Mike Snitzer [this message]
2017-03-28 19:31   ` Mike Snitzer
2017-04-04 22:35   ` Brian Norris
2017-04-05  8:04     ` Enric Balletbo i Serra

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=20170328193150.GA21445@redhat.com \
    --to=snitzer@redhat.com \
    --cc=agk@redhat.com \
    --cc=briannorris@chromium.org \
    --cc=dm-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.