Is it possible to get the compressed and uncompressed sizes of a file on a btrfs file system?

there is a third party tool that can do this. https://github.com/kilobyte/compsize usage: ayush@devbox:/code/compsize$ sudo compsize /opt Processed 54036 files, 42027 regular extents (42028 refs), 27150 inline. Type Perc Disk Usage Uncompressed Referenced Data 82% 5.3G 6.4G 6.4G none 100% 4.3G 4.3G 4.3G zlib 37% 427M 1.1G 1.1G lzo 56% 588M 1.0G 1.0G