diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2016-09-18 20:13:02 -0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-09-18 20:13:02 -0400 |
commit | e43c460dcd265431df7a5e481450ad9c0596c10c (patch) | |
tree | 2b68863bf6d156f977c9e48e5bb2b56883139922 | |
parent | 5f4e5752a8a3a72c79514def2ad9fc7cd410ce2e (diff) |
iomap: add a flag to report shared extents
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>
-rw-r--r-- | fs/iomap.c | 2 | ||||
-rw-r--r-- | include/linux/iomap.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/fs/iomap.c b/fs/iomap.c index e9b3f991c2d8..ec411a6b9edc 100644 --- a/fs/iomap.c +++ b/fs/iomap.c | |||
@@ -512,6 +512,8 @@ static int iomap_to_fiemap(struct fiemap_extent_info *fi, | |||
512 | 512 | ||
513 | if (iomap->flags & IOMAP_F_MERGED) | 513 | if (iomap->flags & IOMAP_F_MERGED) |
514 | flags |= FIEMAP_EXTENT_MERGED; | 514 | flags |= FIEMAP_EXTENT_MERGED; |
515 | if (iomap->flags & IOMAP_F_SHARED) | ||
516 | flags |= FIEMAP_EXTENT_SHARED; | ||
515 | 517 | ||
516 | return fiemap_fill_next_extent(fi, iomap->offset, | 518 | return fiemap_fill_next_extent(fi, iomap->offset, |
517 | iomap->blkno != IOMAP_NULL_BLOCK ? iomap->blkno << 9: 0, | 519 | iomap->blkno != IOMAP_NULL_BLOCK ? iomap->blkno << 9: 0, |
diff --git a/include/linux/iomap.h b/include/linux/iomap.h index 3a56212a0a8d..c74226a738a3 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h | |||
@@ -22,6 +22,7 @@ struct vm_fault; | |||
22 | * Flags for iomap mappings: | 22 | * Flags for iomap mappings: |
23 | */ | 23 | */ |
24 | #define IOMAP_F_MERGED 0x01 /* contains multiple blocks/extents */ | 24 | #define IOMAP_F_MERGED 0x01 /* contains multiple blocks/extents */ |
25 | #define IOMAP_F_SHARED 0x02 /* block shared with another file */ | ||
25 | 26 | ||
26 | /* | 27 | /* |
27 | * Magic value for blkno: | 28 | * Magic value for blkno: |