lkml.org 
[lkml]   [2006]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] sysfs representation of stacked devices (common) (rev.2)
Hi Greg,

Thanks for comments.

Greg KH wrote:
>>+/* This is a mere directory in sysfs. No methods are needed. */
>>+static struct kobj_type bd_holder_ktype = {
>>+ .release = NULL,
>>+ .sysfs_ops = NULL,
>>+ .default_attrs = NULL,
>>+};
>
> That doesn't look right. You always need a release function.

I'll move them out to gendisk/hd_struct creation with proper
release function.

I thought it's correct because NULL release function is
just ignored in kobject_cleanup() and it let outside function
to release the whole structure.
But it seems wrong to embed these additional kobjects in
the structures which are logically separate from them.

>>+static inline void del_holder_dir(struct block_device *bdev)
>>+{
>>+ /*
>>+ * Don't kobject_unregister to avoid memory allocation
>>+ * in kobject_hotplug.
>>+ */
>>+ kobject_del(&bdev->bd_holder_dir);
>>+ kobject_put(&bdev->bd_holder_dir);
>>+}
>
> No, do it correctly please.

OK, I'll change them to kobject_unregister() and do it
when gendisk/hd_struct is removed.
Then we can avoid possible memory allocation in dm's atomic
operation, too.

--
Jun'ichi Nomura, NEC Solutions (America), Inc.
-
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: 2006-02-22 23:23    [W:0.057 / U:0.876 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site