public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <linux@treblig.org>
To: trondmy@kernel.org, anna@kernel.org, linux-nfs@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] NFS: Remove unused function nfs_umount
Date: Wed, 2 Apr 2025 17:31:00 +0000	[thread overview]
Message-ID: <Z-10VGi6E8g3gi4Q@gallifrey> (raw)
In-Reply-To: <20250218215250.263709-1-linux@treblig.org>

* linux@treblig.org (linux@treblig.org) wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> nfs_umount() has been unused since 2013's
> commit 4580a92d44e2 ("NFS: Use server-recommended security flavor by
> default (NFSv3)")
> 
> Remove it.
> 
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

Hi,
  I'd appreciate a review on this one please.

Dave (just going cleaning up his old patch list)
> ---
>  fs/nfs/internal.h   |  1 -
>  fs/nfs/mount_clnt.c | 68 ---------------------------------------------
>  2 files changed, 69 deletions(-)
> 
> diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
> index fae2c7ae4acc..36dcbb928c5f 100644
> --- a/fs/nfs/internal.h
> +++ b/fs/nfs/internal.h
> @@ -207,7 +207,6 @@ struct nfs_mount_request {
>  };
>  
>  extern int nfs_mount(struct nfs_mount_request *info, int timeo, int retrans);
> -extern void nfs_umount(const struct nfs_mount_request *info);
>  
>  /* client.c */
>  extern const struct rpc_program nfs_program;
> diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c
> index 57c9dd700b58..db8dfb920394 100644
> --- a/fs/nfs/mount_clnt.c
> +++ b/fs/nfs/mount_clnt.c
> @@ -223,74 +223,6 @@ int nfs_mount(struct nfs_mount_request *info, int timeo, int retrans)
>  	goto out;
>  }
>  
> -/**
> - * nfs_umount - Notify a server that we have unmounted this export
> - * @info: pointer to umount request arguments
> - *
> - * MOUNTPROC_UMNT is advisory, so we set a short timeout, and always
> - * use UDP.
> - */
> -void nfs_umount(const struct nfs_mount_request *info)
> -{
> -	static const struct rpc_timeout nfs_umnt_timeout = {
> -		.to_initval = 1 * HZ,
> -		.to_maxval = 3 * HZ,
> -		.to_retries = 2,
> -	};
> -	struct rpc_create_args args = {
> -		.net		= info->net,
> -		.protocol	= IPPROTO_UDP,
> -		.address	= (struct sockaddr *)info->sap,
> -		.addrsize	= info->salen,
> -		.timeout	= &nfs_umnt_timeout,
> -		.servername	= info->hostname,
> -		.program	= &mnt_program,
> -		.version	= info->version,
> -		.authflavor	= RPC_AUTH_UNIX,
> -		.flags		= RPC_CLNT_CREATE_NOPING,
> -		.cred		= current_cred(),
> -	};
> -	struct rpc_message msg	= {
> -		.rpc_argp	= info->dirpath,
> -	};
> -	struct rpc_clnt *clnt;
> -	int status;
> -
> -	if (strlen(info->dirpath) > MNTPATHLEN)
> -		return;
> -
> -	if (info->noresvport)
> -		args.flags |= RPC_CLNT_CREATE_NONPRIVPORT;
> -
> -	clnt = rpc_create(&args);
> -	if (IS_ERR(clnt))
> -		goto out_clnt_err;
> -
> -	dprintk("NFS: sending UMNT request for %s:%s\n",
> -		(info->hostname ? info->hostname : "server"), info->dirpath);
> -
> -	if (info->version == NFS_MNT3_VERSION)
> -		msg.rpc_proc = &clnt->cl_procinfo[MOUNTPROC3_UMNT];
> -	else
> -		msg.rpc_proc = &clnt->cl_procinfo[MOUNTPROC_UMNT];
> -
> -	status = rpc_call_sync(clnt, &msg, 0);
> -	rpc_shutdown_client(clnt);
> -
> -	if (unlikely(status < 0))
> -		goto out_call_err;
> -
> -	return;
> -
> -out_clnt_err:
> -	dprintk("NFS: failed to create UMNT RPC client, status=%ld\n",
> -			PTR_ERR(clnt));
> -	return;
> -
> -out_call_err:
> -	dprintk("NFS: UMNT request failed, status=%d\n", status);
> -}
> -
>  /*
>   * XDR encode/decode functions for MOUNT
>   */
> -- 
> 2.48.1
> 
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

      reply	other threads:[~2025-04-02 17:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-18 21:52 [PATCH] NFS: Remove unused function nfs_umount linux
2025-04-02 17:31 ` Dr. David Alan Gilbert [this message]

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=Z-10VGi6E8g3gi4Q@gallifrey \
    --to=linux@treblig.org \
    --cc=anna@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@kernel.org \
    /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