mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 10:19:26 +00:00
Use sparse struct initializations for struct pagerops.
This makes grepping for which pagers implement which methods easier.
This commit is contained in:
parent
09a6b6c3db
commit
4e6586002d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=118466
@ -64,13 +64,11 @@ static boolean_t default_pager_haspage(vm_object_t, vm_pindex_t, int *,
|
||||
* pagerops for OBJT_DEFAULT - "default pager".
|
||||
*/
|
||||
struct pagerops defaultpagerops = {
|
||||
NULL,
|
||||
default_pager_alloc,
|
||||
default_pager_dealloc,
|
||||
default_pager_getpages,
|
||||
default_pager_putpages,
|
||||
default_pager_haspage,
|
||||
NULL
|
||||
.pgo_alloc = default_pager_alloc,
|
||||
.pgo_dealloc = default_pager_dealloc,
|
||||
.pgo_getpages = default_pager_getpages,
|
||||
.pgo_putpages = default_pager_putpages,
|
||||
.pgo_haspage = default_pager_haspage,
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -80,13 +80,12 @@ static vm_page_t dev_pager_getfake(vm_paddr_t);
|
||||
static void dev_pager_putfake(vm_page_t);
|
||||
|
||||
struct pagerops devicepagerops = {
|
||||
dev_pager_init,
|
||||
dev_pager_alloc,
|
||||
dev_pager_dealloc,
|
||||
dev_pager_getpages,
|
||||
dev_pager_putpages,
|
||||
dev_pager_haspage,
|
||||
NULL
|
||||
.pgo_init = dev_pager_init,
|
||||
.pgo_alloc = dev_pager_alloc,
|
||||
.pgo_dealloc = dev_pager_dealloc,
|
||||
.pgo_getpages = dev_pager_getpages,
|
||||
.pgo_putpages = dev_pager_putpages,
|
||||
.pgo_haspage = dev_pager_haspage,
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -201,11 +201,10 @@ phys_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before,
|
||||
}
|
||||
|
||||
struct pagerops physpagerops = {
|
||||
phys_pager_init,
|
||||
phys_pager_alloc,
|
||||
phys_pager_dealloc,
|
||||
phys_pager_getpages,
|
||||
phys_pager_putpages,
|
||||
phys_pager_haspage,
|
||||
NULL
|
||||
.pgo_init = phys_pager_init,
|
||||
.pgo_alloc = phys_pager_alloc,
|
||||
.pgo_dealloc = phys_pager_dealloc,
|
||||
.pgo_getpages = phys_pager_getpages,
|
||||
.pgo_putpages = phys_pager_putpages,
|
||||
.pgo_haspage = phys_pager_haspage,
|
||||
};
|
||||
|
@ -154,13 +154,11 @@ dead_pager_dealloc(object)
|
||||
}
|
||||
|
||||
static struct pagerops deadpagerops = {
|
||||
NULL,
|
||||
dead_pager_alloc,
|
||||
dead_pager_dealloc,
|
||||
dead_pager_getpages,
|
||||
dead_pager_putpages,
|
||||
dead_pager_haspage,
|
||||
NULL
|
||||
.pgo_alloc = dead_pager_alloc,
|
||||
.pgo_dealloc = dead_pager_dealloc,
|
||||
.pgo_getpages = dead_pager_getpages,
|
||||
.pgo_putpages = dead_pager_putpages,
|
||||
.pgo_haspage = dead_pager_haspage,
|
||||
};
|
||||
|
||||
struct pagerops *pagertab[] = {
|
||||
@ -263,24 +261,6 @@ vm_pager_deallocate(object)
|
||||
(*pagertab[object->type]->pgo_dealloc) (object);
|
||||
}
|
||||
|
||||
/*
|
||||
* vm_pager_strategy:
|
||||
*
|
||||
* called with no specific spl
|
||||
* Execute strategy routine directly to pager.
|
||||
*/
|
||||
void
|
||||
vm_pager_strategy(vm_object_t object, struct bio *bp)
|
||||
{
|
||||
if (pagertab[object->type]->pgo_strategy) {
|
||||
(*pagertab[object->type]->pgo_strategy)(object, bp);
|
||||
} else {
|
||||
bp->bio_flags |= BIO_ERROR;
|
||||
bp->bio_error = ENXIO;
|
||||
biodone(bp);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* vm_pager_get_pages() - inline, see vm/vm_pager.h
|
||||
* vm_pager_put_pages() - inline, see vm/vm_pager.h
|
||||
|
@ -83,13 +83,12 @@ static void vnode_pager_putpages(vm_object_t, vm_page_t *, int, boolean_t, int *
|
||||
static boolean_t vnode_pager_haspage(vm_object_t, vm_pindex_t, int *, int *);
|
||||
|
||||
struct pagerops vnodepagerops = {
|
||||
vnode_pager_init,
|
||||
vnode_pager_alloc,
|
||||
vnode_pager_dealloc,
|
||||
vnode_pager_getpages,
|
||||
vnode_pager_putpages,
|
||||
vnode_pager_haspage,
|
||||
NULL
|
||||
.pgo_init = vnode_pager_init,
|
||||
.pgo_alloc = vnode_pager_alloc,
|
||||
.pgo_dealloc = vnode_pager_dealloc,
|
||||
.pgo_getpages = vnode_pager_getpages,
|
||||
.pgo_putpages = vnode_pager_putpages,
|
||||
.pgo_haspage = vnode_pager_haspage,
|
||||
};
|
||||
|
||||
int vnode_pbuf_freecnt;
|
||||
|
Loading…
Reference in New Issue
Block a user