Re: [PATCH 2/3] Sysfs: Allow directories to be populated dynamically

From: Tejun Heo
Date: Thu Oct 29 2009 - 12:18:58 EST


Hello,

> diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
> index af4c4e7..13843fa 100644
> --- a/fs/sysfs/sysfs.h
> +++ b/fs/sysfs/sysfs.h
> @@ -17,6 +17,9 @@ struct sysfs_elem_dir {
> struct kobject *kobj;
> /* children list starts here and goes through sd->s_sibling */
> struct sysfs_dirent *children;
> + int (*populate)(struct dentry *, struct sysfs_dirent *);
> + void (*depopulate)(struct dentry *, struct sysfs_dirent *);
> + void *data;

This will increase the size of struct sysfs_dirent by three pointers
which is considerable. Bloating the size of sysfs_dirent can waste
large amount of memory on machines with a lot of disks.

The implementation looks quite scary to me. Is this the only way to
do this? It it because trying to create individual entries for msix
will end up creating too many sysfs entries? If so, how many are we
talking about?

Thanks.

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