diff options
author | msmith <msmith@FreeBSD.org> | 1998-03-06 09:46:52 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1998-03-06 09:46:52 +0000 |
commit | 4df44c447b04d17496dd7701a416a8dc8a400637 (patch) | |
tree | e4fe9f7d2d778e100fa475fe14e16b0b3ffe229b | |
parent | ea126748df408b251893fa0494eef1a95f744730 (diff) | |
download | FreeBSD-src-4df44c447b04d17496dd7701a416a8dc8a400637.zip FreeBSD-src-4df44c447b04d17496dd7701a416a8dc8a400637.tar.gz |
Trivial filesystem getpages/putpages implementations, set the second.
These should be considered the first steps in a work-in-progress.
Submitted by: Terry Lambert <terry@freebsd.org>
-rw-r--r-- | sys/fs/cd9660/cd9660_vnops.c | 36 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vnops.c | 35 | ||||
-rw-r--r-- | sys/isofs/cd9660/cd9660_vnops.c | 36 | ||||
-rw-r--r-- | sys/msdosfs/msdosfs_vnops.c | 35 | ||||
-rw-r--r-- | sys/nfs/nfs_bio.c | 17 | ||||
-rw-r--r-- | sys/nfs/nfs_vnops.c | 3 | ||||
-rw-r--r-- | sys/nfs/nfsnode.h | 3 | ||||
-rw-r--r-- | sys/nfsclient/nfs_bio.c | 17 | ||||
-rw-r--r-- | sys/nfsclient/nfs_vnops.c | 3 | ||||
-rw-r--r-- | sys/nfsclient/nfsnode.h | 3 |
10 files changed, 178 insertions, 10 deletions
diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c index 9a8d0ff..8bdcaea 100644 --- a/sys/fs/cd9660/cd9660_vnops.c +++ b/sys/fs/cd9660/cd9660_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95 - * $Id: cd9660_vnops.c,v 1.50 1997/11/18 14:40:36 phk Exp $ + * $Id: cd9660_vnops.c,v 1.51 1997/12/27 02:56:20 bde Exp $ */ #include <sys/param.h> @@ -53,7 +53,9 @@ #include <sys/dirent.h> #include <sys/unistd.h> +#include <vm/vm.h> #include <vm/vm_zone.h> +#include <vm/vnode_pager.h> #include <isofs/cd9660/iso.h> #include <isofs/cd9660/cd9660_node.h> @@ -73,6 +75,8 @@ static int cd9660_readlink __P((struct vop_readlink_args *ap)); static int cd9660_abortop __P((struct vop_abortop_args *)); static int cd9660_strategy __P((struct vop_strategy_args *)); static int cd9660_print __P((struct vop_print_args *)); +static int cd9660_getpages __P((struct vop_getpages_args *)); +static int cd9660_putpages __P((struct vop_putpages_args *)); /* * Setattr call. Only allowed for block and character special devices. @@ -810,6 +814,34 @@ cd9660_pathconf(ap) } /* + * get page routine + * + * XXX By default, wimp out... note that a_offset is ignored (and always + * XXX has been). + */ +int +cd9660_getpages(ap) + struct vop_getpages_args *ap; +{ + return vnode_pager_generic_getpages(ap->a_vp, ap->a_m, ap->a_count, + ap->a_reqpage); +} + +/* + * put page routine + * + * XXX By default, wimp out... note that a_offset is ignored (and always + * XXX has been). + */ +int +cd9660_putpages(ap) + struct vop_putpages_args *ap; +{ + return vnode_pager_generic_putpages(ap->a_vp, ap->a_m, ap->a_count, + ap->a_sync, ap->a_rtvals); +} + +/* * Global vfs data structures for cd9660 */ vop_t **cd9660_vnodeop_p; @@ -833,6 +865,8 @@ static struct vnodeopv_entry_desc cd9660_vnodeop_entries[] = { { &vop_setattr_desc, (vop_t *) cd9660_setattr }, { &vop_strategy_desc, (vop_t *) cd9660_strategy }, { &vop_unlock_desc, (vop_t *) vop_stdunlock }, + { &vop_getpages_desc, (vop_t *) cd9660_getpages }, + { &vop_putpages_desc, (vop_t *) cd9660_putpages }, { NULL, NULL } }; static struct vnodeopv_desc cd9660_vnodeop_opv_desc = diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 9441053..34225da 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.63 1998/03/01 21:26:09 msmith Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.64 1998/03/03 02:50:24 msmith Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ /*- @@ -67,6 +67,7 @@ #include <vm/vm.h> #include <vm/vm_extern.h> #include <vm/vm_zone.h> +#include <vm/vnode_pager.h> #include <msdosfs/bpb.h> #include <msdosfs/direntry.h> @@ -98,6 +99,8 @@ static int msdosfs_bmap __P((struct vop_bmap_args *)); static int msdosfs_strategy __P((struct vop_strategy_args *)); static int msdosfs_print __P((struct vop_print_args *)); static int msdosfs_pathconf __P((struct vop_pathconf_args *ap)); +static int msdosfs_getpages __P((struct vop_getpages_args *)); +static int msdosfs_putpages __P((struct vop_putpages_args *)); /* * Some general notes: @@ -1928,6 +1931,34 @@ msdosfs_pathconf(ap) /* NOTREACHED */ } +/* + * get page routine + * + * XXX By default, wimp out... note that a_offset is ignored (and always + * XXX has been). + */ +int +msdosfs_getpages(ap) + struct vop_getpages_args *ap; +{ + return vnode_pager_generic_getpages(ap->a_vp, ap->a_m, ap->a_count, + ap->a_reqpage); +} + +/* + * put page routine + * + * XXX By default, wimp out... note that a_offset is ignored (and always + * XXX has been). + */ +int +msdosfs_putpages(ap) + struct vop_putpages_args *ap; +{ + return vnode_pager_generic_putpages(ap->a_vp, ap->a_m, ap->a_count, + ap->a_sync, ap->a_rtvals); +} + /* Global vfs data structures for msdosfs */ vop_t **msdosfs_vnodeop_p; static struct vnodeopv_entry_desc msdosfs_vnodeop_entries[] = { @@ -1960,6 +1991,8 @@ static struct vnodeopv_entry_desc msdosfs_vnodeop_entries[] = { { &vop_symlink_desc, (vop_t *) msdosfs_symlink }, { &vop_unlock_desc, (vop_t *) vop_stdunlock }, { &vop_write_desc, (vop_t *) msdosfs_write }, + { &vop_getpages_desc, (vop_t *) msdosfs_getpages }, + { &vop_putpages_desc, (vop_t *) msdosfs_putpages }, { NULL, NULL } }; static struct vnodeopv_desc msdosfs_vnodeop_opv_desc = diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c index 9a8d0ff..8bdcaea 100644 --- a/sys/isofs/cd9660/cd9660_vnops.c +++ b/sys/isofs/cd9660/cd9660_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95 - * $Id: cd9660_vnops.c,v 1.50 1997/11/18 14:40:36 phk Exp $ + * $Id: cd9660_vnops.c,v 1.51 1997/12/27 02:56:20 bde Exp $ */ #include <sys/param.h> @@ -53,7 +53,9 @@ #include <sys/dirent.h> #include <sys/unistd.h> +#include <vm/vm.h> #include <vm/vm_zone.h> +#include <vm/vnode_pager.h> #include <isofs/cd9660/iso.h> #include <isofs/cd9660/cd9660_node.h> @@ -73,6 +75,8 @@ static int cd9660_readlink __P((struct vop_readlink_args *ap)); static int cd9660_abortop __P((struct vop_abortop_args *)); static int cd9660_strategy __P((struct vop_strategy_args *)); static int cd9660_print __P((struct vop_print_args *)); +static int cd9660_getpages __P((struct vop_getpages_args *)); +static int cd9660_putpages __P((struct vop_putpages_args *)); /* * Setattr call. Only allowed for block and character special devices. @@ -810,6 +814,34 @@ cd9660_pathconf(ap) } /* + * get page routine + * + * XXX By default, wimp out... note that a_offset is ignored (and always + * XXX has been). + */ +int +cd9660_getpages(ap) + struct vop_getpages_args *ap; +{ + return vnode_pager_generic_getpages(ap->a_vp, ap->a_m, ap->a_count, + ap->a_reqpage); +} + +/* + * put page routine + * + * XXX By default, wimp out... note that a_offset is ignored (and always + * XXX has been). + */ +int +cd9660_putpages(ap) + struct vop_putpages_args *ap; +{ + return vnode_pager_generic_putpages(ap->a_vp, ap->a_m, ap->a_count, + ap->a_sync, ap->a_rtvals); +} + +/* * Global vfs data structures for cd9660 */ vop_t **cd9660_vnodeop_p; @@ -833,6 +865,8 @@ static struct vnodeopv_entry_desc cd9660_vnodeop_entries[] = { { &vop_setattr_desc, (vop_t *) cd9660_setattr }, { &vop_strategy_desc, (vop_t *) cd9660_strategy }, { &vop_unlock_desc, (vop_t *) vop_stdunlock }, + { &vop_getpages_desc, (vop_t *) cd9660_getpages }, + { &vop_putpages_desc, (vop_t *) cd9660_putpages }, { NULL, NULL } }; static struct vnodeopv_desc cd9660_vnodeop_opv_desc = diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index 9441053..34225da 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.63 1998/03/01 21:26:09 msmith Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.64 1998/03/03 02:50:24 msmith Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ /*- @@ -67,6 +67,7 @@ #include <vm/vm.h> #include <vm/vm_extern.h> #include <vm/vm_zone.h> +#include <vm/vnode_pager.h> #include <msdosfs/bpb.h> #include <msdosfs/direntry.h> @@ -98,6 +99,8 @@ static int msdosfs_bmap __P((struct vop_bmap_args *)); static int msdosfs_strategy __P((struct vop_strategy_args *)); static int msdosfs_print __P((struct vop_print_args *)); static int msdosfs_pathconf __P((struct vop_pathconf_args *ap)); +static int msdosfs_getpages __P((struct vop_getpages_args *)); +static int msdosfs_putpages __P((struct vop_putpages_args *)); /* * Some general notes: @@ -1928,6 +1931,34 @@ msdosfs_pathconf(ap) /* NOTREACHED */ } +/* + * get page routine + * + * XXX By default, wimp out... note that a_offset is ignored (and always + * XXX has been). + */ +int +msdosfs_getpages(ap) + struct vop_getpages_args *ap; +{ + return vnode_pager_generic_getpages(ap->a_vp, ap->a_m, ap->a_count, + ap->a_reqpage); +} + +/* + * put page routine + * + * XXX By default, wimp out... note that a_offset is ignored (and always + * XXX has been). + */ +int +msdosfs_putpages(ap) + struct vop_putpages_args *ap; +{ + return vnode_pager_generic_putpages(ap->a_vp, ap->a_m, ap->a_count, + ap->a_sync, ap->a_rtvals); +} + /* Global vfs data structures for msdosfs */ vop_t **msdosfs_vnodeop_p; static struct vnodeopv_entry_desc msdosfs_vnodeop_entries[] = { @@ -1960,6 +1991,8 @@ static struct vnodeopv_entry_desc msdosfs_vnodeop_entries[] = { { &vop_symlink_desc, (vop_t *) msdosfs_symlink }, { &vop_unlock_desc, (vop_t *) vop_stdunlock }, { &vop_write_desc, (vop_t *) msdosfs_write }, + { &vop_getpages_desc, (vop_t *) msdosfs_getpages }, + { &vop_putpages_desc, (vop_t *) msdosfs_putpages }, { NULL, NULL } }; static struct vnodeopv_desc msdosfs_vnodeop_opv_desc = diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c index 04d8288..a03b91b 100644 --- a/sys/nfs/nfs_bio.c +++ b/sys/nfs/nfs_bio.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_bio.c 8.9 (Berkeley) 3/30/95 - * $Id: nfs_bio.c,v 1.49 1998/02/04 22:33:13 eivind Exp $ + * $Id: nfs_bio.c,v 1.50 1998/02/06 12:13:55 eivind Exp $ */ @@ -115,6 +115,21 @@ nfs_getpages(ap) return 0; } + +/* + * put page routine + * + * XXX By default, wimp out... note that a_offset is ignored (and always + * XXX has been). + */ +int +nfs_putpages(ap) + struct vop_putpages_args *ap; +{ + return vnode_pager_generic_putpages(ap->a_vp, ap->a_m, ap->a_count, + ap->a_sync, ap->a_rtvals); +} + /* * Vnode op for read using bio * Any similarity to readip() is purely coincidental diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index ae49c58..60b8460 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95 - * $Id: nfs_vnops.c,v 1.77 1998/02/04 22:33:17 eivind Exp $ + * $Id: nfs_vnops.c,v 1.78 1998/02/06 12:13:58 eivind Exp $ */ @@ -144,6 +144,7 @@ static struct vnodeopv_entry_desc nfsv2_vnodeop_entries[] = { { &vop_fsync_desc, (vop_t *) nfs_fsync }, { &vop_getattr_desc, (vop_t *) nfs_getattr }, { &vop_getpages_desc, (vop_t *) nfs_getpages }, + { &vop_putpages_desc, (vop_t *) nfs_putpages }, { &vop_inactive_desc, (vop_t *) nfs_inactive }, { &vop_lease_desc, (vop_t *) vop_null }, { &vop_link_desc, (vop_t *) nfs_link }, diff --git a/sys/nfs/nfsnode.h b/sys/nfs/nfsnode.h index 6e04ed7..1f011fd 100644 --- a/sys/nfs/nfsnode.h +++ b/sys/nfs/nfsnode.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfsnode.h 8.9 (Berkeley) 5/14/95 - * $Id: nfsnode.h,v 1.23 1997/10/16 10:49:05 phk Exp $ + * $Id: nfsnode.h,v 1.24 1997/10/28 14:06:25 bde Exp $ */ @@ -162,6 +162,7 @@ extern vop_t **spec_nfsv2nodeop_p; * Prototypes for NFS vnode operations */ int nfs_getpages __P((struct vop_getpages_args *)); +int nfs_putpages __P((struct vop_putpages_args *)); int nfs_write __P((struct vop_write_args *)); int nqnfs_vop_lease_check __P((struct vop_lease_args *)); int nfs_abortop __P((struct vop_abortop_args *)); diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c index 04d8288..a03b91b 100644 --- a/sys/nfsclient/nfs_bio.c +++ b/sys/nfsclient/nfs_bio.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_bio.c 8.9 (Berkeley) 3/30/95 - * $Id: nfs_bio.c,v 1.49 1998/02/04 22:33:13 eivind Exp $ + * $Id: nfs_bio.c,v 1.50 1998/02/06 12:13:55 eivind Exp $ */ @@ -115,6 +115,21 @@ nfs_getpages(ap) return 0; } + +/* + * put page routine + * + * XXX By default, wimp out... note that a_offset is ignored (and always + * XXX has been). + */ +int +nfs_putpages(ap) + struct vop_putpages_args *ap; +{ + return vnode_pager_generic_putpages(ap->a_vp, ap->a_m, ap->a_count, + ap->a_sync, ap->a_rtvals); +} + /* * Vnode op for read using bio * Any similarity to readip() is purely coincidental diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index ae49c58..60b8460 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95 - * $Id: nfs_vnops.c,v 1.77 1998/02/04 22:33:17 eivind Exp $ + * $Id: nfs_vnops.c,v 1.78 1998/02/06 12:13:58 eivind Exp $ */ @@ -144,6 +144,7 @@ static struct vnodeopv_entry_desc nfsv2_vnodeop_entries[] = { { &vop_fsync_desc, (vop_t *) nfs_fsync }, { &vop_getattr_desc, (vop_t *) nfs_getattr }, { &vop_getpages_desc, (vop_t *) nfs_getpages }, + { &vop_putpages_desc, (vop_t *) nfs_putpages }, { &vop_inactive_desc, (vop_t *) nfs_inactive }, { &vop_lease_desc, (vop_t *) vop_null }, { &vop_link_desc, (vop_t *) nfs_link }, diff --git a/sys/nfsclient/nfsnode.h b/sys/nfsclient/nfsnode.h index 6e04ed7..1f011fd 100644 --- a/sys/nfsclient/nfsnode.h +++ b/sys/nfsclient/nfsnode.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfsnode.h 8.9 (Berkeley) 5/14/95 - * $Id: nfsnode.h,v 1.23 1997/10/16 10:49:05 phk Exp $ + * $Id: nfsnode.h,v 1.24 1997/10/28 14:06:25 bde Exp $ */ @@ -162,6 +162,7 @@ extern vop_t **spec_nfsv2nodeop_p; * Prototypes for NFS vnode operations */ int nfs_getpages __P((struct vop_getpages_args *)); +int nfs_putpages __P((struct vop_putpages_args *)); int nfs_write __P((struct vop_write_args *)); int nqnfs_vop_lease_check __P((struct vop_lease_args *)); int nfs_abortop __P((struct vop_abortop_args *)); |