@@ -1099,11 +1099,11 @@ vm_fault_t iomap_page_mkwrite(struct vm_fault *vmf, const struct iomap_ops *ops)
EXPORT_SYMBOL_GPL(iomap_page_mkwrite);
struct fiemap_iomap_ctx {
- struct fiemap_extent_info *fi;
+ struct fiemap_ctx *f_ctx;
struct iomap prev;
};
-static int iomap_to_fiemap(struct fiemap_extent_info *fi,
+static int iomap_to_fiemap(struct fiemap_ctx *f_ctx,
struct iomap *iomap, u32 flags)
{
switch (iomap->type) {
@@ -1128,7 +1128,9 @@ static int iomap_to_fiemap(struct fiemap_extent_info *fi,
if (iomap->flags & IOMAP_F_SHARED)
flags |= FIEMAP_EXTENT_SHARED;
- return fiemap_fill_next_extent(fi, iomap->offset,
+ return fiemap_fill_next_extent(
+ (struct fiemap_extent_info *)f_ctx->fc_data,
+ iomap->offset,
iomap->addr != IOMAP_NULL_ADDR ? iomap->addr : 0,
iomap->length, flags);
}
@@ -1143,7 +1145,7 @@ iomap_fiemap_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
if (iomap->type == IOMAP_HOLE)
return length;
- ret = iomap_to_fiemap(ctx->fi, &ctx->prev, 0);
+ ret = iomap_to_fiemap(ctx->f_ctx, &ctx->prev, 0);
ctx->prev = *iomap;
switch (ret) {
case 0: /* success */
@@ -1158,12 +1160,11 @@ iomap_fiemap_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
int iomap_fiemap(struct inode *inode, struct fiemap_ctx *f_ctx,
loff_t start, loff_t len, const struct iomap_ops *ops)
{
- struct fiemap_extent_info *fi = f_ctx->fc_data;
struct fiemap_iomap_ctx ctx;
loff_t ret;
memset(&ctx, 0, sizeof(ctx));
- ctx.fi = fi;
+ ctx.f_ctx = f_ctx;
ctx.prev.type = IOMAP_HOLE;
ret = fiemap_check_flags(f_ctx, FIEMAP_FLAG_SYNC);
@@ -1192,7 +1193,7 @@ int iomap_fiemap(struct inode *inode, struct fiemap_ctx *f_ctx,
}
if (ctx.prev.type != IOMAP_HOLE) {
- ret = iomap_to_fiemap(fi, &ctx.prev, FIEMAP_EXTENT_LAST);
+ ret = iomap_to_fiemap(f_ctx, &ctx.prev, FIEMAP_EXTENT_LAST);
if (ret < 0)
return ret;
}
struct fiemap_extent_info will be removed in future patches, remove its direct usage from iomap Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com> --- fs/iomap.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)