Date: Thu, 30 May 2013 16:51:48 +0000 (UTC) From: Scott Long <scottl@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251144 - in stable/9/sys: fs/udf kern sys ufs/ffs Message-ID: <201305301651.r4UGpms6066966@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: scottl Date: Thu May 30 16:51:48 2013 New Revision: 251144 URL: http://svnweb.freebsd.org/changeset/base/251144 Log: MFC r248282, in a modified fashion. From the original changelog: Add currently unused flag argument to the cluster_read(), cluster_write() and cluster_wbuild() functions. The flags to be allowed are a subset of the GB_* flags for getblk(). This merge adds a cluster_*_gb() API variant instead of changing the ABI with an added argument to the existing API. Most API consumers that were changed in the original rev have been left un-changed in this merge to reduce churn. The mergeinfo is recorded though for future merging convenience. This is effectively a no-op for the moment. Submitted by: kib, FF Obtained from: Netflix Modified: stable/9/sys/fs/udf/udf_vnops.c stable/9/sys/kern/vfs_bio.c stable/9/sys/kern/vfs_cluster.c stable/9/sys/sys/buf.h stable/9/sys/ufs/ffs/ffs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/9/sys/fs/udf/udf_vnops.c Thu May 30 16:16:28 2013 (r251143) +++ stable/9/sys/fs/udf/udf_vnops.c Thu May 30 16:51:48 2013 (r251144) @@ -479,8 +479,9 @@ udf_read(struct vop_read_args *ap) rablock = lbn + 1; if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) { if (lblktosize(udfmp, rablock) < fsize) { - error = cluster_read(vp, fsize, lbn, size, NOCRED, - uio->uio_resid, (ap->a_ioflag >> 16), &bp); + error = cluster_read(vp, fsize, lbn, size, + NOCRED, uio->uio_resid, + (ap->a_ioflag >> 16), &bp); } else { error = bread(vp, lbn, size, NOCRED, &bp); } Modified: stable/9/sys/kern/vfs_bio.c ============================================================================== --- stable/9/sys/kern/vfs_bio.c Thu May 30 16:16:28 2013 (r251143) +++ stable/9/sys/kern/vfs_bio.c Thu May 30 16:51:48 2013 (r251144) @@ -1830,7 +1830,7 @@ vfs_bio_awrite(struct buf *bp) if (ncl != 1) { BUF_UNLOCK(bp); nwritten = cluster_wbuild(vp, size, lblkno - j, ncl); - return nwritten; + return (nwritten); } } bremfree(bp); Modified: stable/9/sys/kern/vfs_cluster.c ============================================================================== --- stable/9/sys/kern/vfs_cluster.c Thu May 30 16:16:28 2013 (r251143) +++ stable/9/sys/kern/vfs_cluster.c Thu May 30 16:51:48 2013 (r251144) @@ -87,15 +87,18 @@ extern vm_page_t bogus_page; * cluster_read replaces bread. */ int -cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp) - struct vnode *vp; - u_quad_t filesize; - daddr_t lblkno; - long size; - struct ucred *cred; - long totread; - int seqcount; - struct buf **bpp; +cluster_read(struct vnode *vp, u_quad_t filesize, daddr_t lblkno, long size, + struct ucred *cred, long totread, int seqcount, struct buf **bpp) +{ + + return (cluster_read_gb(vp, filesize, lblkno, size, cred, totread, + seqcount, 0, bpp)); +} + +int +cluster_read_gb(struct vnode *vp, u_quad_t filesize, daddr_t lblkno, long size, + struct ucred *cred, long totread, int seqcount, int gbflags, + struct buf **bpp) { struct buf *bp, *rbp, *reqbp; struct bufobj *bo; @@ -610,6 +613,14 @@ cluster_wbuild_wb(struct vnode *vp, long void cluster_write(struct vnode *vp, struct buf *bp, u_quad_t filesize, int seqcount) { + + cluster_write_gb(vp, bp, filesize, seqcount, 0); +} + +void +cluster_write_gb(struct vnode *vp, struct buf *bp, u_quad_t filesize, + int seqcount, int gbflags) +{ daddr_t lbn; int maxclen, cursize; int lblocksize; @@ -754,11 +765,15 @@ cluster_write(struct vnode *vp, struct b * the current block (if last_bp == NULL). */ int -cluster_wbuild(vp, size, start_lbn, len) - struct vnode *vp; - long size; - daddr_t start_lbn; - int len; +cluster_wbuild(struct vnode *vp, long size, daddr_t start_lbn, int len) +{ + + return (cluster_wbuild_gb(vp, size, start_lbn, len, 0)); +} + +int +cluster_wbuild_gb(struct vnode *vp, long size, daddr_t start_lbn, int len, + int gbflags) { struct buf *bp, *tbp; struct bufobj *bo; Modified: stable/9/sys/sys/buf.h ============================================================================== --- stable/9/sys/sys/buf.h Thu May 30 16:16:28 2013 (r251143) +++ stable/9/sys/sys/buf.h Thu May 30 16:51:48 2013 (r251144) @@ -514,6 +514,10 @@ int cluster_read(struct vnode *, u_quad_ struct ucred *, long, int, struct buf **); int cluster_wbuild(struct vnode *, long, daddr_t, int); void cluster_write(struct vnode *, struct buf *, u_quad_t, int); +int cluster_read_gb(struct vnode *, u_quad_t, daddr_t, long, + struct ucred *, long, int, int, struct buf **); +int cluster_wbuild_gb(struct vnode *, long, daddr_t, int, int); +void cluster_write_gb(struct vnode *, struct buf *, u_quad_t, int, int); void vfs_bio_set_valid(struct buf *, int base, int size); void vfs_bio_clrbuf(struct buf *); void vfs_busy_pages(struct buf *, int clear_modify); Modified: stable/9/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_vnops.c Thu May 30 16:16:28 2013 (r251143) +++ stable/9/sys/ufs/ffs/ffs_vnops.c Thu May 30 16:51:48 2013 (r251144) @@ -518,7 +518,8 @@ ffs_read(ap) * doing sequential access. */ error = cluster_read(vp, ip->i_size, lbn, - size, NOCRED, blkoffset + uio->uio_resid, seqcount, &bp); + size, NOCRED, blkoffset + uio->uio_resid, + seqcount, &bp); } else if (seqcount > 1) { /* * If we are NOT allowed to cluster, then
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305301651.r4UGpms6066966>