Merge branch 'i2c/for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
[linux-2.6-microblaze.git] / fs / iomap / fiemap.c
index d55e8f4..aab070d 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/compiler.h>
 #include <linux/fs.h>
 #include <linux/iomap.h>
+#include <linux/fiemap.h>
 
 struct fiemap_ctx {
        struct fiemap_extent_info *fi;
@@ -65,7 +66,7 @@ iomap_fiemap_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
 }
 
 int iomap_fiemap(struct inode *inode, struct fiemap_extent_info *fi,
-               loff_t start, loff_t len, const struct iomap_ops *ops)
+               u64 start, u64 len, const struct iomap_ops *ops)
 {
        struct fiemap_ctx ctx;
        loff_t ret;
@@ -74,16 +75,10 @@ int iomap_fiemap(struct inode *inode, struct fiemap_extent_info *fi,
        ctx.fi = fi;
        ctx.prev.type = IOMAP_HOLE;
 
-       ret = fiemap_check_flags(fi, FIEMAP_FLAG_SYNC);
+       ret = fiemap_prep(inode, fi, start, &len, 0);
        if (ret)
                return ret;
 
-       if (fi->fi_flags & FIEMAP_FLAG_SYNC) {
-               ret = filemap_write_and_wait(inode->i_mapping);
-               if (ret)
-                       return ret;
-       }
-
        while (len > 0) {
                ret = iomap_apply(inode, start, len, IOMAP_REPORT, ops, &ctx,
                                iomap_fiemap_actor);