genfs_putpages: Localize a few variables. No functional changes.
This commit is contained in:
parent
85d544cd45
commit
6903a05402
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: genfs_io.c,v 1.23 2010/01/27 15:53:06 uebayasi Exp $ */
|
/* $NetBSD: genfs_io.c,v 1.24 2010/01/28 07:24:55 uebayasi Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1982, 1986, 1989, 1993
|
* Copyright (c) 1982, 1986, 1989, 1993
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.23 2010/01/27 15:53:06 uebayasi Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.24 2010/01/28 07:24:55 uebayasi Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
|
@ -105,10 +105,10 @@ genfs_getpages(void *v)
|
||||||
int a_flags;
|
int a_flags;
|
||||||
} */ * const ap = v;
|
} */ * const ap = v;
|
||||||
|
|
||||||
off_t newsize, diskeof, memeof;
|
off_t diskeof, memeof;
|
||||||
off_t offset, origoffset, startoffset, endoffset;
|
off_t offset, origoffset, startoffset, endoffset;
|
||||||
daddr_t lbn, blkno;
|
daddr_t lbn, blkno;
|
||||||
int i, error, npages, orignpages, npgs, run, ridx, pidx, pcount;
|
int i, error, npages, orignpages, npgs, run, ridx;
|
||||||
int fs_bshift, fs_bsize, dev_bshift;
|
int fs_bshift, fs_bsize, dev_bshift;
|
||||||
const int flags = ap->a_flags;
|
const int flags = ap->a_flags;
|
||||||
size_t bytes, iobytes, tailstart, tailbytes, totalbytes, skipbytes;
|
size_t bytes, iobytes, tailstart, tailbytes, totalbytes, skipbytes;
|
||||||
|
@ -146,6 +146,7 @@ startover:
|
||||||
orignpages = *ap->a_count;
|
orignpages = *ap->a_count;
|
||||||
GOP_SIZE(vp, origvsize, &diskeof, 0);
|
GOP_SIZE(vp, origvsize, &diskeof, 0);
|
||||||
if (flags & PGO_PASTEOF) {
|
if (flags & PGO_PASTEOF) {
|
||||||
|
off_t newsize;
|
||||||
#if defined(DIAGNOSTIC)
|
#if defined(DIAGNOSTIC)
|
||||||
off_t writeeof;
|
off_t writeeof;
|
||||||
#endif /* defined(DIAGNOSTIC) */
|
#endif /* defined(DIAGNOSTIC) */
|
||||||
|
@ -452,6 +453,7 @@ startover:
|
||||||
for (offset = startoffset;
|
for (offset = startoffset;
|
||||||
bytes > 0;
|
bytes > 0;
|
||||||
offset += iobytes, bytes -= iobytes) {
|
offset += iobytes, bytes -= iobytes) {
|
||||||
|
int pidx;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* skip pages which don't need to be read.
|
* skip pages which don't need to be read.
|
||||||
|
@ -501,6 +503,8 @@ startover:
|
||||||
iobytes = MIN((((off_t)lbn + 1 + run) << fs_bshift) - offset,
|
iobytes = MIN((((off_t)lbn + 1 + run) << fs_bshift) - offset,
|
||||||
bytes);
|
bytes);
|
||||||
if (offset + iobytes > round_page(offset)) {
|
if (offset + iobytes > round_page(offset)) {
|
||||||
|
int pcount;
|
||||||
|
|
||||||
pcount = 1;
|
pcount = 1;
|
||||||
while (pidx + pcount < npages &&
|
while (pidx + pcount < npages &&
|
||||||
pgs[pidx + pcount]->flags & PG_FAKE) {
|
pgs[pidx + pcount]->flags & PG_FAKE) {
|
||||||
|
|
Loading…
Reference in New Issue