Linux NFS development
 help / color / mirror / Atom feed
From: Frank van Maarseveen <frankvm@xs4all.nl>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Linux NFS mailing list <nfs@lists.sourceforge.net>
Subject: alloc_nfs_open_context(): remove redundant refcounting
Date: Mon, 20 Sep 2004 23:08:31 +0200	[thread overview]
Message-ID: <20040920210831.GA21274@janus> (raw)

get_rpccred() is called via the

	rpcauth_lookupcred() -> rpcauth_lookup_credcache()

path so it seems that alloc_nfs_open_context() itself doesn't need to
get_rpccred(). All parents immediately compensate by put_rpccred()

correct?

--- b/fs/nfs/inode.c.orig	2004-09-16 22:03:01.000000000 +0200
+++ b/fs/nfs/inode.c	2004-09-20 22:49:37.000000000 +0200
@@ -825,7 +825,7 @@
 	if (ctx != NULL) {
 		atomic_set(&ctx->count, 1);
 		ctx->dentry = dget(dentry);
-		ctx->cred = get_rpccred(cred);
+		ctx->cred = cred;
 		ctx->state = NULL;
 		ctx->lockowner = current->files;
 		ctx->error = 0;
@@ -909,7 +909,6 @@
 	if ((cred = rpcauth_lookupcred(NFS_CLIENT(inode)->cl_auth, 0)) == NULL)
 		return -ENOMEM;
 	ctx = alloc_nfs_open_context(filp->f_dentry, cred);
-	put_rpccred(cred);
 	if (ctx == NULL)
 		return -ENOMEM;
 	ctx->mode = filp->f_mode;
--- b/fs/nfs/nfs4proc.c.orig	2004-09-14 23:03:09.000000000 +0200
+++ b/fs/nfs/nfs4proc.c	2004-09-20 22:49:52.000000000 +0200
@@ -2015,7 +2015,6 @@
 	if (unlikely(cred == NULL))
 		return -ENOMEM;
 	ctx = alloc_nfs_open_context(dentry, cred);
-	put_rpccred(cred);
 	if (unlikely(ctx == NULL))
 		return -ENOMEM;
 	status = -EIO; /* ERACE actually */

-- 
Frank


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

                 reply	other threads:[~2004-09-20 21:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040920210831.GA21274@janus \
    --to=frankvm@xs4all.nl \
    --cc=nfs@lists.sourceforge.net \
    --cc=trond.myklebust@fys.uio.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox