git: 6d8420d444b5 - main - Remove unnecessary thread argument from unionfs_nodeget() and _noderem()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 08 Dec 2021 00:12:45 UTC
The branch main has been updated by jah:
URL: https://cgit.FreeBSD.org/src/commit/?id=6d8420d444b583b55147e5e8fdba89d16ede1f1f
commit 6d8420d444b583b55147e5e8fdba89d16ede1f1f
Author: Jason A. Harmening <jah@FreeBSD.org>
AuthorDate: 2021-11-15 16:40:17 +0000
Commit: Jason A. Harmening <jah@FreeBSD.org>
CommitDate: 2021-12-08 00:20:02 +0000
Remove unnecessary thread argument from unionfs_nodeget() and _noderem()
Also remove a couple of write-only variables found by the recent clang
update. No functional change intended.
Discussed with: kib
Differential Revision: https://reviews.freebsd.org/D33008
---
sys/fs/unionfs/union.h | 5 ++---
sys/fs/unionfs/union_subr.c | 4 ++--
sys/fs/unionfs/union_vfsops.c | 4 +---
sys/fs/unionfs/union_vnops.c | 18 +++++++-----------
4 files changed, 12 insertions(+), 19 deletions(-)
diff --git a/sys/fs/unionfs/union.h b/sys/fs/unionfs/union.h
index eda24c1b8333..34d323dff511 100644
--- a/sys/fs/unionfs/union.h
+++ b/sys/fs/unionfs/union.h
@@ -130,9 +130,8 @@ unionfs_check_vnode(struct vnode *vp, const char *file __unused,
int unionfs_init(struct vfsconf *);
int unionfs_uninit(struct vfsconf *);
int unionfs_nodeget(struct mount *, struct vnode *, struct vnode *,
- struct vnode *, struct vnode **, struct componentname *,
- struct thread *);
-void unionfs_noderem(struct vnode *, struct thread *);
+ struct vnode *, struct vnode **, struct componentname *);
+void unionfs_noderem(struct vnode *);
void unionfs_get_node_status(struct unionfs_node *, struct thread *,
struct unionfs_node_status **);
void unionfs_tryrem_node_status(struct unionfs_node *,
diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c
index 195d74583443..551553fd8b20 100644
--- a/sys/fs/unionfs/union_subr.c
+++ b/sys/fs/unionfs/union_subr.c
@@ -299,7 +299,7 @@ unionfs_nodeget_cleanup(struct vnode *vp, void *arg)
int
unionfs_nodeget(struct mount *mp, struct vnode *uppervp,
struct vnode *lowervp, struct vnode *dvp, struct vnode **vpp,
- struct componentname *cnp, struct thread *td)
+ struct componentname *cnp)
{
char *path;
struct unionfs_mount *ump;
@@ -426,7 +426,7 @@ unionfs_nodeget_out:
* Clean up the unionfs node.
*/
void
-unionfs_noderem(struct vnode *vp, struct thread *td)
+unionfs_noderem(struct vnode *vp)
{
struct unionfs_node *unp, *unp_t1, *unp_t2;
struct unionfs_node_hashhead *hd;
diff --git a/sys/fs/unionfs/union_vfsops.c b/sys/fs/unionfs/union_vfsops.c
index da9b3cce46f3..ea49d1e189da 100644
--- a/sys/fs/unionfs/union_vfsops.c
+++ b/sys/fs/unionfs/union_vfsops.c
@@ -78,7 +78,6 @@ unionfs_domount(struct mount *mp)
struct vnode *lowerrootvp;
struct vnode *upperrootvp;
struct unionfs_mount *ump;
- struct thread *td;
char *target;
char *tmp;
char *ep;
@@ -105,7 +104,6 @@ unionfs_domount(struct mount *mp)
copymode = UNIONFS_TRANSPARENT; /* default */
whitemode = UNIONFS_WHITE_ALWAYS;
ndp = &nd;
- td = curthread;
if (mp->mnt_flag & MNT_ROOTFS) {
vfs_mount_error(mp, "Cannot union mount root filesystem");
@@ -284,7 +282,7 @@ unionfs_domount(struct mount *mp)
* Get the unionfs root vnode.
*/
error = unionfs_nodeget(mp, ump->um_uppervp, ump->um_lowervp,
- NULLVP, &(ump->um_rootvp), NULL, td);
+ NULLVP, &(ump->um_rootvp), NULL);
vrele(upperrootvp);
if (error != 0) {
free(ump, M_UNIONFSMNT);
diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c
index 93249b21ccb3..381e413e18ba 100644
--- a/sys/fs/unionfs/union_vnops.c
+++ b/sys/fs/unionfs/union_vnops.c
@@ -263,7 +263,7 @@ unionfs_lookup(struct vop_cachedlookup_args *ap)
(1 < cnp->cn_namelen || '.' != *(cnp->cn_nameptr))) {
/* get unionfs vnode in order to create a new shadow dir. */
error = unionfs_nodeget(dvp->v_mount, NULLVP, lvp, dvp, &vp,
- cnp, td);
+ cnp);
if (error != 0)
goto unionfs_lookup_cleanup;
@@ -319,7 +319,7 @@ unionfs_lookup(struct vop_cachedlookup_args *ap)
*/
else
error = unionfs_nodeget(dvp->v_mount, uvp, lvp,
- dvp, &vp, cnp, td);
+ dvp, &vp, cnp);
if (error != 0) {
UNIONFSDEBUG(
"unionfs_lookup: Unable to create unionfs vnode.");
@@ -383,7 +383,7 @@ unionfs_create(struct vop_create_args *ap)
else {
VOP_UNLOCK(vp);
error = unionfs_nodeget(ap->a_dvp->v_mount, vp, NULLVP,
- ap->a_dvp, ap->a_vpp, cnp, curthread);
+ ap->a_dvp, ap->a_vpp, cnp);
vrele(vp);
}
}
@@ -457,7 +457,7 @@ unionfs_mknod(struct vop_mknod_args *ap)
else {
VOP_UNLOCK(vp);
error = unionfs_nodeget(ap->a_dvp->v_mount, vp, NULLVP,
- ap->a_dvp, ap->a_vpp, cnp, curthread);
+ ap->a_dvp, ap->a_vpp, cnp);
vrele(vp);
}
}
@@ -1347,7 +1347,6 @@ unionfs_mkdir(struct vop_mkdir_args *ap)
{
struct unionfs_node *dunp;
struct componentname *cnp;
- struct thread *td;
struct vnode *udvp;
struct vnode *uvp;
struct vattr va;
@@ -1362,7 +1361,6 @@ unionfs_mkdir(struct vop_mkdir_args *ap)
dunp = VTOUNIONFS(ap->a_dvp);
cnp = ap->a_cnp;
lkflags = cnp->cn_lkflags;
- td = curthread;
udvp = dunp->un_uppervp;
if (udvp != NULLVP) {
@@ -1379,7 +1377,7 @@ unionfs_mkdir(struct vop_mkdir_args *ap)
VOP_UNLOCK(uvp);
cnp->cn_lkflags = LK_EXCLUSIVE;
error = unionfs_nodeget(ap->a_dvp->v_mount, uvp, NULLVP,
- ap->a_dvp, ap->a_vpp, cnp, td);
+ ap->a_dvp, ap->a_vpp, cnp);
cnp->cn_lkflags = lkflags;
vrele(uvp);
}
@@ -1467,7 +1465,6 @@ unionfs_symlink(struct vop_symlink_args *ap)
{
struct unionfs_node *dunp;
struct componentname *cnp;
- struct thread *td;
struct vnode *udvp;
struct vnode *uvp;
int error;
@@ -1481,7 +1478,6 @@ unionfs_symlink(struct vop_symlink_args *ap)
dunp = VTOUNIONFS(ap->a_dvp);
cnp = ap->a_cnp;
lkflags = cnp->cn_lkflags;
- td = curthread;
udvp = dunp->un_uppervp;
if (udvp != NULLVP) {
@@ -1490,7 +1486,7 @@ unionfs_symlink(struct vop_symlink_args *ap)
VOP_UNLOCK(uvp);
cnp->cn_lkflags = LK_EXCLUSIVE;
error = unionfs_nodeget(ap->a_dvp->v_mount, uvp, NULLVP,
- ap->a_dvp, ap->a_vpp, cnp, td);
+ ap->a_dvp, ap->a_vpp, cnp);
cnp->cn_lkflags = lkflags;
vrele(uvp);
}
@@ -1761,7 +1757,7 @@ unionfs_reclaim(struct vop_reclaim_args *ap)
{
/* UNIONFS_INTERNAL_DEBUG("unionfs_reclaim: enter\n"); */
- unionfs_noderem(ap->a_vp, curthread);
+ unionfs_noderem(ap->a_vp);
/* UNIONFS_INTERNAL_DEBUG("unionfs_reclaim: leave\n"); */