summaryrefslogtreecommitdiffstats
path: root/fs/iomap/fiemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/iomap/fiemap.c')
-rw-r--r--fs/iomap/fiemap.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/fs/iomap/fiemap.c b/fs/iomap/fiemap.c
index 610ca6f1ec9b..80675c42e94e 100644
--- a/fs/iomap/fiemap.c
+++ b/fs/iomap/fiemap.c
@@ -39,24 +39,23 @@ static int iomap_to_fiemap(struct fiemap_extent_info *fi,
iomap->length, flags);
}
-static loff_t iomap_fiemap_iter(const struct iomap_iter *iter,
+static int iomap_fiemap_iter(struct iomap_iter *iter,
struct fiemap_extent_info *fi, struct iomap *prev)
{
int ret;
if (iter->iomap.type == IOMAP_HOLE)
- return iomap_length(iter);
+ goto advance;
ret = iomap_to_fiemap(fi, prev, 0);
*prev = iter->iomap;
- switch (ret) {
- case 0: /* success */
- return iomap_length(iter);
- case 1: /* extent array full */
- return 0;
- default: /* error */
+ if (ret < 0)
return ret;
- }
+ if (ret == 1) /* extent array full */
+ return 0;
+
+advance:
+ return iomap_iter_advance_full(iter);
}
int iomap_fiemap(struct inode *inode, struct fiemap_extent_info *fi,
@@ -78,7 +77,7 @@ int iomap_fiemap(struct inode *inode, struct fiemap_extent_info *fi,
return ret;
while ((ret = iomap_iter(&iter, ops)) > 0)
- iter.processed = iomap_fiemap_iter(&iter, fi, &prev);
+ iter.status = iomap_fiemap_iter(&iter, fi, &prev);
if (prev.type != IOMAP_HOLE) {
ret = iomap_to_fiemap(fi, &prev, FIEMAP_EXTENT_LAST);
@@ -114,7 +113,7 @@ iomap_bmap(struct address_space *mapping, sector_t bno,
while ((ret = iomap_iter(&iter, ops)) > 0) {
if (iter.iomap.type == IOMAP_MAPPED)
bno = iomap_sector(&iter.iomap, iter.pos) >> blkshift;
- /* leave iter.processed unset to abort loop */
+ /* leave iter.status unset to abort loop */
}
if (ret)
return 0;
ns'>-2/+81 2024-04-19fsck: warn about symlink pointing inside a gitdirJohannes Schindelin4-0/+117 2024-04-19core.hooksPath: add some protection while cloningJohannes Schindelin2-1/+27 2024-04-19init.templateDir: consider this config setting protectedJohannes Schindelin2-7/+61 2024-04-19clone: prevent hooks from running during a cloneJohannes Schindelin3-1/+94 2024-04-19Add a helper function to compare file contentsJohannes Schindelin4-0/+123 2024-04-17init: refactor the template directory discovery into its own functionJohannes Schindelin3-18/+37 2024-04-17find_hook(): refactor the `STRIP_EXTENSION` logicJohannes Schindelin1-7/+11 2024-04-17clone: when symbolic links collide with directories, keep the latterJohannes Schindelin3-2/+31 2024-04-17entry: report more colliding pathsJohannes Schindelin3-1/+20 2024-04-17t5510: verify that D/F confusion cannot lead to an RCEJohannes Schindelin1-0/+24 2024-04-17submodule: require the submodule path to contain directories onlyJohannes Schindelin4-5/+113 2024-04-17clone_submodule: avoid using `access()` on directoriesJohannes Schindelin1-1/+1 2024-04-17submodules: submodule paths must not contain symlinksJohannes Schindelin2-0/+83 2024-04-17clone: prevent clashing git dirs when cloning submodule in parallelFilip Hejsek3-2/+66