Re: [lvm-devel] [PATCH] add kobject to struct mapped_device

Joe Thornber
2002-12-19T10:47:36Z

Greg,

This looks like patch 1 of many, since it doesn't actually export any
attributes through sysfs yet. Can you please give me more of an idea
of what the attributes are that you want to export ? Are you trying
to move the dmfs functionality into sysfs ?

I won't accept this patch on it's own, but am sure what you are trying
to do is the right thing, so will probably have no objections when the
rest of the patches arrive.

On Wed, Dec 18, 2002 at 10:43:07AM -0800, Greg KH wrote:
> Oh, and why isn't struct mapped_device declared in dm.h? If it was,
> dm_get and dm_put could be inlined, along with a few other potential
> cleanups.

I'm try to keep implementation details out of header files. dm_get()
and dm_put() are not performance critical so I see no need to inline them.

> diff -Nru a/drivers/block/genhd.c b/drivers/block/genhd.c
> --- a/drivers/block/genhd.c Wed Dec 18 10:39:48 2002
> +++ b/drivers/block/genhd.c Wed Dec 18 10:39:48 2002
> @@ -475,3 +475,4 @@
> EXPORT_SYMBOL(bdev_read_only);
> EXPORT_SYMBOL(set_device_ro);
> EXPORT_SYMBOL(set_disk_ro);
> +EXPORT_SYMBOL(block_subsys);

> diff -Nru a/drivers/md/dm.c b/drivers/md/dm.c
> --- a/drivers/md/dm.c Wed Dec 18 10:39:48 2002
> +++ b/drivers/md/dm.c Wed Dec 18 10:39:48 2002

...

> +
> +extern struct subsystem block_subsys;
> +

Please declare this in a suitable header like genhd.h rather than in
dm.c. The above two snippets should then be pushed seperately from
the dm patches.

- Joe