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

Commit 04ef5954 authored by J. Bruce Fields's avatar J. Bruce Fields Committed by Linus Torvalds
Browse files

[PATCH] nfsd4: remove release_state_owner()



It's confusing having both release_stateowner() and release_state_owner().

And as it turns out, release_state_owner() is short and only called from one
place; so just remove it.

Also note the confirmed check is superfluous there--preprocess_seqid_op
already check this.

And remove a redundant comment and a superfluous line assignment while we're
at it.

Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3a65588a
Loading
Loading
Loading
Loading
+9 −22
Original line number Diff line number Diff line
@@ -1178,7 +1178,6 @@ release_stateid(struct nfs4_stateid *stp, int flags)
		locks_remove_posix(filp, (fl_owner_t) stp->st_stateowner);
	put_nfs4_file(stp->st_file);
	kmem_cache_free(stateid_slab, stp);
	stp = NULL;
}

static void
@@ -1191,22 +1190,6 @@ move_to_close_lru(struct nfs4_stateowner *sop)
	sop->so_time = get_seconds();
}

static void
release_state_owner(struct nfs4_stateid *stp, int flag)
{
	struct nfs4_stateowner *sop = stp->st_stateowner;

	dprintk("NFSD: release_state_owner\n");
	release_stateid(stp, flag);

	/* place unused nfs4_stateowners on so_close_lru list to be
	 * released by the laundromat service after the lease period
	 * to enable us to handle CLOSE replay
	 */
	if (sop->so_confirmed && list_empty(&sop->so_stateids))
		move_to_close_lru(sop);
}

static int
cmp_owner_str(struct nfs4_stateowner *sop, struct xdr_netobj *owner, clientid_t *clid) {
	return ((sop->so_owner.len == owner->len) && 
@@ -2423,15 +2406,19 @@ nfsd4_close(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_clos
					CHECK_FH | OPEN_STATE | CLOSE_STATE,
					&close->cl_stateowner, &stp, NULL)))
		goto out; 
	/*
	*  Return success, but first update the stateid.
	*/
	status = nfs_ok;
	update_stateid(&stp->st_stateid);
	memcpy(&close->cl_stateid, &stp->st_stateid, sizeof(stateid_t));

	/* release_state_owner() calls nfsd_close() if needed */
	release_state_owner(stp, OPEN_STATE);
	/* release_stateid() calls nfsd_close() if needed */
	release_stateid(stp, OPEN_STATE);

	/* place unused nfs4_stateowners on so_close_lru list to be
	 * released by the laundromat service after the lease period
	 * to enable us to handle CLOSE replay
	 */
	if (list_empty(&close->cl_stateowner->so_stateids))
		move_to_close_lru(close->cl_stateowner);
out:
	if (close->cl_stateowner) {
		nfs4_get_stateowner(close->cl_stateowner);