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

Commit 8f199b82 authored by Trond Myklebust's avatar Trond Myklebust Committed by J. Bruce Fields
Browse files

NFSD: Fix warnings when NFSD_DEBUG is not defined

parent 62b9510c
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -1053,7 +1053,9 @@ struct nfsd4_operation {


static struct nfsd4_operation nfsd4_ops[];
static struct nfsd4_operation nfsd4_ops[];


#ifdef NFSD_DEBUG
static const char *nfsd4_op_name(unsigned opnum);
static const char *nfsd4_op_name(unsigned opnum);
#endif


/*
/*
 * Enforce NFSv4.1 COMPOUND ordering rules:
 * Enforce NFSv4.1 COMPOUND ordering rules:
@@ -1714,12 +1716,14 @@ static struct nfsd4_operation nfsd4_ops[] = {
	},
	},
};
};


#ifdef NFSD_DEBUG
static const char *nfsd4_op_name(unsigned opnum)
static const char *nfsd4_op_name(unsigned opnum)
{
{
	if (opnum < ARRAY_SIZE(nfsd4_ops))
	if (opnum < ARRAY_SIZE(nfsd4_ops))
		return nfsd4_ops[opnum].op_name;
		return nfsd4_ops[opnum].op_name;
	return "unknown_operation";
	return "unknown_operation";
}
}
#endif


#define nfsd4_voidres			nfsd4_voidargs
#define nfsd4_voidres			nfsd4_voidargs
struct nfsd4_voidargs { int dummy; };
struct nfsd4_voidargs { int dummy; };
+8 −0
Original line number Original line Diff line number Diff line
@@ -622,12 +622,20 @@ hash_sessionid(struct nfs4_sessionid *sessionid)
	return sid->sequence % SESSION_HASH_SIZE;
	return sid->sequence % SESSION_HASH_SIZE;
}
}


#ifdef NFSD_DEBUG
static inline void
static inline void
dump_sessionid(const char *fn, struct nfs4_sessionid *sessionid)
dump_sessionid(const char *fn, struct nfs4_sessionid *sessionid)
{
{
	u32 *ptr = (u32 *)(&sessionid->data[0]);
	u32 *ptr = (u32 *)(&sessionid->data[0]);
	dprintk("%s: %u:%u:%u:%u\n", fn, ptr[0], ptr[1], ptr[2], ptr[3]);
	dprintk("%s: %u:%u:%u:%u\n", fn, ptr[0], ptr[1], ptr[2], ptr[3]);
}
}
#else
static inline void
dump_sessionid(const char *fn, struct nfs4_sessionid *sessionid)
{
}
#endif



static void
static void
gen_sessionid(struct nfsd4_session *ses)
gen_sessionid(struct nfsd4_session *ses)