Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31f31db1 authored by Jan Blunck's avatar Jan Blunck Committed by Trond Myklebust
Browse files

nfs: path_{get,put}() cleanups



Here are some more places where path_{get,put}() can be used instead of
dput()/mntput() pair.

Signed-off-by: default avatarJan Blunck <jblunck@suse.de>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 3110ff80
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -541,8 +541,7 @@ static void __put_nfs_open_context(struct nfs_open_context *ctx, int wait)
	}
	}
	if (ctx->cred != NULL)
	if (ctx->cred != NULL)
		put_rpccred(ctx->cred);
		put_rpccred(ctx->cred);
	dput(ctx->path.dentry);
	path_put(&ctx->path);
	mntput(ctx->path.mnt);
	kfree(ctx);
	kfree(ctx);
}
}


+1 −2
Original line number Original line Diff line number Diff line
@@ -137,8 +137,7 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
			goto out_follow;
			goto out_follow;
		goto out_err;
		goto out_err;
	}
	}
	mntput(nd->path.mnt);
	path_put(&nd->path);
	dput(nd->path.dentry);
	nd->path.mnt = mnt;
	nd->path.mnt = mnt;
	nd->path.dentry = dget(mnt->mnt_root);
	nd->path.dentry = dget(mnt->mnt_root);
	schedule_delayed_work(&nfs_automount_task, nfs_mountpoint_expiry_timeout);
	schedule_delayed_work(&nfs_automount_task, nfs_mountpoint_expiry_timeout);
+2 −4
Original line number Original line Diff line number Diff line
@@ -306,8 +306,7 @@ static void nfs4_opendata_free(struct kref *kref)
		nfs4_put_open_state(p->state);
		nfs4_put_open_state(p->state);
	nfs4_put_state_owner(p->owner);
	nfs4_put_state_owner(p->owner);
	dput(p->dir);
	dput(p->dir);
	dput(p->path.dentry);
	path_put(&p->path);
	mntput(p->path.mnt);
	kfree(p);
	kfree(p);
}
}


@@ -1210,8 +1209,7 @@ static void nfs4_free_closedata(void *data)
	nfs4_put_open_state(calldata->state);
	nfs4_put_open_state(calldata->state);
	nfs_free_seqid(calldata->arg.seqid);
	nfs_free_seqid(calldata->arg.seqid);
	nfs4_put_state_owner(sp);
	nfs4_put_state_owner(sp);
	dput(calldata->path.dentry);
	path_put(&calldata->path);
	mntput(calldata->path.mnt);
	kfree(calldata);
	kfree(calldata);
}
}