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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux