• Tejun Heo's avatar
    sysfs: prepare path write for unified regular / bin file handling · f9b9a621
    Tejun Heo authored
    sysfs bin file handling will be merged into the regular file support.
    This patch prepares the write path.
    
    bin file write is almost identical to regular file write except that
    the write length is capped by the inode size and @off is passed to the
    write method.  This patch adds bin file handling to sysfs_write_file()
    so that it can handle both regular and bin files.
    
    A new file_operations struct sysfs_bin_operations is added, which
    currently only hosts sysfs_write_file() and generic_file_llseek().
    This isn't used yet but will eventually replace fs/sysfs/bin.c.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    f9b9a621
sysfs.h 6.33 KB