• Hans van Kranenburg's avatar
    btrfs: prefix sysfs attribute struct names · a969f4cc
    Hans van Kranenburg authored
    Currently struct names for sysfs are generated only based on the
    attribute names. This means that attribute names cannot be reused in
    multiple places throughout the complete btrfs sysfs hierarchy.
    
    E.g. allocation/data/total_bytes and allocation/data/single/total_bytes
    result in the same struct name btrfs_attr_total_bytes. A workaround for
    this case was made in the past by ad hoc creating an extra macro
    wrapper, BTRFS_RAID_ATTR, that inserts some extra text in the struct
    name.
    
    Instead of polluting sysfs.h with such kind of extra macro definitions,
    and only doing so when there are collisions, use a prefix which gets
    inserted in the struct name, so we keep everything nicely grouped
    together by default.
    
    Current collections of attributes are:
    * (the toplevel, empty prefix)
    * allocation
    * space_info
    * raid
    * features
    Signed-off-by: default avatarHans van Kranenburg <hans.van.kranenburg@mendix.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    a969f4cc
sysfs.h 2.97 KB