Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fiemap add physical length #10

Closed
wants to merge 3 commits into from
Closed

Commits on Mar 8, 2024

  1. fs: add physical_length field to fiemap extents

    Some filesystems support compressed extents which have a larger logical
    size than physical, and for those filesystems, it can be useful for
    userspace to know how much space those extents actually use. For
    instance, the compsize [1] tool for btrfs currently uses btrfs-internal,
    root-only ioctl to find the actual disk space used by a file; it would
    be better and more useful for this information to require fewer
    privileges and to be usable on more filesystems. Therefore, use one of
    the padding u64s in the fiemap extent structure to return the actual
    physical length; and, for now, return this as equal to the logical
    length.
    
    [1] https://github.com/kilobyte/compsize
    
    Signed-off-by: Sweet Tea Dorminy <[email protected]>
    sweettea committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    39b492f View commit details
    Browse the repository at this point in the history
  2. fs: update fiemap_fill_next_extent() signature

    In order to allow filesystems to send both physical and logical length
    for fiemap_extent population, update the signature of
    fiemap_fill_next_extent() and update all callers to pass the same
    logical and physical lengths.
    
    Signed-off-by: Sweet Tea Dorminy <[email protected]>
    sweettea committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    1a9375b View commit details
    Browse the repository at this point in the history
  3. btrfs: return extent disk size in fiemap

    Now that fiemap allows returning extent disk size, plumb this through
    btrfs.
    
    Signed-off-by: Sweet Tea Dorminy <[email protected]>
    sweettea committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    d290a02 View commit details
    Browse the repository at this point in the history