iomap: add a flag to report shared extents
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 19 Sep 2016 00:13:02 +0000 (10:13 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 19 Sep 2016 00:13:02 +0000 (10:13 +1000)
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/iomap.c
include/linux/iomap.h

index e9b3f991c2d8ddc9cedb9f40e7112483751824bb..ec411a6b9edc04a18de8fc7ebb3993c361c89935 100644 (file)
@@ -512,6 +512,8 @@ static int iomap_to_fiemap(struct fiemap_extent_info *fi,
 
        if (iomap->flags & IOMAP_F_MERGED)
                flags |= FIEMAP_EXTENT_MERGED;
+       if (iomap->flags & IOMAP_F_SHARED)
+               flags |= FIEMAP_EXTENT_SHARED;
 
        return fiemap_fill_next_extent(fi, iomap->offset,
                        iomap->blkno != IOMAP_NULL_BLOCK ? iomap->blkno << 9: 0,
index 3a56212a0a8d93beed20be9233981ae8605acbef..c74226a738a3ef186b752f652010b5918bdfd0cd 100644 (file)
@@ -22,6 +22,7 @@ struct vm_fault;
  * Flags for iomap mappings:
  */
 #define IOMAP_F_MERGED 0x01    /* contains multiple blocks/extents */
+#define IOMAP_F_SHARED 0x02    /* block shared with another file */
 
 /*
  * Magic value for blkno: