Author: asomers
Date: Sun Jun 23 14:49:30 2019
New Revision: 349308
URL: https://svnweb.freebsd.org/changeset/base/349308

Log:
  MFC r348251:
  
  Remove "struct ucred*" argument from vtruncbuf
  
  vtruncbuf takes a "struct ucred*" argument. AFAICT, it's been unused ever
  since that function was first added in r34611. Remove it.  Also, remove some
  "struct ucred" arguments from fuse and nfs functions that were only used by
  vtruncbuf.
  
  Reviewed by:  cem
  Sponsored by: The FreeBSD Foundation
  Differential Revision:        https://reviews.freebsd.org/D20377

Modified:
  stable/11/sys/fs/ext2fs/ext2_inode.c
  stable/11/sys/fs/fuse/fuse_io.c
  stable/11/sys/fs/fuse/fuse_node.c
  stable/11/sys/fs/fuse/fuse_node.h
  stable/11/sys/fs/fuse/fuse_vnops.c
  stable/11/sys/fs/msdosfs/msdosfs_denode.c
  stable/11/sys/fs/nfsclient/nfs.h
  stable/11/sys/fs/nfsclient/nfs_clbio.c
  stable/11/sys/fs/nfsclient/nfs_clvnops.c
  stable/11/sys/kern/vfs_subr.c
  stable/11/sys/sys/vnode.h
  stable/11/sys/ufs/ffs/ffs_inode.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/ext2fs/ext2_inode.c
==============================================================================
--- stable/11/sys/fs/ext2fs/ext2_inode.c        Sun Jun 23 13:44:06 2019        
(r349307)
+++ stable/11/sys/fs/ext2fs/ext2_inode.c        Sun Jun 23 14:49:30 2019        
(r349308)
@@ -263,7 +263,7 @@ ext2_truncate(struct vnode *vp, off_t length, int flag
                oip->i_ib[i] = oldblks[NDADDR + i];
        }
        oip->i_size = osize;
-       error = vtruncbuf(ovp, cred, length, (int)fs->e2fs_bsize);
+       error = vtruncbuf(ovp, length, (int)fs->e2fs_bsize);
        if (error && (allerror == 0))
                allerror = error;
        vnode_pager_setsize(ovp, length);

Modified: stable/11/sys/fs/fuse/fuse_io.c
==============================================================================
--- stable/11/sys/fs/fuse/fuse_io.c     Sun Jun 23 13:44:06 2019        
(r349307)
+++ stable/11/sys/fs/fuse/fuse_io.c     Sun Jun 23 14:49:30 2019        
(r349308)
@@ -361,7 +361,7 @@ fuse_write_directbackend(struct vnode *vp, struct uio 
                uio->uio_resid += diff;
                uio->uio_offset -= diff;
                if (uio->uio_offset > fvdat->filesize)
-                       fuse_vnode_setsize(vp, cred, uio->uio_offset);
+                       fuse_vnode_setsize(vp, uio->uio_offset);
        }
 
        fdisp_destroy(&fdi);
