diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index bc59b44fd53a..1ed074f41ddb 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -929,7 +929,7 @@ msdosfs_fhtovp(mp, fhp, vpp) return (error); } *vpp = DETOV(dep); - vnode_create_vobject(*vpp, dep->de_FileSize, curthread); + vnode_create_vobject_off(*vpp, dep->de_FileSize, curthread); return (0); } diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 5c85b9204cc2..ec34ab7e54d8 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -221,7 +221,7 @@ msdosfs_open(ap) } */ *ap; { struct denode *dep = VTODE(ap->a_vp); - vnode_create_vobject(ap->a_vp, dep->de_FileSize, ap->a_td); + vnode_create_vobject_off(ap->a_vp, dep->de_FileSize, ap->a_td); return 0; } diff --git a/sys/fs/ntfs/ntfs_vfsops.c b/sys/fs/ntfs/ntfs_vfsops.c index cfa70a36faa6..5200440ed5f0 100644 --- a/sys/fs/ntfs/ntfs_vfsops.c +++ b/sys/fs/ntfs/ntfs_vfsops.c @@ -621,7 +621,7 @@ ntfs_fhtovp( /* XXX as unlink/rmdir/mkdir/creat are not currently possible * with NTFS, we don't need to check anything else for now */ *vpp = nvp; - vnode_create_vobject(nvp, VTOF(nvp)->f_size, curthread); + vnode_create_vobject_off(nvp, VTOF(nvp)->f_size, curthread); return (0); } diff --git a/sys/fs/ntfs/ntfs_vnops.c b/sys/fs/ntfs/ntfs_vnops.c index 48db359af248..981323f8deb5 100644 --- a/sys/fs/ntfs/ntfs_vnops.c +++ b/sys/fs/ntfs/ntfs_vnops.c @@ -441,7 +441,7 @@ ntfs_open(ap) printf("ntfs_open: %d\n",ip->i_number); #endif - vnode_create_vobject(ap->a_vp, VTOF(ap->a_vp)->f_size, ap->a_td); + vnode_create_vobject_off(ap->a_vp, VTOF(ap->a_vp)->f_size, ap->a_td); /* * Files marked append-only must be opened for appending. diff --git a/sys/fs/smbfs/smbfs_vnops.c b/sys/fs/smbfs/smbfs_vnops.c index d741c060e229..9a860ba8891d 100644 --- a/sys/fs/smbfs/smbfs_vnops.c +++ b/sys/fs/smbfs/smbfs_vnops.c @@ -214,7 +214,7 @@ smbfs_open(ap) } if (error == 0) { np->n_flag |= NOPEN; - vnode_create_vobject(ap->a_vp, vattr.va_size, ap->a_td); + vnode_create_vobject_off(ap->a_vp, vattr.va_size, ap->a_td); } smbfs_attr_cacheremove(vp); return error; diff --git a/sys/fs/udf/udf_vfsops.c b/sys/fs/udf/udf_vfsops.c index 2b97c30fbbaa..df2f41cb0f06 100644 --- a/sys/fs/udf/udf_vfsops.c +++ b/sys/fs/udf/udf_vfsops.c @@ -692,7 +692,7 @@ udf_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp) } *vpp = nvp; - vnode_create_vobject(*vpp, 0, curthread); + vnode_create_vobject_off(*vpp, 0, curthread); return (0); } diff --git a/sys/geom/geom_vfs.c b/sys/geom/geom_vfs.c index d8f6c1d02494..3e41712f92f6 100644 --- a/sys/geom/geom_vfs.c +++ b/sys/geom/geom_vfs.c @@ -147,7 +147,7 @@ g_vfs_open(struct vnode *vp, struct g_consumer **cpp, const char *fsname, int wr g_wither_geom(gp, ENXIO); return (error); } - vnode_create_vobject(vp, pp->mediasize, curthread); + vnode_create_vobject_off(vp, pp->mediasize, curthread); *cpp = cp; bo = &vp->v_bufobj; bo->bo_ops = g_vfs_bufops; diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c index 3434a0e686d1..0a288cd8679b 100644 --- a/sys/gnu/fs/ext2fs/ext2_vfsops.c +++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c @@ -1085,7 +1085,7 @@ ext2_fhtovp(mp, fhp, vpp) return (ESTALE); } *vpp = nvp; - vnode_create_vobject(*vpp, 0, curthread); + vnode_create_vobject_off(*vpp, 0, curthread); return (0); } diff --git a/sys/gnu/fs/ext2fs/ext2_vnops.c b/sys/gnu/fs/ext2fs/ext2_vnops.c index c755f66ed2f6..2ec956443f23 100644 --- a/sys/gnu/fs/ext2fs/ext2_vnops.c +++ b/sys/gnu/fs/ext2fs/ext2_vnops.c @@ -255,7 +255,7 @@ ext2_open(ap) (ap->a_mode & (FWRITE | O_APPEND)) == FWRITE) return (EPERM); - vnode_create_vobject(ap->a_vp, VTOI(ap->a_vp)->i_size, ap->a_td); + vnode_create_vobject_off(ap->a_vp, VTOI(ap->a_vp)->i_size, ap->a_td); return (0); } diff --git a/sys/gnu/fs/reiserfs/reiserfs_vnops.c b/sys/gnu/fs/reiserfs/reiserfs_vnops.c index 9b0ba7d2e509..732fdc7436de 100644 --- a/sys/gnu/fs/reiserfs/reiserfs_vnops.c +++ b/sys/gnu/fs/reiserfs/reiserfs_vnops.c @@ -154,7 +154,7 @@ reiserfs_open(struct vop_open_args *ap) (ap->a_mode & (FWRITE | O_APPEND)) == FWRITE) return (EPERM); - vnode_create_vobject(ap->a_vp, VTOI(ap->a_vp)->i_size, ap->a_td); + vnode_create_vobject_off(ap->a_vp, VTOI(ap->a_vp)->i_size, ap->a_td); return (0); } diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c index cd7e375617e1..6b022aa09f9e 100644 --- a/sys/isofs/cd9660/cd9660_vfsops.c +++ b/sys/isofs/cd9660/cd9660_vfsops.c @@ -618,7 +618,7 @@ cd9660_fhtovp(mp, fhp, vpp) return (ESTALE); } *vpp = nvp; - vnode_create_vobject(*vpp, ip->i_size, curthread); + vnode_create_vobject_off(*vpp, ip->i_size, curthread); return (0); } diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c index 3e670002a2ee..23055cd703da 100644 --- a/sys/isofs/cd9660/cd9660_vnops.c +++ b/sys/isofs/cd9660/cd9660_vnops.c @@ -170,7 +170,7 @@ cd9660_open(ap) { struct iso_node *ip = VTOI(ap->a_vp); - vnode_create_vobject(ap->a_vp, ip->i_size, ap->a_td); + vnode_create_vobject_off(ap->a_vp, ip->i_size, ap->a_td); return 0; } diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index 151f85c5a3f1..5ba9507718ed 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -466,7 +466,7 @@ nfs_open(struct vop_open_args *ap) np->n_directio_opens++; } np->ra_expect_lbn = 0; - vnode_create_vobject(vp, vattr.va_size, ap->a_td); + vnode_create_vobject_off(vp, vattr.va_size, ap->a_td); return (0); } diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 139b0b011756..1e7ce8fee44d 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -716,6 +716,7 @@ int vrefcnt(struct vnode *vp); void v_addpollinfo(struct vnode *vp); int vnode_create_vobject(struct vnode *vp, size_t size, struct thread *td); +int vnode_create_vobject_off(struct vnode *vp, off_t size, struct thread *td); void vnode_destroy_vobject(struct vnode *vp); extern struct vop_vector fifo_specops; diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c index 75b1d0d0b17d..2265a1b543d0 100644 --- a/sys/ufs/ufs/ufs_vfsops.c +++ b/sys/ufs/ufs/ufs_vfsops.c @@ -205,6 +205,6 @@ ufs_fhtovp(mp, ufhp, vpp) return (ESTALE); } *vpp = nvp; - vnode_create_vobject(*vpp, DIP(ip, i_size), curthread); + vnode_create_vobject_off(*vpp, DIP(ip, i_size), curthread); return (0); } diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 3047e4f7efbf..861f6600405d 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -245,7 +245,7 @@ ufs_open(struct vop_open_args *ap) if ((ip->i_flags & APPEND) && (ap->a_mode & (FWRITE | O_APPEND)) == FWRITE) return (EPERM); - vnode_create_vobject(vp, DIP(ip, i_size), ap->a_td); + vnode_create_vobject_off(vp, DIP(ip, i_size), ap->a_td); return (0); } diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index e6ac5bbe43be..7b81d7e6d047 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -95,9 +95,30 @@ struct pagerops vnodepagerops = { int vnode_pbuf_freecnt; -/* Create the VM system backing object for this vnode */ +/* + * Compatibility function for RELENG_6, in which vnode_create_vobject() + * takes file size as size_t due to an oversight. The type may not just + * change to off_t because the ABI to 3rd party modules must be preserved + * for RELENG_6 lifetime. + */ int -vnode_create_vobject(struct vnode *vp, size_t isize, struct thread *td) +vnode_create_vobject(struct vnode *vp, size_t isize __unused, struct thread *td) +{ + + /* + * Size of 0 will indicate to vnode_create_vobject_off() + * VOP_GETATTR() is to be called to get the actual size. + */ + return (vnode_create_vobject_off(vp, 0, td)); +} + +/* + * Create the VM system backing object for this vnode -- for RELENG_6 only. + * In HEAD, vnode_create_vobject() has been fixed to take file size as off_t + * and so it can be used as is. + */ +int +vnode_create_vobject_off(struct vnode *vp, off_t isize, struct thread *td) { vm_object_t object; vm_ooffset_t size = isize;