On Dec 12, 2013, at 8:26 AM, David Sterba <dsterba@xxxxxxx> wrote: > Set the EXTENT_DATA_COMPRESSED flag together with EXTENT_ENCODED as > defined by fiemap spec. > > Signed-off-by: David Sterba <dsterba@xxxxxxx> > --- > fs/btrfs/extent_io.c | 9 +++++++-- > 1 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c > index 5ea0ef5..8a28f15 100644 > --- a/fs/btrfs/extent_io.c > +++ b/fs/btrfs/extent_io.c > > @@ -4220,9 +4222,12 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, > > if (ref_cnt > 1) > flags |= FIEMAP_EXTENT_SHARED; > + em_phys_len = em->block_len; > } > - if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags)) > + if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags)) { > flags |= FIEMAP_EXTENT_ENCODED; > + flags |= FIEMAP_EXTENT_DATA_COMPRESSED; (minor nit) Could combine these (not sure it makes a difference to the compiler): flags |= (FIEMAP_EXTENT_ENCODED | FIEMAP_EXTENT_DATA_COMPRESSED); Cheers, Andreas
Attachment:
signature.asc
Description: Message signed with OpenPGP using GPGMail