* [PATCH] staging: lustre: constify cl_lock_operations
@ 2017-08-27 6:05 Arvind Yadav
2017-08-28 8:24 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-08-27 6:05 UTC (permalink / raw)
To: oleg.drokin, andreas.dilger, jsimmons, gregkh, john.hammond
Cc: linux-kernel, devel, lustre-devel
cl_lock_operations are not supposed to change at runtime.
cl_lock_slice_add is working with const cl_lock_operations.
So mark the non-const cl_lock_operations structs as const.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/staging/lustre/lustre/obdecho/echo_client.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c
index 1c4a8fe..b3fbc3c 100644
--- a/drivers/staging/lustre/lustre/obdecho/echo_client.c
+++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c
@@ -319,7 +319,7 @@ static void echo_lock_fini(const struct lu_env *env,
kmem_cache_free(echo_lock_kmem, ecl);
}
-static struct cl_lock_operations echo_lock_ops = {
+static const struct cl_lock_operations echo_lock_ops = {
.clo_fini = echo_lock_fini,
};
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: lustre: constify cl_lock_operations
2017-08-27 6:05 [PATCH] staging: lustre: constify cl_lock_operations Arvind Yadav
@ 2017-08-28 8:24 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2017-08-28 8:24 UTC (permalink / raw)
To: Arvind Yadav
Cc: oleg.drokin, andreas.dilger, jsimmons, john.hammond, devel,
linux-kernel, lustre-devel
On Sun, Aug 27, 2017 at 11:35:27AM +0530, Arvind Yadav wrote:
> cl_lock_operations are not supposed to change at runtime.
> cl_lock_slice_add is working with const cl_lock_operations.
> So mark the non-const cl_lock_operations structs as const.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> drivers/staging/lustre/lustre/obdecho/echo_client.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Someone else already sent this same patch in, and it's already applied
in my tree :(
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-28 8:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-27 6:05 [PATCH] staging: lustre: constify cl_lock_operations Arvind Yadav
2017-08-28 8:24 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox