git: 30ae88e3b217 - main - swap_pager_seek_data(): move the clipping at the object size to consumers
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 17 Dec 2025 03:53:15 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=30ae88e3b217b12476dba665d163ab0d8dd6a8a7
commit 30ae88e3b217b12476dba665d163ab0d8dd6a8a7
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-12-16 05:32:37 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-12-17 03:40:31 +0000
swap_pager_seek_data(): move the clipping at the object size to consumers
Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D54219
---
sys/fs/tmpfs/tmpfs_vnops.c | 2 ++
sys/vm/swap_pager.c | 2 --
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
index 5082ee1ebdd0..341c88e19115 100644
--- a/sys/fs/tmpfs/tmpfs_vnops.c
+++ b/sys/fs/tmpfs/tmpfs_vnops.c
@@ -2091,6 +2091,8 @@ tmpfs_seek_data_locked(vm_object_t obj, off_t noff)
vm_pindex_t p;
p = swap_pager_seek_data(obj, OFF_TO_IDX(noff));
+ if (p == OBJ_MAX_SIZE)
+ p = obj->size;
return (p == OFF_TO_IDX(noff) ? noff : IDX_TO_OFF(p));
}
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 5e9a0ad94cb3..ab95bde34ceb 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -2479,8 +2479,6 @@ swap_pager_seek_data(vm_object_t object, vm_pindex_t pindex)
return (pages.index);
m = vm_radix_iter_step(&pages);
}
- if (swap_index == OBJ_MAX_SIZE)
- swap_index = object->size;
return (swap_index);
}