Skip to content

fiemap: introduce DATA_COMPRESSED and PHYS_LENGTH flags

David Sterba linux-btrfs linux-ext4 linux-fsdevel linux-nilfs linux-xfs 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest6 patches 5 repliesIn review
  2. v45 patches 0 repliesSuperseded
  3. v34 patches 12 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v23 patches1 replySuperseded
v13 patches2 repliesSuperseded

Changes in v5 from the cover letter

Physical length is by default undefined. Btrfs use of compressed flag was enhanced to reflect the fiemap changes. Patches reordered so the generic fiemap go first.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6fiemap: fix comment at EXTENT_DATA_ENCRYPTEDinclude/uapi/linux/fiemap.h+1 -11 reply
2/6fiemap: add fe_phys_length and EXTENT_PHYS_LENGTH flagfs/btrfs/extent_io.c fs/ext4/extents.c fs/ext4/inline.c +7 more+27 -181 reply
3/6fiemap: add FIEMAP_EXTENT_DATA_COMPRESSED flagfs/ioctl.c include/uapi/linux/fiemap.h+9 -11 reply
4/6Documentation/fiemap: Document DATA_COMPRESSED and PHYS_LENGTH flagsDocumentation/filesystems/fiemap.txt+17 -21 reply
5/6fiemap: rename fe_length to fe_logi_lengthDocumentation/filesystems/fiemap.txt fs/ioctl.c include/uapi/linux/fiemap.h+11 -81 reply
6/6btrfs: set FIEMAP_EXTENT_DATA_COMPRESSED for compressed extentsfs/btrfs/extent_io.c+8 -30 replies

Reviews trailers per patch

2 of 6 patches have a Reviewed-by or Acked-by.

PatchAndreas Dilger
1/6R-b
2/6
3/6
4/6
5/6R-b
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH 0/6 v5] fiemap: introduce DATA_COMPRESSED and PHYS_LENGTH flags

The original FIEMAP patch did not define the bits, btrfs would like to use a flag for compressed extents. The PHYS_LENGTH flag emerged during patchset revisions to keep backward compatibility and flexible fiemap API.

Currently, the 'filefrag' utility has no way to recognize and denote a compressed extent. As implemented in btrfs right now, the compression step splits a big extent into smaller chunks and this is reported as a heavily fragmented file. Adding the flag to filefrag will at least give some explanation why, this has been confusing users for some time already.

fiemap_fill_next_extent is extended and takes argument to fill the physical length.

V5:
Physical length is by default undefined. Btrfs use of compressed flag was enhanced to reflect the fiemap changes. Patches reordered so the generic fiemap go first.

V4:
The physical length is always set and equal to logical, or different and then sets the COMPRESSED flag.
fiemap_extent::fe_length renamed to fe_logi_length

V3:
Based on feedback from Andreas, implement #1 from V2, current users of fiemap_fill_next_extent (fs/, ext4, gfs2, ocfs2, nilfs2, xfs) updated accordingly, no functional change.

V2:
Based on feedback from Andreas, the fiemap_extent is now able to hold the physical extent length, to be filled by the filesystem callback.

1) extend fiemap_fill_next_extent to take phys_length and update all users (ext4, gfs2, ocfs2, nilfs2, xfs)

David Sterba (6):
fiemap: fix comment at EXTENT_DATA_ENCRYPTED
fiemap: add fe_phys_length and EXTENT_PHYS_LENGTH flag
fiemap: add FIEMAP_EXTENT_DATA_COMPRESSED flag Documentation/fiemap: Document DATA_COMPRESSED and PHYS_LENGTH flags
fiemap: rename fe_length to fe_logi_length
btrfs: set FIEMAP_EXTENT_DATA_COMPRESSED for compressed extents

 Documentation/filesystems/fiemap.txt | 24 ++++++++++++++++++++----
 fs/btrfs/extent_io.c                 | 11 ++++++++---
 fs/ext4/extents.c                    |  4 ++--
 fs/ext4/inline.c                     |  2 +-
 fs/gfs2/inode.c                      |  2 +-
 fs/ioctl.c                           | 21 ++++++++++++++-------
 fs/nilfs2/inode.c                    |  8 +++++---
 fs/ocfs2/extent_map.c                |  4 ++--
 fs/xfs/xfs_iops.c                    |  2 +-
 include/linux/fs.h                   |  2 +-
 include/uapi/linux/fiemap.h          | 16 +++++++++++++---
 11 files changed, 68 insertions(+), 28 deletions(-)
Signature · 1 line
1.8.4.5