@@ -433,7 +433,7 @@ again:
                        if (bp != NULL) {
                                long save;
 
-                               err = fuse_vnode_setsize(vp, cred, 
+                               err = fuse_vnode_setsize(vp,
                                                         uio->uio_offset + n);
                                if (err) {
                                        brelse(bp);
@@ -460,7 +460,7 @@ again:
                        FS_DEBUG("getting block from OS, bcount %d\n", bcount);
                        bp = getblk(vp, lbn, bcount, PCATCH, 0, 0);
                        if (bp && uio->uio_offset + n > fvdat->filesize) {
-                               err = fuse_vnode_setsize(vp, cred, 
+                               err = fuse_vnode_setsize(vp,
                                                         uio->uio_offset + n);
                                if (err) {
                                        brelse(bp);

Modified: stable/11/sys/fs/fuse/fuse_node.c
==============================================================================
--- stable/11/sys/fs/fuse/fuse_node.c   Sun Jun 23 13:44:06 2019        
(r349307)
+++ stable/11/sys/fs/fuse/fuse_node.c   Sun Jun 23 14:49:30 2019        
(r349308)
@@ -366,7 +366,7 @@ fuse_vnode_refreshsize(struct vnode *vp, struct ucred 
 }
 
 int
-fuse_vnode_setsize(struct vnode *vp, struct ucred *cred, off_t newsize)
+fuse_vnode_setsize(struct vnode *vp, off_t newsize)
 {
        struct fuse_vnode_data *fvdat = VTOFUD(vp);
        off_t oldsize;
@@ -382,7 +382,7 @@ fuse_vnode_setsize(struct vnode *vp, struct ucred *cre
        fvdat->flag |= FN_SIZECHANGE;
 
        if (newsize < oldsize) {
-               err = vtruncbuf(vp, cred, newsize, fuse_iosize(vp));
+               err = vtruncbuf(vp, newsize, fuse_iosize(vp));
        }
        vnode_pager_setsize(vp, newsize);
        return err;

Modified: stable/11/sys/fs/fuse/fuse_node.h
==============================================================================
--- stable/11/sys/fs/fuse/fuse_node.h   Sun Jun 23 13:44:06 2019        
(r349307)
+++ stable/11/sys/fs/fuse/fuse_node.h   Sun Jun 23 14:49:30 2019        
(r349308)
@@ -126,6 +126,6 @@ void fuse_vnode_refreshsize(struct vnode *vp, struct u
 
 int fuse_vnode_savesize(struct vnode *vp, struct ucred *cred);
 
-int fuse_vnode_setsize(struct vnode *vp, struct ucred *cred, off_t newsize);
+int fuse_vnode_setsize(struct vnode *vp, off_t newsize);
 
 #endif /* _FUSE_NODE_H_ */

Modified: stable/11/sys/fs/fuse/fuse_vnops.c
==============================================================================
--- stable/11/sys/fs/fuse/fuse_vnops.c  Sun Jun 23 13:44:06 2019        
(r349307)
+++ stable/11/sys/fs/fuse/fuse_vnops.c  Sun Jun 23 14:49:30 2019        
(r349308)
@@ -536,7 +536,7 @@ fuse_vnop_getattr(struct vop_getattr_args *ap)
                                      fdi.answ)->attr.size;
 
                if (fvdat->filesize != new_filesize) {
-                       fuse_vnode_setsize(vp, cred, new_filesize);
+                       fuse_vnode_setsize(vp, new_filesize);
                }
        }
        debug_printf("fuse_getattr e: returning 0\n");
@@ -1648,7 +1648,7 @@ fuse_vnop_setattr(struct vop_setattr_args *ap)
 out:
        fdisp_destroy(&fdi);
        if (!err && sizechanged) {
-               fuse_vnode_setsize(vp, cred, newsize);
+               fuse_vnode_setsize(vp, newsize);
                VTOFUD(vp)->flag &= ~FN_SIZECHANGE;
        }
        return err;

Modified: stable/11/sys/fs/msdosfs/msdosfs_denode.c
==============================================================================
--- stable/11/sys/fs/msdosfs/msdosfs_denode.c   Sun Jun 23 13:44:06 2019        
(r349307)
+++ stable/11/sys/fs/msdosfs/msdosfs_denode.c   Sun Jun 23 14:49:30 2019        
(r349308)
@@ -427,7 +427,7 @@ detrunc(struct denode *dep, u_long length, int flags, 
        dep->de_FileSize = length;
        if (!isadir)
                dep->de_flag |= DE_UPDATE | DE_MODIFIED;
-       allerror = vtruncbuf(DETOV(dep), cred, length, pmp->pm_bpcluster);
+       allerror = vtruncbuf(DETOV(dep), length, pmp->pm_bpcluster);
 #ifdef MSDOSFS_DEBUG
        if (allerror)
                printf("detrunc(): vtruncbuf error %d\n", allerror);

Modified: stable/11/sys/fs/nfsclient/nfs.h
==============================================================================
--- stable/11/sys/fs/nfsclient/nfs.h    Sun Jun 23 13:44:06 2019        
(r349307)
+++ stable/11/sys/fs/nfsclient/nfs.h    Sun Jun 23 14:49:30 2019        
(r349308)
@@ -89,8 +89,7 @@ enum nfsiod_state {
 /*
  * Function prototypes.
  */
-int ncl_meta_setsize(struct vnode *, struct ucred *, struct thread *,
-    u_quad_t);
+int ncl_meta_setsize(struct vnode *, struct thread *, u_quad_t);
 void ncl_doio_directwrite(struct buf *);
 int ncl_bioread(struct vnode *, struct uio *, int, struct ucred *);
 int ncl_biowrite(struct vnode *, struct uio *, int, struct ucred *);

Modified: stable/11/sys/fs/nfsclient/nfs_clbio.c
==============================================================================
--- stable/11/sys/fs/nfsclient/nfs_clbio.c      Sun Jun 23 13:44:06 2019        
(r349307)
+++ stable/11/sys/fs/nfsclient/nfs_clbio.c      Sun Jun 23 14:49:30 2019        
(r349308)
@@ -1830,7 +1830,7 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucre
  */
 
 int
-ncl_meta_setsize(struct vnode *vp, struct ucred *cred, struct thread *td, 
u_quad_t nsize)
+ncl_meta_setsize(struct vnode *vp, struct thread *td, u_quad_t nsize)
 {
        struct nfsnode *np = VTONFS(vp);
        u_quad_t tsize;
@@ -1852,7 +1852,7 @@ ncl_meta_setsize(struct vnode *vp, struct ucred *cred,
                 * truncation point.  We may have a B_DELWRI and/or B_CACHE
                 * buffer that now needs to be truncated.
                 */
-               error = vtruncbuf(vp, cred, nsize, biosize);
+               error = vtruncbuf(vp, nsize, biosize);
                lbn = nsize / biosize;
                bufsize = nsize - (lbn * biosize);
                bp = nfs_getcacheblk(vp, lbn, bufsize, td);

Modified: stable/11/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- stable/11/sys/fs/nfsclient/nfs_clvnops.c    Sun Jun 23 13:44:06 2019        
(r349307)
+++ stable/11/sys/fs/nfsclient/nfs_clvnops.c    Sun Jun 23 14:49:30 2019        
(r349308)
@@ -929,8 +929,7 @@ nfs_setattr(struct vop_setattr_args *ap)
                        mtx_lock(&np->n_mtx);
                        tsize = np->n_size;
                        mtx_unlock(&np->n_mtx);
-                       error = ncl_meta_setsize(vp, ap->a_cred, td,
-                           vap->va_size);
+                       error = ncl_meta_setsize(vp, td, vap->va_size);
                        mtx_lock(&np->n_mtx);
                        if (np->n_flag & NMODIFIED) {
                            tsize = np->n_size;

Modified: stable/11/sys/kern/vfs_subr.c
==============================================================================
--- stable/11/sys/kern/vfs_subr.c       Sun Jun 23 13:44:06 2019        
(r349307)
+++ stable/11/sys/kern/vfs_subr.c       Sun Jun 23 14:49:30 2019        
(r349308)
@@ -1787,15 +1787,15 @@ again:
  * sync activity.
  */
 int
-vtruncbuf(struct vnode *vp, struct ucred *cred, off_t length, int blksize)
+vtruncbuf(struct vnode *vp, off_t length, int blksize)
 {
        struct buf *bp, *nbp;
        int anyfreed;
        daddr_t trunclbn;
        struct bufobj *bo;
 
-       CTR5(KTR_VFS, "%s: vp %p with cred %p and block %d:%ju", __func__,
-           vp, cred, blksize, (uintmax_t)length);
+       CTR4(KTR_VFS, "%s: vp %p with block %d:%ju", __func__,
+           vp, blksize, (uintmax_t)length);
 
        /*
         * Round up to the *next* lbn.

Modified: stable/11/sys/sys/vnode.h
==============================================================================
--- stable/11/sys/sys/vnode.h   Sun Jun 23 13:44:06 2019        (r349307)
+++ stable/11/sys/sys/vnode.h   Sun Jun 23 14:49:30 2019        (r349308)
@@ -673,8 +673,7 @@ void        vgone(struct vnode *vp);
 void   _vhold(struct vnode *, bool);
 void   vinactive(struct vnode *, struct thread *);
 int    vinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo);
-int    vtruncbuf(struct vnode *vp, struct ucred *cred, off_t length,
-           int blksize);
+int    vtruncbuf(struct vnode *vp, off_t length, int blksize);
 void   vunref(struct vnode *);
 void   vn_printf(struct vnode *vp, const char *fmt, ...) __printflike(2,3);
 int    vrecycle(struct vnode *vp);

Modified: stable/11/sys/ufs/ffs/ffs_inode.c
==============================================================================
--- stable/11/sys/ufs/ffs/ffs_inode.c   Sun Jun 23 13:44:06 2019        
(r349307)
+++ stable/11/sys/ufs/ffs/ffs_inode.c   Sun Jun 23 14:49:30 2019        
(r349308)
@@ -497,7 +497,7 @@ ffs_truncate(vp, length, flags, cred)
        ip->i_size = osize;
        DIP_SET(ip, i_size, osize);
 
-       error = vtruncbuf(vp, cred, length, fs->fs_bsize);
+       error = vtruncbuf(vp, length, fs->fs_bsize);
        if (error && (allerror == 0))
                allerror = error;
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to