On Mon, May 18, 2026 at 08:21:09PM +1200, Tao Liu wrote:
> index b3650c0..fc55c99 100644
> --- a/tools.c
> +++ b/tools.c
> @@ -4755,9 +4755,15 @@ do_xarray_iter(ulong node, uint height, char *path,
> if (!slot)
> continue;
>
> - if (ops->update_off)
> + if (ops->update_off) {
> update_off = ops->update_off(node, height, path, index,
> slot, off, shift, ops);
> + if (height > 1) {
> + if (update_off)
> + continue;
> + update_off = 1;
> + }
> + }
Sorry to be picky, I still think the height > 1 and continue thing is folio's
stuff.
Okay, no problem.
Please checkout my updated modification on your v7.
>
> if ((slot & XARRAY_TAG_MASK) == XARRAY_TAG_INTERNAL) {
> slot &= ~XARRAY_TAG_INTERNAL;
> --
>
> If you think it is okay, I can create a formal patch.
>
>
> Thanks
> Huang Shijie
>
>
> > if ((slot & XARRAY_TAG_MASK) == XARRAY_TAG_INTERNAL) {
> > slot &= ~XARRAY_TAG_INTERNAL;
> > - } else if (ops->update_off && height > 1) {
> > - update_off = ops->update_off(node, height, path,
index,
> > - slot, off, shift,
ops);
> > - if (update_off)
> > - continue;
> > - update_off = 1;
> > }
> >
> > if (height == 1) {
> > ops->entry(node, slot, path, index | off,
ops->private);
> > - if (ops->update_off)
> > - update_off = ops->update_off(node, height,
path, index,
> > - slot, off,
shift, ops);
> > } else {
> > ulong child_index = index | (off << shift);
> > char child_path[BUFSIZE];
> >
> >
>
>
>
diff --git a/defs.h b/defs.h
index 52f8ce9..ccc2d93 100644
--- a/defs.h
+++ b/defs.h
@@ -5690,7 +5690,8 @@ struct xarray_ops {
void (*entry)(ulong node, ulong slot, const char *path,
ulong index, void *private);
uint (*update_off)(ulong node, uint height, char *path, ulong index,
- ulong slot, uint off, ulong shift, struct xarray_ops *ops);
+ ulong slot, uint off, ulong shift, struct xarray_ops *ops,
+ bool *should_continue);
uint radix;
void *private;
};
diff --git a/filesys.c b/filesys.c
index fc672ad..8a073e0 100644
--- a/filesys.c
+++ b/filesys.c
@@ -4277,22 +4277,25 @@ folio_update_count(ulong slot)
}
static uint folio_xarray_update_off(ulong node, uint height, char *path, ulong index,
- ulong slot, uint off, ulong shift, struct xarray_ops *ops)
+ ulong slot, uint off, ulong shift, struct xarray_ops
*ops,
+ bool *should_continue)
{
- uint order;
-
- if (height > 1) {
- if ((slot & XARRAY_TAG_MASK) == 0) {
- ops->entry(node, slot, path, index | off, ops->private);
- order = folio_order(slot) % XA_CHUNK_SHIFT;
- return 1 << order;
- }
- return 0;
- }
-
- /* The height == 1 */
- order = folio_order(slot) % XA_CHUNK_SHIFT;
- return 1 << order;
+ uint order;
+
+ if (height == 1) {
+ order = folio_order(slot) % XA_CHUNK_SHIFT;
+ return 1 << order;
+ }
+
+ if ((slot & XARRAY_TAG_MASK) == 0) {
+ if (height > 1)
+ *should_continue = true;
okay. I will change the code like this.
Thanks
Huang Shijie