xfs
[Top] [All Lists]

[PATCH 4/7] iomap: prepare iomap_fiemap for attribute mappings

To: xfs@xxxxxxxxxxx
Subject: [PATCH 4/7] iomap: prepare iomap_fiemap for attribute mappings
From: Christoph Hellwig <hch@xxxxxx>
Date: Sat, 13 Aug 2016 16:42:58 -0700
Cc: Dave Chinner <dchinner@xxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1471131781-14107-1-git-send-email-hch@xxxxxx>
References: <1471131781-14107-1-git-send-email-hch@xxxxxx>
From: Dave Chinner <dchinner@xxxxxxxxxx>

By bassing through an -ENOENT, similar to the old XFS implementation of
FIEMAP_FLAG_XATTR.

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
[hch: split from a larger patch]
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
 fs/iomap.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/iomap.c b/fs/iomap.c
index 56c19e6..d9d1f50 100644
--- a/fs/iomap.c
+++ b/fs/iomap.c
@@ -476,6 +476,9 @@ int iomap_fiemap(struct inode *inode, struct 
fiemap_extent_info *fi,
        while (len > 0) {
                ret = iomap_apply(inode, start, len, 0, ops, &ctx,
                                iomap_fiemap_actor);
+               /* inode with no (attribute) mapping will give ENOENT */
+               if (ret == -ENOENT)
+                       break;
                if (ret < 0)
                        return ret;
                if (ret == 0)
-- 
2.1.4

<Prev in Thread] Current Thread [Next in Thread>