lkml.org 
[lkml]   [2010]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] [MTD] Call bdi_init() and bdi_register()
On Mon, Apr 26 2010, Jörn Engel wrote:
> Otherwise we hit a BUG_ON in bdi_queue_work().
>
> Signed-off-by: Joern Engel <joern@logfs.org>
> ---
> drivers/mtd/mtdcore.c | 17 ++++++++++++++++-
> 1 files changed, 16 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> index cb4858b..8dd3e46 100644
> --- a/drivers/mtd/mtdcore.c
> +++ b/drivers/mtd/mtdcore.c
> @@ -322,6 +322,12 @@ int add_mtd_device(struct mtd_info *mtd)
> if (!mtd_table[i]) {
> struct mtd_notifier *not;
>
> + err = bdi_register(mtd->backing_dev_info, NULL, "mtd%d",
> + i);
> + if (err) {
> + /* We lose the errno information :( */
> + break;
> + }

This is not a good idea, even if it'll currently work.

> @@ -692,6 +698,15 @@ static int __init init_mtd(void)
> int ret;
> ret = class_register(&mtd_class);
>
> + ret = bdi_init(&mtd_bdi_unmappable);
> + if (ret)
> + return ret;
> + ret = bdi_init(&mtd_bdi_ro_mappable);
> + if (ret)
> + return ret;
> + ret = bdi_init(&mtd_bdi_rw_mappable);
> + if (ret)
> + return ret;

Do the bdi_register() here as well.

--
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-04-26 19:05    [W:0.143 / U:1.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site