linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] nvmet-tcp: constify static struct nvmet_fabrics_ops
@ 2020-06-01 17:05 Max Gurtovoy
  2020-06-01 22:50 ` Himanshu Madhani
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Max Gurtovoy @ 2020-06-01 17:05 UTC (permalink / raw)
  To: sagi, linux-nvme, kbusch, hch; +Cc: israelr, nitzanc, Max Gurtovoy

nvmet_tcp_ops is never modified and can be made const to allow the
compiler to put it in read-only memory, as done in other transports.

Before:
   text    data     bss     dec     hex filename
  16164     160      12   16336    3fd0 drivers/nvme/target/tcp.o

After:
   text    data     bss     dec     hex filename
  16277      64      12   16353    3fe1 drivers/nvme/target/tcp.o

Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Israel Rukshin <israelr@mellanox.com>
---
 drivers/nvme/target/tcp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index 6f557db..9e4cb90 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -153,7 +153,7 @@ struct nvmet_tcp_port {
 static DEFINE_MUTEX(nvmet_tcp_queue_mutex);
 
 static struct workqueue_struct *nvmet_tcp_wq;
-static struct nvmet_fabrics_ops nvmet_tcp_ops;
+static const struct nvmet_fabrics_ops nvmet_tcp_ops;
 static void nvmet_tcp_free_cmd(struct nvmet_tcp_cmd *c);
 static void nvmet_tcp_finish_cmd(struct nvmet_tcp_cmd *cmd);
 
@@ -1747,7 +1747,7 @@ static void nvmet_tcp_disc_port_addr(struct nvmet_req *req,
 	}
 }
 
-static struct nvmet_fabrics_ops nvmet_tcp_ops = {
+static const struct nvmet_fabrics_ops nvmet_tcp_ops = {
 	.owner			= THIS_MODULE,
 	.type			= NVMF_TRTYPE_TCP,
 	.msdbd			= 1,
-- 
1.8.3.1


_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] nvmet-tcp: constify static struct nvmet_fabrics_ops
  2020-06-01 17:05 [PATCH 1/1] nvmet-tcp: constify static struct nvmet_fabrics_ops Max Gurtovoy
@ 2020-06-01 22:50 ` Himanshu Madhani
  2020-06-03 20:20 ` Sagi Grimberg
  2020-06-09 13:44 ` Christoph Hellwig
  2 siblings, 0 replies; 4+ messages in thread
From: Himanshu Madhani @ 2020-06-01 22:50 UTC (permalink / raw)
  To: Max Gurtovoy, sagi, linux-nvme, kbusch, hch; +Cc: israelr, nitzanc



On 6/1/20 12:05 PM, Max Gurtovoy wrote:
> nvmet_tcp_ops is never modified and can be made const to allow the
> compiler to put it in read-only memory, as done in other transports.
> 
> Before:
>     text    data     bss     dec     hex filename
>    16164     160      12   16336    3fd0 drivers/nvme/target/tcp.o
> 
> After:
>     text    data     bss     dec     hex filename
>    16277      64      12   16353    3fe1 drivers/nvme/target/tcp.o
> 
> Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
> Reviewed-by: Israel Rukshin <israelr@mellanox.com>
> ---
>   drivers/nvme/target/tcp.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
> index 6f557db..9e4cb90 100644
> --- a/drivers/nvme/target/tcp.c
> +++ b/drivers/nvme/target/tcp.c
> @@ -153,7 +153,7 @@ struct nvmet_tcp_port {
>   static DEFINE_MUTEX(nvmet_tcp_queue_mutex);
>   
>   static struct workqueue_struct *nvmet_tcp_wq;
> -static struct nvmet_fabrics_ops nvmet_tcp_ops;
> +static const struct nvmet_fabrics_ops nvmet_tcp_ops;
>   static void nvmet_tcp_free_cmd(struct nvmet_tcp_cmd *c);
>   static void nvmet_tcp_finish_cmd(struct nvmet_tcp_cmd *cmd);
>   
> @@ -1747,7 +1747,7 @@ static void nvmet_tcp_disc_port_addr(struct nvmet_req *req,
>   	}
>   }
>   
> -static struct nvmet_fabrics_ops nvmet_tcp_ops = {
> +static const struct nvmet_fabrics_ops nvmet_tcp_ops = {
>   	.owner			= THIS_MODULE,
>   	.type			= NVMF_TRTYPE_TCP,
>   	.msdbd			= 1,
> 
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

-- 
Himanshu Madhani                     Oracle Linux Engineering

_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] nvmet-tcp: constify static struct nvmet_fabrics_ops
  2020-06-01 17:05 [PATCH 1/1] nvmet-tcp: constify static struct nvmet_fabrics_ops Max Gurtovoy
  2020-06-01 22:50 ` Himanshu Madhani
@ 2020-06-03 20:20 ` Sagi Grimberg
  2020-06-09 13:44 ` Christoph Hellwig
  2 siblings, 0 replies; 4+ messages in thread
From: Sagi Grimberg @ 2020-06-03 20:20 UTC (permalink / raw)
  To: Max Gurtovoy, linux-nvme, kbusch, hch; +Cc: israelr, nitzanc

Acked-by: Sagi Grimberg <sagi@grimberg.me>

_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] nvmet-tcp: constify static struct nvmet_fabrics_ops
  2020-06-01 17:05 [PATCH 1/1] nvmet-tcp: constify static struct nvmet_fabrics_ops Max Gurtovoy
  2020-06-01 22:50 ` Himanshu Madhani
  2020-06-03 20:20 ` Sagi Grimberg
@ 2020-06-09 13:44 ` Christoph Hellwig
  2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2020-06-09 13:44 UTC (permalink / raw)
  To: Max Gurtovoy; +Cc: sagi, israelr, linux-nvme, kbusch, nitzanc, hch

Thanks,

applied to nvme-5.8.

_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-09 13:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-01 17:05 [PATCH 1/1] nvmet-tcp: constify static struct nvmet_fabrics_ops Max Gurtovoy
2020-06-01 22:50 ` Himanshu Madhani
2020-06-03 20:20 ` Sagi Grimberg
2020-06-09 13:44 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).