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

Commit 17280175 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

NFS: Fix a number of sparse warnings



Fix a number of "warning: symbol 'foo' was not declared. Should it be
static?" conditions.

Fix 2 cases of "warning: Using plain integer as NULL pointer"

fs/nfs/delegation.c:263:31: warning: restricted fmode_t degrades to integer
  - We want to allow upgrades to a WRITE delegation, but should otherwise
    consider servers that hand out duplicate delegations to be borken.

Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 5ffaf855
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ nfs4_callback_svc(void *vrqstp)
/*
 * Prepare to bring up the NFSv4 callback service
 */
struct svc_rqst *
static struct svc_rqst *
nfs4_callback_up(struct svc_serv *serv, struct rpc_xprt *xprt)
{
	int ret;
@@ -172,7 +172,7 @@ nfs41_callback_svc(void *vrqstp)
/*
 * Bring up the NFSv4.1 callback service
 */
struct svc_rqst *
static struct svc_rqst *
nfs41_callback_up(struct svc_serv *serv, struct rpc_xprt *xprt)
{
	struct svc_rqst *rqstp;
+2 −3
Original line number Diff line number Diff line
@@ -443,9 +443,8 @@ static int nfs_sockaddr_cmp(const struct sockaddr *sa1,
}

/* Common match routine for v4.0 and v4.1 callback services */
bool
nfs4_cb_match_client(const struct sockaddr *addr, struct nfs_client *clp,
		     u32 minorversion)
static bool nfs4_cb_match_client(const struct sockaddr *addr,
		struct nfs_client *clp, u32 minorversion)
{
	struct sockaddr *clap = (struct sockaddr *)&clp->cl_addr;

+4 −1
Original line number Diff line number Diff line
@@ -256,11 +256,14 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct
		/*
		 * Deal with broken servers that hand out two
		 * delegations for the same file.
		 * Allow for upgrades to a WRITE delegation, but
		 * nothing else.
		 */
		dfprintk(FILE, "%s: server %s handed out "
				"a duplicate delegation!\n",
				__func__, clp->cl_hostname);
		if (delegation->type <= old_delegation->type) {
		if (delegation->type == old_delegation->type ||
		    !(delegation->type & FMODE_WRITE)) {
			freeme = delegation;
			delegation = NULL;
			goto out;
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@

#include <linux/sunrpc/clnt.h>
#include <linux/dns_resolver.h>
#include "dns_resolve.h"

ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen,
		struct sockaddr *sa, size_t salen)
+4 −4
Original line number Diff line number Diff line
@@ -54,8 +54,8 @@

/* Default cache timeout is 10 minutes */
unsigned int nfs_idmap_cache_timeout = 600;
const struct cred *id_resolver_cache;
struct key_type key_type_id_resolver_legacy;
static const struct cred *id_resolver_cache;
static struct key_type key_type_id_resolver_legacy;


/**
@@ -160,7 +160,7 @@ static int nfs_map_numeric_to_string(__u32 id, char *buf, size_t buflen)
	return snprintf(buf, buflen, "%u", id);
}

struct key_type key_type_id_resolver = {
static struct key_type key_type_id_resolver = {
	.name		= "id_resolver",
	.instantiate	= user_instantiate,
	.match		= user_match,
@@ -381,7 +381,7 @@ static const struct rpc_pipe_ops idmap_upcall_ops = {
	.destroy_msg	= idmap_pipe_destroy_msg,
};

struct key_type key_type_id_resolver_legacy = {
static struct key_type key_type_id_resolver_legacy = {
	.name		= "id_resolver",
	.instantiate	= user_instantiate,
	.match		= user_match,
Loading