Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142738567
D49330.id168551.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D49330.id168551.diff
View Options
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -388,7 +388,7 @@
return FALSE;
bsize = vp->v_mount->mnt_stat.f_iosize;
- pagesperblock = bsize / PAGE_SIZE;
+ pagesperblock = atop(bsize);
blocksperpage = 0;
if (pagesperblock > 0) {
reqblock = pindex / pagesperblock;
@@ -645,8 +645,8 @@
*rtaddress += voffset / DEV_BSIZE;
if (run) {
*run += 1;
- *run *= bsize / PAGE_SIZE;
- *run -= voffset / PAGE_SIZE;
+ *run *= atop(bsize);
+ *run -= atop(voffset);
}
}
@@ -909,7 +909,7 @@
object = vp->v_object;
foff = IDX_TO_OFF(m[0]->pindex);
bsize = vp->v_mount->mnt_stat.f_iosize;
- pagesperblock = bsize / PAGE_SIZE;
+ pagesperblock = atop(bsize);
KASSERT(foff < object->un_pager.vnp.vnp_size,
("%s: page %p offset beyond vp %p size", __func__, m[0], vp));
@@ -991,7 +991,7 @@
bp->b_blkno += (foff % bsize) / DEV_BSIZE;
/* Recalculate blocks available after/before to pages. */
- poff = (foff % bsize) / PAGE_SIZE;
+ poff = atop(foff % bsize);
before *= pagesperblock;
before += poff;
after *= pagesperblock;
@@ -1172,14 +1172,14 @@
runningbufwakeup(bp);
- if (error == 0 && bp->b_bcount != bp->b_npages * PAGE_SIZE) {
+ if (error == 0 && bp->b_bcount != ptoa(bp->b_npages)) {
if (!buf_mapped(bp)) {
bp->b_data = bp->b_kvabase;
pmap_qenter((vm_offset_t)bp->b_data, bp->b_pages,
bp->b_npages);
}
bzero(bp->b_data + bp->b_bcount,
- PAGE_SIZE * bp->b_npages - bp->b_bcount);
+ ptoa(bp->b_npages) - bp->b_bcount);
}
if (buf_mapped(bp)) {
pmap_qremove((vm_offset_t)bp->b_data, bp->b_npages);
@@ -1258,7 +1258,7 @@
{
int rtval __diagused;
struct vnode *vp;
- int bytes = count * PAGE_SIZE;
+ int bytes = ptoa(count);
/*
* Force synchronous operation if we are extremely low on memory
@@ -1329,7 +1329,7 @@
static int curfail;
object = vp->v_object;
- count = bytecount / PAGE_SIZE;
+ count = atop(bytecount);
for (i = 0; i < count; i++)
rtvals[i] = VM_PAGER_ERROR;
@@ -1342,7 +1342,7 @@
return (VM_PAGER_BAD);
}
- maxsize = count * PAGE_SIZE;
+ maxsize = ptoa(count);
ncount = count;
poffset = IDX_TO_OFF(ma[0]->pindex);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 23, 10:42 PM (8 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27198711
Default Alt Text
D49330.id168551.diff (2 KB)
Attached To
Mode
D49330: vnode_pager: use ptoa(), atop()
Attached
Detach File
Event Timeline
Log In to Comment