Skip to content

Commit

Permalink
lockd: constify nlmsvc_binding structure
Browse files Browse the repository at this point in the history
The nlmsvc_binding structure is never modified, so declare it as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
  • Loading branch information
JuliaLawall authored and J. Bruce Fields committed Jan 7, 2016
1 parent ea44463 commit 2a29745
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fs/lockd/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

static struct svc_program nlmsvc_program;

struct nlmsvc_binding * nlmsvc_ops;
const struct nlmsvc_binding *nlmsvc_ops;
EXPORT_SYMBOL_GPL(nlmsvc_ops);

static DEFINE_MUTEX(nlmsvc_mutex);
Expand Down
2 changes: 1 addition & 1 deletion fs/nfsd/lockd.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ nlm_fclose(struct file *filp)
fput(filp);
}

static struct nlmsvc_binding nfsd_nlm_ops = {
static const struct nlmsvc_binding nfsd_nlm_ops = {
.fopen = nlm_fopen, /* open file for locking */
.fclose = nlm_fclose, /* close file */
};
Expand Down
2 changes: 1 addition & 1 deletion include/linux/lockd/bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct nlmsvc_binding {
void (*fclose)(struct file *);
};

extern struct nlmsvc_binding * nlmsvc_ops;
extern const struct nlmsvc_binding *nlmsvc_ops;

/*
* Similar to nfs_client_initdata, but without the NFS-specific
Expand Down

0 comments on commit 2a29745

Please sign in to comment.