In commit c11d2c236cc26 ("Btrfs: add ioctl to get and reset the device stats") the get_dev_stats ioctl was added. Shortly thereafter, in commit b27f7c0c150f7 ("btrfs: join DEV_STATS ioctls to one") , the flags field was added. However, the calculation for unused padding space was not updated, which also invalidated the comment. Clarify what happened to reduce confusion and wasted time for anyone implementing this.
Showing the changes to include/uapi/linux (1 of 1 file). Show all
Unified · Split
| @@ -665,7 +665,12 @@ struct btrfs_ioctl_get_dev_stats { · 664 unmodified lines | |||
| 665 | /* out values: */ | 665 | /* out values: */ |
| 666 | __u64 values[BTRFS_DEV_STAT_VALUES_MAX]; | 666 | __u64 values[BTRFS_DEV_STAT_VALUES_MAX]; |
| 667 | 667 | ||
| 668 | __u64 unused[128 - 2 - BTRFS_DEV_STAT_VALUES_MAX]; /* pad to 1k */ | 668 | /* |
| 669 | * This pads the struct to 1032 bytes. It was originally meant to pad to | ||
| 670 | * 1024 bytes, but when adding the flags field, the padding calculation | ||
| 671 | * was not adjusted. | ||
| 672 | */ | ||
| 673 | __u64 unused[128 - 2 - BTRFS_DEV_STAT_VALUES_MAX]; | ||
| 669 | }; | 674 | }; |
| 670 | 675 | ||
| 671 | #define BTRFS_QUOTA_CTL_ENABLE 1 | 676 | #define BTRFS_QUOTA_CTL_ENABLE 1 |