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

Commit 1c5876dd authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

sunrpc: move p_count out of struct rpc_procinfo



p_count is the only writeable memeber of struct rpc_procinfo, which is
a good candidate to be const-ified as it contains function pointers.

This patch moves it into out out struct rpc_procinfo, and into a
separate writable array that is pointed to by struct rpc_version and
indexed by p_statidx.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent cdfa31e9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -602,8 +602,10 @@ static struct rpc_procinfo nlm4_procedures[] = {
	PROC(GRANTED_RES,	res,		norep),
};

static unsigned int nlm_version4_counts[ARRAY_SIZE(nlm4_procedures)];
const struct rpc_version nlm_version4 = {
	.number		= 4,
	.nrprocs	= ARRAY_SIZE(nlm4_procedures),
	.procs		= nlm4_procedures,
	.counts		= nlm_version4_counts,
};
+4 −0
Original line number Diff line number Diff line
@@ -600,16 +600,20 @@ static struct rpc_procinfo nlm_procedures[] = {
	PROC(GRANTED_RES,	res,		norep),
};

static unsigned int nlm_version1_counts[ARRAY_SIZE(nlm_procedures)];
static const struct rpc_version	nlm_version1 = {
	.number		= 1,
	.nrprocs	= ARRAY_SIZE(nlm_procedures),
	.procs		= nlm_procedures,
	.counts		= nlm_version1_counts,
};

static unsigned int nlm_version3_counts[ARRAY_SIZE(nlm_procedures)];
static const struct rpc_version	nlm_version3 = {
	.number		= 3,
	.nrprocs	= ARRAY_SIZE(nlm_procedures),
	.procs		= nlm_procedures,
	.counts		= nlm_version3_counts,
};

static const struct rpc_version	*nlm_versions[] = {
+3 −1
Original line number Diff line number Diff line
@@ -552,10 +552,12 @@ static struct rpc_procinfo nsm_procedures[] = {
	},
};

static unsigned int nsm_version1_counts[ARRAY_SIZE(nsm_procedures)];
static const struct rpc_version nsm_version1 = {
	.number		= 1,
	.nrprocs	= ARRAY_SIZE(nsm_procedures),
	.procs		= nsm_procedures
	.procs		= nsm_procedures,
	.counts		= nsm_version1_counts,
};

static const struct rpc_version *nsm_version[] = {
+4 −1
Original line number Diff line number Diff line
@@ -504,17 +504,20 @@ static struct rpc_procinfo mnt3_procedures[] = {
	},
};


static unsigned int mnt_counts[ARRAY_SIZE(mnt_procedures)];
static const struct rpc_version mnt_version1 = {
	.number		= 1,
	.nrprocs	= ARRAY_SIZE(mnt_procedures),
	.procs		= mnt_procedures,
	.counts		= mnt_counts,
};

static unsigned int mnt3_counts[ARRAY_SIZE(mnt_procedures)];
static const struct rpc_version mnt_version3 = {
	.number		= 3,
	.nrprocs	= ARRAY_SIZE(mnt3_procedures),
	.procs		= mnt3_procedures,
	.counts		= mnt3_counts,
};

static const struct rpc_version *mnt_version[] = {
+3 −1
Original line number Diff line number Diff line
@@ -1170,8 +1170,10 @@ struct rpc_procinfo nfs_procedures[] = {
	PROC(STATFS,	fhandle,	statfsres,	0),
};

static unsigned int nfs_version2_counts[ARRAY_SIZE(nfs_procedures)];
const struct rpc_version nfs_version2 = {
	.number			= 2,
	.nrprocs		= ARRAY_SIZE(nfs_procedures),
	.procs			= nfs_procedures
	.procs			= nfs_procedures,
	.counts			= nfs_version2_counts,
};
Loading