Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jan 2021 22:17:07 GMT
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 2a0be7b0331c - stable/12 - VFS_QUOTACTL: Remove needless casts of arg
Message-ID:  <202101252217.10PMH7kQ087592@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by brooks:

URL: https://cgit.FreeBSD.org/src/commit/?id=2a0be7b0331c5245418cdf2893c8ba6b42a0afa5

commit 2a0be7b0331c5245418cdf2893c8ba6b42a0afa5
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2021-01-25 22:16:26 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2021-01-25 22:16:26 +0000

    VFS_QUOTACTL: Remove needless casts of arg
    
    The argument is a void * so there's no need to cast it to caddr_t.
    
    Update documentation to match function decleration.
    
    Reviewed by:    freqlabs
    Obtained from:  CheriBSD
    MFC after:      1 week
    Sponsored by:   DARPA
    Differential Revision:  https://reviews.freebsd.org/D27093
    
    (cherry picked from commit 52e63ec2f1ddf76c9411b6833bc5d021457b5005)
---
 share/man/man9/VFS_QUOTACTL.9 |  4 ++--
 sys/fs/nfs/nfs_commonsubs.c   | 14 +++++++-------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/share/man/man9/VFS_QUOTACTL.9 b/share/man/man9/VFS_QUOTACTL.9
index fded4d6b883c..8d0cb113ce1e 100644
--- a/share/man/man9/VFS_QUOTACTL.9
+++ b/share/man/man9/VFS_QUOTACTL.9
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 23, 2009
+.Dd December 17, 2020
 .Dt VFS_QUOTACTL 9
 .Os
 .Sh NAME
@@ -39,7 +39,7 @@
 .In sys/mount.h
 .In sys/vnode.h
 .Ft int
-.Fn VFS_QUOTACTL "struct mount *mp" "int cmds" "uid_t uid" "caddr_t arg"
+.Fn VFS_QUOTACTL "struct mount *mp" "int cmds" "uid_t uid" "void *arg"
 .Sh DESCRIPTION
 Implement file system quotas.
 See
diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c
index 167b404007bd..7c54b503b286 100644
--- a/sys/fs/nfs/nfs_commonsubs.c
+++ b/sys/fs/nfs/nfs_commonsubs.c
@@ -1882,7 +1882,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp,
 			    savuid = p->p_cred->p_ruid;
 			    p->p_cred->p_ruid = cred->cr_uid;
 			    if (!VFS_QUOTACTL(vnode_mount(vp),QCMD(Q_GETQUOTA,
-				USRQUOTA), cred->cr_uid, (caddr_t)&dqb))
+				USRQUOTA), cred->cr_uid, &dqb))
 				freenum = min(dqb.dqb_bhardlimit, freenum);
 			    p->p_cred->p_ruid = savuid;
 #endif	/* QUOTA */
@@ -1911,7 +1911,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp,
 			    savuid = p->p_cred->p_ruid;
 			    p->p_cred->p_ruid = cred->cr_uid;
 			    if (!VFS_QUOTACTL(vnode_mount(vp),QCMD(Q_GETQUOTA,
-				USRQUOTA), cred->cr_uid, (caddr_t)&dqb))
+				USRQUOTA), cred->cr_uid, &dqb))
 				freenum = min(dqb.dqb_bsoftlimit, freenum);
 			    p->p_cred->p_ruid = savuid;
 #endif	/* QUOTA */
@@ -1937,7 +1937,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp,
 			    savuid = p->p_cred->p_ruid;
 			    p->p_cred->p_ruid = cred->cr_uid;
 			    if (!VFS_QUOTACTL(vnode_mount(vp),QCMD(Q_GETQUOTA,
-				USRQUOTA), cred->cr_uid, (caddr_t)&dqb))
+				USRQUOTA), cred->cr_uid, &dqb))
 				freenum = dqb.dqb_curblocks;
 			    p->p_cred->p_ruid = savuid;
 #endif	/* QUOTA */
@@ -2662,7 +2662,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp,
 			savuid = p->p_cred->p_ruid;
 			p->p_cred->p_ruid = cred->cr_uid;
 			if (!VFS_QUOTACTL(mp, QCMD(Q_GETQUOTA,USRQUOTA),
-			    cred->cr_uid, (caddr_t)&dqb))
+			    cred->cr_uid, &dqb))
 			    freenum = min(dqb.dqb_isoftlimit-dqb.dqb_curinodes,
 				freenum);
 			p->p_cred->p_ruid = savuid;
@@ -2769,7 +2769,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp,
 			savuid = p->p_cred->p_ruid;
 			p->p_cred->p_ruid = cred->cr_uid;
 			if (!VFS_QUOTACTL(mp, QCMD(Q_GETQUOTA,USRQUOTA),
-			    cred->cr_uid, (caddr_t)&dqb))
+			    cred->cr_uid, &dqb))
 			    freenum = min(dqb.dqb_bhardlimit, freenum);
 			p->p_cred->p_ruid = savuid;
 #endif	/* QUOTA */
@@ -2793,7 +2793,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp,
 			savuid = p->p_cred->p_ruid;
 			p->p_cred->p_ruid = cred->cr_uid;
 			if (!VFS_QUOTACTL(mp, QCMD(Q_GETQUOTA,USRQUOTA),
-			    cred->cr_uid, (caddr_t)&dqb))
+			    cred->cr_uid, &dqb))
 			    freenum = min(dqb.dqb_bsoftlimit, freenum);
 			p->p_cred->p_ruid = savuid;
 #endif	/* QUOTA */
@@ -2814,7 +2814,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp,
 			savuid = p->p_cred->p_ruid;
 			p->p_cred->p_ruid = cred->cr_uid;
 			if (!VFS_QUOTACTL(mp, QCMD(Q_GETQUOTA,USRQUOTA),
-			    cred->cr_uid, (caddr_t)&dqb))
+			    cred->cr_uid, &dqb))
 			    freenum = dqb.dqb_curblocks;
 			p->p_cred->p_ruid = savuid;
 #endif	/* QUOTA */



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