svn commit: r297896 - in projects/pnfs-server/sys/fs: fuse nfs
Rick Macklem
rmacklem at FreeBSD.org
Wed Apr 13 00:10:43 UTC 2016
Author: rmacklem
Date: Wed Apr 13 00:10:42 2016
New Revision: 297896
URL: https://svnweb.freebsd.org/changeset/base/297896
Log:
Fix the build by replacing fuse_getpages with the current one and
fixing the nfscl_getmyip() definition.
Modified:
projects/pnfs-server/sys/fs/fuse/fuse_vnops.c
projects/pnfs-server/sys/fs/nfs/nfs_var.h
Modified: projects/pnfs-server/sys/fs/fuse/fuse_vnops.c
==============================================================================
--- projects/pnfs-server/sys/fs/fuse/fuse_vnops.c Tue Apr 12 23:38:10 2016 (r297895)
+++ projects/pnfs-server/sys/fs/fuse/fuse_vnops.c Wed Apr 13 00:10:42 2016 (r297896)
@@ -1897,35 +1897,24 @@ fuse_vnop_getpages(struct vop_getpages_a
td = curthread; /* XXX */
cred = curthread->td_ucred; /* XXX */
pages = ap->a_m;
- count = ap->a_count;
+ npages = ap->a_count;
if (!fsess_opt_mmap(vnode_mount(vp))) {
FS_DEBUG("called on non-cacheable vnode??\n");
return (VM_PAGER_ERROR);
}
- npages = btoc(count);
/*
- * If the requested page is partially valid, just return it and
- * allow the pager to zero-out the blanks. Partially valid pages
- * can only occur at the file EOF.
+ * If the last page is partially valid, just return it and allow
+ * the pager to zero-out the blanks. Partially valid pages can
+ * only occur at the file EOF.
+ *
+ * XXXGL: is that true for FUSE, which is a local filesystem,
+ * but still somewhat disconnected from the kernel?
*/
-
VM_OBJECT_WLOCK(vp->v_object);
- fuse_vm_page_lock_queues();
- if (pages[ap->a_reqpage]->valid != 0) {
- for (i = 0; i < npages; ++i) {
- if (i != ap->a_reqpage) {
- fuse_vm_page_lock(pages[i]);
- vm_page_free(pages[i]);
- fuse_vm_page_unlock(pages[i]);
- }
- }
- fuse_vm_page_unlock_queues();
- VM_OBJECT_WUNLOCK(vp->v_object);
- return 0;
- }
- fuse_vm_page_unlock_queues();
+ if (pages[npages - 1]->valid != 0 && --npages == 0)
+ goto out;
VM_OBJECT_WUNLOCK(vp->v_object);
/*
@@ -1939,6 +1928,7 @@ fuse_vnop_getpages(struct vop_getpages_a
PCPU_INC(cnt.v_vnodein);
PCPU_ADD(cnt.v_vnodepgsin, npages);
+ count = npages << PAGE_SHIFT;
iov.iov_base = (caddr_t)kva;
iov.iov_len = count;
uio.uio_iov = &iov;
@@ -1956,17 +1946,6 @@ fuse_vnop_getpages(struct vop_getpages_a
if (error && (uio.uio_resid == count)) {
FS_DEBUG("error %d\n", error);
- VM_OBJECT_WLOCK(vp->v_object);
- fuse_vm_page_lock_queues();
- for (i = 0; i < npages; ++i) {
- if (i != ap->a_reqpage) {
- fuse_vm_page_lock(pages[i]);
- vm_page_free(pages[i]);
- fuse_vm_page_unlock(pages[i]);
- }
- }
- fuse_vm_page_unlock_queues();
- VM_OBJECT_WUNLOCK(vp->v_object);
return VM_PAGER_ERROR;
}
/*
@@ -2007,12 +1986,15 @@ fuse_vnop_getpages(struct vop_getpages_a
*/
;
}
- if (i != ap->a_reqpage)
- vm_page_readahead_finish(m);
}
fuse_vm_page_unlock_queues();
+out:
VM_OBJECT_WUNLOCK(vp->v_object);
- return 0;
+ if (ap->a_rbehind)
+ *ap->a_rbehind = 0;
+ if (ap->a_rahead)
+ *ap->a_rahead = 0;
+ return (VM_PAGER_OK);
}
/*
Modified: projects/pnfs-server/sys/fs/nfs/nfs_var.h
==============================================================================
--- projects/pnfs-server/sys/fs/nfs/nfs_var.h Tue Apr 12 23:38:10 2016 (r297895)
+++ projects/pnfs-server/sys/fs/nfs/nfs_var.h Wed Apr 13 00:10:42 2016 (r297896)
@@ -321,7 +321,7 @@ void nfscl_reqstart(struct nfsrv_descrip
nfsuint64 *nfscl_getcookie(struct nfsnode *, off_t off, int);
void nfscl_fillsattr(struct nfsrv_descript *, struct vattr *,
vnode_t, int, u_int32_t);
-u_int8_t *nfscl_getmyip(struct nfsmount *, int *);
+u_int8_t *nfscl_getmyip(struct nfsmount *, struct in6_addr *, int *);
int nfsm_getfh(struct nfsrv_descript *, struct nfsfh **);
int nfscl_mtofh(struct nfsrv_descript *, struct nfsfh **,
struct nfsvattr *, int *);
More information about the svn-src-projects
mailing list