From: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
To: Mike Snitzer <snitzer@redhat.com>
Cc: dm-devel@redhat.com, Alasdair Kergon <agk@redhat.com>
Subject: Re: [PATCH v3 1/2] dm: prevent table type changes after initial table load
Date: Thu, 27 May 2010 12:11:38 +0900 [thread overview]
Message-ID: <4BFDE2EA.80009@ct.jp.nec.com> (raw)
In-Reply-To: <1274798593-19418-2-git-send-email-snitzer@redhat.com>
Hi Mike,
Some small comments below.
For others,
Acked-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
On 05/25/2010 11:43 PM +0900, Mike Snitzer wrote:
> @@ -1176,6 +1176,21 @@ static int table_load(struct dm_ioctl *p
> goto out;
> }
>
> + /* Protect md->type against concurrent table loads. */
> + dm_lock_md_type(md);
> + if (dm_get_md_type(md) == DM_TYPE_NONE) {
> + /* initial table load, set md's type based on table's type */
> + dm_set_md_type(md, t);
dm_set_md_type(md, dm_table_get_type(t));
Although I don't impose this interface, I feel it is straightforward
for this function. Then, dm_set_md_type() just set the type in md->type;
void dm_set_md_type(struct mapped_device *md, unsigned type)
{
md->type = type;
}
If you take the current interface, I feel it's not normal coding style;
> +void dm_set_md_type(struct mapped_device *md, struct dm_table* t)
Should be "dm_table *t" instead of "dm_table* t".
> @@ -66,6 +66,11 @@ int dm_table_alloc_md_mempools(struct dm
> void dm_table_free_md_mempools(struct dm_table *t);
> struct dm_md_mempools *dm_table_get_md_mempools(struct dm_table *t);
>
> +void dm_lock_md_type(struct mapped_device *md);
> +void dm_unlock_md_type(struct mapped_device *md);
> +void dm_set_md_type(struct mapped_device *md, struct dm_table* t);
The same coding style here.
Thanks,
Kiyoshi Ueda
next prev parent reply other threads:[~2010-05-27 3:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-25 14:43 [PATCH v3 0/2] dm: restrict conflicting table loads and improve queue initialization Mike Snitzer
2010-05-25 14:43 ` [PATCH v3 1/2] dm: prevent table type changes after initial table load Mike Snitzer
2010-05-27 3:11 ` Kiyoshi Ueda [this message]
2010-05-27 3:41 ` Mike Snitzer
2010-05-25 14:43 ` [PATCH v3 2/2 "v10"] dm: only initialize full request_queue for request-based device Mike Snitzer
2010-05-27 3:12 ` Kiyoshi Ueda
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=4BFDE2EA.80009@ct.jp.nec.com \
--to=k-ueda@ct.jp.nec.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=snitzer@redhat.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 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.