• Tejun Heo's avatar
    sysfs, kernfs: add sysfs_dirent->s_attr.size · 471bd7b7
    Tejun Heo authored
    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: default avatarTejun Heo <tj@kernel.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    471bd7b7
file.c 29.8 KB