Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Jun 2019 13:35:01 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r349305 - in stable/12/sys: fs/ext2fs fs/fuse fs/msdosfs fs/nfsclient kern sys ufs/ffs
Message-ID:  <201906231335.x5NDZ13w079305@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: asomers
Date: Sun Jun 23 13:35:01 2019
New Revision: 349305
URL: https://svnweb.freebsd.org/changeset/base/349305

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/12/sys/fs/ext2fs/ext2_inode.c
  stable/12/sys/fs/fuse/fuse_io.c
  stable/12/sys/fs/fuse/fuse_node.c
  stable/12/sys/fs/fuse/fuse_node.h
  stable/12/sys/fs/fuse/fuse_vnops.c
  stable/12/sys/fs/msdosfs/msdosfs_denode.c
  stable/12/sys/fs/nfsclient/nfs.h
  stable/12/sys/fs/nfsclient/nfs_clbio.c
  stable/12/sys/fs/nfsclient/nfs_clvnops.c
  stable/12/sys/kern/vfs_subr.c
  stable/12/sys/sys/vnode.h
  stable/12/sys/ufs/ffs/ffs_inode.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/fs/ext2fs/ext2_inode.c
==============================================================================
--- stable/12/sys/fs/ext2fs/ext2_inode.c	Sun Jun 23 11:09:08 2019	(r349304)
+++ stable/12/sys/fs/ext2fs/ext2_inode.c	Sun Jun 23 13:35:01 2019	(r349305)
@@ -356,7 +356,7 @@ ext2_ind_truncate(struct vnode *vp, off_t length, int 
 		oip->i_ib[i] = oldblks[EXT2_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);
@@ -530,7 +530,7 @@ ext2_ext_truncate(struct vnode *vp, off_t length, int 
 	}
 
 	oip->i_size = osize;
-	error = vtruncbuf(ovp, cred, length, (int)fs->e2fs_bsize);
+	error = vtruncbuf(ovp, length, (int)fs->e2fs_bsize);
 	if (error)
 		return (error);
 

Modified: stable/12/sys/fs/fuse/fuse_io.c
==============================================================================
--- stable/12/sys/fs/fuse/fuse_io.c	Sun Jun 23 11:09:08 2019	(r349304)
+++ stable/12/sys/fs/fuse/fuse_io.c	Sun Jun 23 13:35:01 2019	(r349305)
@@ -363,7 +363,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);
@@ -435,7 +435,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);
@@ -462,7 +462,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/12/sys/fs/fuse/fuse_node.c
==============================================================================
--- stable/12/sys/fs/fuse/fuse_node.c	Sun Jun 23 11:09:08 2019	(r349304)
+++ stable/12/sys/fs/fuse/fuse_node.c	Sun Jun 23 13:35:01 2019	(r349305)
@@ -379,7 +379,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;
@@ -395,7 +395,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/12/sys/fs/fuse/fuse_node.h
==============================================================================
--- stable/12/sys/fs/fuse/fuse_node.h	Sun Jun 23 11:09:08 2019	(r349304)
+++ stable/12/sys/fs/fuse/fuse_node.h	Sun Jun 23 13:35:01 2019	(r349305)
@@ -128,6 +128,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/12/sys/fs/fuse/fuse_vnops.c
==============================================================================
--- stable/12/sys/fs/fuse/fuse_vnops.c	Sun Jun 23 11:09:08 2019	(r349304)
+++ stable/12/sys/fs/fuse/fuse_vnops.c	Sun Jun 23 13:35:01 2019	(r349305)
@@ -539,7 +539,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");
@@ -1649,7 +1649,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/12/sys/fs/msdosfs/msdosfs_denode.c
==============================================================================
--- stable/12/sys/fs/msdosfs/msdosfs_denode.c	Sun Jun 23 11:09:08 2019	(r349304)
+++ stable/12/sys/fs/msdosfs/msdosfs_denode.c	Sun Jun 23 13:35:01 2019	(r349305)
@@ -429,7 +429,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/12/sys/fs/nfsclient/nfs.h
==============================================================================
--- stable/12/sys/fs/nfsclient/nfs.h	Sun Jun 23 11:09:08 2019	(r349304)
+++ stable/12/sys/fs/nfsclient/nfs.h	Sun Jun 23 13:35:01 2019	(r349305)
@@ -91,8 +91,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/12/sys/fs/nfsclient/nfs_clbio.c
==============================================================================
--- stable/12/sys/fs/nfsclient/nfs_clbio.c	Sun Jun 23 11:09:08 2019	(r349304)
+++ stable/12/sys/fs/nfsclient/nfs_clbio.c	Sun Jun 23 13:35:01 2019	(r349305)
@@ -1832,7 +1832,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;
@@ -1854,7 +1854,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/12/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- stable/12/sys/fs/nfsclient/nfs_clvnops.c	Sun Jun 23 11:09:08 2019	(r349304)
+++ stable/12/sys/fs/nfsclient/nfs_clvnops.c	Sun Jun 23 13:35:01 2019	(r349305)
@@ -954,8 +954,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/12/sys/kern/vfs_subr.c
==============================================================================
--- stable/12/sys/kern/vfs_subr.c	Sun Jun 23 11:09:08 2019	(r349304)
+++ stable/12/sys/kern/vfs_subr.c	Sun Jun 23 13:35:01 2019	(r349305)
@@ -1854,15 +1854,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/12/sys/sys/vnode.h
==============================================================================
--- stable/12/sys/sys/vnode.h	Sun Jun 23 11:09:08 2019	(r349304)
+++ stable/12/sys/sys/vnode.h	Sun Jun 23 13:35:01 2019	(r349305)
@@ -657,8 +657,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/12/sys/ufs/ffs/ffs_inode.c
==============================================================================
--- stable/12/sys/ufs/ffs/ffs_inode.c	Sun Jun 23 11:09:08 2019	(r349304)
+++ stable/12/sys/ufs/ffs/ffs_inode.c	Sun Jun 23 13:35:01 2019	(r349305)
@@ -502,7 +502,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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906231335.x5NDZ13w079305>