• T
    sysfs, kernfs: add sysfs_dirent->s_attr.size · 471bd7b7
    Tejun Heo 提交于
    sysfs sets the size of regular files unconditionally at PAGE_SIZE and
    takes the size of bin files from bin_attribute.  The latter is a
    pretty bad interface which forces bin_attribute users to create a
    separate copy of bin_attribute for each instance of the file -
    e.g. pci resource files.
    
    Add sysfs_dirent->s_attr.size so that the size can be specified
    separately.  This unifies inode init paths of ATTR and BIN_ATTR
    identical and allows for generic size handling for kernfs.
    
    Unfortunately, this grows the size of sysfs_dirent by sizeof(loff_t).
    Signed-off-by: NTejun Heo <tj@kernel.org>
    Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    471bd7b7
inode.c 8.0 KB