Date: Fri, 13 Aug 2004 15:53:27 +0200 From: "Poul-Henning Kamp" <phk@phk.freebsd.dk> To: arch@freebsd.org Subject: Re: PERFORCE change 59573 for review Message-ID: <62348.1092405207@critter.freebsd.dk> In-Reply-To: Your message of "Fri, 13 Aug 2004 13:49:36 GMT." <200408131349.i7DDnaJY086691@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Can anybody shed light on this one ? In message <200408131349.i7DDnaJY086691@repoman.freebsd.org>, Poul-Henning Kamp writes: >http://perforce.freebsd.org/chv.cgi?CH=59573 > >Change 59573 by phk@phk_bang on 2004/08/13 13:48:38 > > Bring back the first chunk of ffs_getpages(). > > FFS cannot run with straight vnode_pager_generic_getpages() > and I suspect that means that the first code in ffs_getpages > really belong in vnode_pager_generic_getpages() where other > filesystems would benefit as well, rather than being private > to FFS. > >Affected files ... > >.. //depot/user/phk/phk_bufwork/sys/ufs/ffs/ffs_vnops.c#13 edit > >Differences ... > >==== //depot/user/phk/phk_bufwork/sys/ufs/ffs/ffs_vnops.c#13 (text+ko) ==== > >@@ -81,6 +81,7 @@ > extern int ffs_rawread(struct vnode *vp, struct uio *uio, int *workdone); > #endif > static int ffs_fsync(struct vop_fsync_args *); >+static int ffs_getpages(struct vop_getpages_args *); > static int ffs_read(struct vop_read_args *); > static int ffs_write(struct vop_write_args *); > static int ffs_extread(struct vnode *vp, struct uio *uio, int ioflag); >@@ -100,6 +101,7 @@ > static struct vnodeopv_entry_desc ffs_vnodeop_entries[] = { > { &vop_default_desc, (vop_t *) ufs_vnoperate }, > { &vop_fsync_desc, (vop_t *) ffs_fsync }, >+ { &vop_getpages_desc, (vop_t *) ffs_getpages }, > { &vop_read_desc, (vop_t *) ffs_read }, > { &vop_reallocblks_desc, (vop_t *) ffs_reallocblks }, > { &vop_write_desc, (vop_t *) ffs_write }, >@@ -712,6 +714,50 @@ > } > > /* >+ * get page routine >+ */ >+static int >+ffs_getpages(ap) >+ struct vop_getpages_args *ap; >+{ >+ int i; >+ vm_page_t mreq; >+ int pcount; >+ >+ GIANT_REQUIRED; >+ >+ pcount = round_page(ap->a_count) / PAGE_SIZE; >+ mreq = ap->a_m[ap->a_reqpage]; >+ >+ /* >+ * if ANY DEV_BSIZE blocks are valid on a large filesystem block, >+ * then the entire page is valid. Since the page may be mapped, >+ * user programs might reference data beyond the actual end of file >+ * occuring within the page. We have to zero that data. >+ */ >+ VM_OBJECT_LOCK(mreq->object); >+ if (mreq->valid) { >+ if (mreq->valid != VM_PAGE_BITS_ALL) >+ vm_page_zero_invalid(mreq, TRUE); >+ vm_page_lock_queues(); >+ for (i = 0; i < pcount; i++) { >+ if (i != ap->a_reqpage) { >+ vm_page_free(ap->a_m[i]); >+ } >+ } >+ vm_page_unlock_queues(); >+ VM_OBJECT_UNLOCK(mreq->object); >+ return VM_PAGER_OK; >+ } >+ VM_OBJECT_UNLOCK(mreq->object); >+ >+ return vnode_pager_generic_getpages(ap->a_vp, ap->a_m, >+ ap->a_count, >+ ap->a_reqpage); >+} >+ >+ >+/* > * Extended attribute area reading. > */ > static int > -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?62348.1092405207>