All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3 v2] fiemap: introduce EXTENT_DATA_COMPRESSED flag
@ 2013-10-02 15:02 David Sterba
  2013-10-02 15:02 ` [PATCH 1/3 v2] fiemap: fix comment at EXTENT_DATA_ENCRYPTED David Sterba
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: David Sterba @ 2013-10-02 15:02 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: David Sterba, adilger, hch, mfasheh, viro

The original FIEMAP patch did not define this bit, btrfs will make use of
it.  The defined constant maintains the same value as originally proposed.

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.

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.

The filesystems do not have access to the structure that is passed back to
userspace and are supposed to call fiemap_fill_next_extent, there's no direct
way to fill fe_phys_length. There are two ways to pass it:

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

2) add new function that takes arguments for all the fiemap_extent items,
   newly added phys_length compared to fiemap_fill_next_extent

This patchset implements 2, the footprint is smaller, no need to change
filesystem that do not care about compression.


David Sterba (3):
  fiemap: fix comment at EXTENT_DATA_ENCRYPTED
  fiemap: add EXTENT_DATA_COMPRESSED flag
  btrfs: set FIEMAP_EXTENT_DATA_COMPRESSED for compressed extents

 fs/btrfs/extent_io.c        | 11 ++++++++---
 fs/ioctl.c                  | 42 ++++++++++++++++++++++++++++++++++++++----
 include/linux/fs.h          |  2 ++
 include/uapi/linux/fiemap.h |  8 ++++++--
 4 files changed, 54 insertions(+), 9 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-10-04  3:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-02 15:02 [PATCH 0/3 v2] fiemap: introduce EXTENT_DATA_COMPRESSED flag David Sterba
2013-10-02 15:02 ` [PATCH 1/3 v2] fiemap: fix comment at EXTENT_DATA_ENCRYPTED David Sterba
2013-10-02 15:02 ` [PATCH 2/3 v2] fiemap: add EXTENT_DATA_COMPRESSED flag David Sterba
2013-10-02 15:02 ` [PATCH 3/3 v2] btrfs: set FIEMAP_EXTENT_DATA_COMPRESSED for compressed extents David Sterba
2013-10-04  3:09 ` [PATCH 0/3 v2] fiemap: introduce EXTENT_DATA_COMPRESSED flag Andreas Dilger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.