• Stefan Roesch's avatar
    btrfs: sysfs: add force_chunk_alloc trigger to force allocation · 22c55e3b
    Stefan Roesch authored
    Adds write-only trigger to force new chunk allocation for a given block
    group type. It is at
    
      /sys/fs/btrfs/<uuid>/allocation/<type>/force_chunk_alloc
    
    Note: this is now only for debugging and testing and is enabled with the
          CONFIG_BTRFS_DEBUG configuration option. The transaction is
          started from sysfs context and can be problematic in some cases.
    Signed-off-by: default avatarStefan Roesch <shr@fb.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    [ Changes from the original submission:
      - update changelog
      - drop unnecessary error messages
      - switch value to bool and use kstrtobool
      - move BTRFS_ATTR_W definition
      - add comment for using transaction
    ]
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    22c55e3b
sysfs.c 59.3 KB