Commit c4cb8974 authored by Julia Lawall's avatar Julia Lawall Committed by J. Bruce Fields

nfsd: constify nfsd4_callback_ops structure

The nfsd4_callback_ops structure is never modified, so declare it as const.

Done with the help of Coccinelle.
Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 7c582e4f
...@@ -1143,7 +1143,7 @@ nfsd4_run_cb_work(struct work_struct *work) ...@@ -1143,7 +1143,7 @@ nfsd4_run_cb_work(struct work_struct *work)
} }
void nfsd4_init_cb(struct nfsd4_callback *cb, struct nfs4_client *clp, void nfsd4_init_cb(struct nfsd4_callback *cb, struct nfs4_client *clp,
struct nfsd4_callback_ops *ops, enum nfsd4_cb_op op) const struct nfsd4_callback_ops *ops, enum nfsd4_cb_op op)
{ {
cb->cb_clp = clp; cb->cb_clp = clp;
cb->cb_msg.rpc_proc = &nfs4_cb_procedures[op]; cb->cb_msg.rpc_proc = &nfs4_cb_procedures[op];
......
...@@ -22,7 +22,7 @@ struct nfs4_layout { ...@@ -22,7 +22,7 @@ struct nfs4_layout {
static struct kmem_cache *nfs4_layout_cache; static struct kmem_cache *nfs4_layout_cache;
static struct kmem_cache *nfs4_layout_stateid_cache; static struct kmem_cache *nfs4_layout_stateid_cache;
static struct nfsd4_callback_ops nfsd4_cb_layout_ops; static const struct nfsd4_callback_ops nfsd4_cb_layout_ops;
static const struct lock_manager_operations nfsd4_layouts_lm_ops; static const struct lock_manager_operations nfsd4_layouts_lm_ops;
const struct nfsd4_layout_ops *nfsd4_layout_ops[LAYOUT_TYPE_MAX] = { const struct nfsd4_layout_ops *nfsd4_layout_ops[LAYOUT_TYPE_MAX] = {
...@@ -665,7 +665,7 @@ nfsd4_cb_layout_release(struct nfsd4_callback *cb) ...@@ -665,7 +665,7 @@ nfsd4_cb_layout_release(struct nfsd4_callback *cb)
nfs4_put_stid(&ls->ls_stid); nfs4_put_stid(&ls->ls_stid);
} }
static struct nfsd4_callback_ops nfsd4_cb_layout_ops = { static const struct nfsd4_callback_ops nfsd4_cb_layout_ops = {
.prepare = nfsd4_cb_layout_prepare, .prepare = nfsd4_cb_layout_prepare,
.done = nfsd4_cb_layout_done, .done = nfsd4_cb_layout_done,
.release = nfsd4_cb_layout_release, .release = nfsd4_cb_layout_release,
......
...@@ -98,7 +98,7 @@ static struct kmem_cache *odstate_slab; ...@@ -98,7 +98,7 @@ static struct kmem_cache *odstate_slab;
static void free_session(struct nfsd4_session *); static void free_session(struct nfsd4_session *);
static struct nfsd4_callback_ops nfsd4_cb_recall_ops; static const struct nfsd4_callback_ops nfsd4_cb_recall_ops;
static bool is_session_dead(struct nfsd4_session *ses) static bool is_session_dead(struct nfsd4_session *ses)
{ {
...@@ -3648,7 +3648,7 @@ static void nfsd4_cb_recall_release(struct nfsd4_callback *cb) ...@@ -3648,7 +3648,7 @@ static void nfsd4_cb_recall_release(struct nfsd4_callback *cb)
nfs4_put_stid(&dp->dl_stid); nfs4_put_stid(&dp->dl_stid);
} }
static struct nfsd4_callback_ops nfsd4_cb_recall_ops = { static const struct nfsd4_callback_ops nfsd4_cb_recall_ops = {
.prepare = nfsd4_cb_recall_prepare, .prepare = nfsd4_cb_recall_prepare,
.done = nfsd4_cb_recall_done, .done = nfsd4_cb_recall_done,
.release = nfsd4_cb_recall_release, .release = nfsd4_cb_recall_release,
......
...@@ -65,7 +65,7 @@ struct nfsd4_callback { ...@@ -65,7 +65,7 @@ struct nfsd4_callback {
struct nfs4_client *cb_clp; struct nfs4_client *cb_clp;
u32 cb_minorversion; u32 cb_minorversion;
struct rpc_message cb_msg; struct rpc_message cb_msg;
struct nfsd4_callback_ops *cb_ops; const struct nfsd4_callback_ops *cb_ops;
struct work_struct cb_work; struct work_struct cb_work;
int cb_seq_status; int cb_seq_status;
int cb_status; int cb_status;
...@@ -599,7 +599,7 @@ extern void nfsd4_probe_callback(struct nfs4_client *clp); ...@@ -599,7 +599,7 @@ extern void nfsd4_probe_callback(struct nfs4_client *clp);
extern void nfsd4_probe_callback_sync(struct nfs4_client *clp); extern void nfsd4_probe_callback_sync(struct nfs4_client *clp);
extern void nfsd4_change_callback(struct nfs4_client *clp, struct nfs4_cb_conn *); extern void nfsd4_change_callback(struct nfs4_client *clp, struct nfs4_cb_conn *);
extern void nfsd4_init_cb(struct nfsd4_callback *cb, struct nfs4_client *clp, extern void nfsd4_init_cb(struct nfsd4_callback *cb, struct nfs4_client *clp,
struct nfsd4_callback_ops *ops, enum nfsd4_cb_op op); const struct nfsd4_callback_ops *ops, enum nfsd4_cb_op op);
extern void nfsd4_run_cb(struct nfsd4_callback *cb); extern void nfsd4_run_cb(struct nfsd4_callback *cb);
extern int nfsd4_create_callback_queue(void); extern int nfsd4_create_callback_queue(void);
extern void nfsd4_destroy_callback_queue(void); extern void nfsd4_destroy_callback_queue(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment