diff options
author | phk <phk@FreeBSD.org> | 2003-08-05 06:51:26 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-08-05 06:51:26 +0000 |
commit | a295f1212823ae7109002f71e1a29a313dfee5df (patch) | |
tree | fafbf3292a80e6b5bbc877283b671caae22604a6 /sys/vm | |
parent | c143c30d69d2ba57e098635e24c72d63089e7555 (diff) | |
download | FreeBSD-src-a295f1212823ae7109002f71e1a29a313dfee5df.zip FreeBSD-src-a295f1212823ae7109002f71e1a29a313dfee5df.tar.gz |
Use sparse struct initializations for struct pagerops.
This makes grepping for which pagers implement which methods easier.
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/default_pager.c | 12 | ||||
-rw-r--r-- | sys/vm/device_pager.c | 13 | ||||
-rw-r--r-- | sys/vm/phys_pager.c | 13 | ||||
-rw-r--r-- | sys/vm/vm_pager.c | 30 | ||||
-rw-r--r-- | sys/vm/vnode_pager.c | 13 |
5 files changed, 28 insertions, 53 deletions
diff --git a/sys/vm/default_pager.c b/sys/vm/default_pager.c index b3e6e44..113322a 100644 --- a/sys/vm/default_pager.c +++ b/sys/vm/default_pager.c @@ -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, }; /* diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c index 65b268a..85eeed0 100644 --- a/sys/vm/device_pager.c +++ b/sys/vm/device_pager.c @@ -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 diff --git a/sys/vm/phys_pager.c b/sys/vm/phys_pager.c index 214315d..6a2e191 100644 --- a/sys/vm/phys_pager.c +++ b/sys/vm/phys_pager.c @@ -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, }; diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index 9f089b7..e5d6cc7 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -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[] = { @@ -264,24 +262,6 @@ vm_pager_deallocate(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 * vm_pager_has_page() - inline, see vm/vm_pager.h diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 69f4b42..58f4518 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -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; |