All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nilfs2: constify nilfs_sc_operations structures
@ 2016-04-09  8:28 ` Julia Lawall
  0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2016-04-09  8:28 UTC (permalink / raw)
  To: Ryusuke Konishi; +Cc: kernel-janitors, linux-nilfs, linux-kernel

The nilfs_sc_operations structures are never modified, so declare them
as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/nilfs2/segment.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index 4317f72..483e663 100644
--- a/fs/nilfs2/segment.c
+++ b/fs/nilfs2/segment.c
@@ -617,7 +617,7 @@ static void nilfs_write_file_node_binfo(struct nilfs_sc_info *sci,
 	*vblocknr = binfo->bi_v.bi_vblocknr;
 }
 
-static struct nilfs_sc_operations nilfs_sc_file_ops = {
+static const struct nilfs_sc_operations nilfs_sc_file_ops = {
 	.collect_data = nilfs_collect_file_data,
 	.collect_node = nilfs_collect_file_node,
 	.collect_bmap = nilfs_collect_file_bmap,
@@ -666,7 +666,7 @@ static void nilfs_write_dat_node_binfo(struct nilfs_sc_info *sci,
 	*binfo_dat = binfo->bi_dat;
 }
 
-static struct nilfs_sc_operations nilfs_sc_dat_ops = {
+static const struct nilfs_sc_operations nilfs_sc_dat_ops = {
 	.collect_data = nilfs_collect_dat_data,
 	.collect_node = nilfs_collect_file_node,
 	.collect_bmap = nilfs_collect_dat_bmap,
@@ -674,7 +674,7 @@ static struct nilfs_sc_operations nilfs_sc_dat_ops = {
 	.write_node_binfo = nilfs_write_dat_node_binfo,
 };
 
-static struct nilfs_sc_operations nilfs_sc_dsync_ops = {
+static const struct nilfs_sc_operations nilfs_sc_dsync_ops = {
 	.collect_data = nilfs_collect_file_data,
 	.collect_node = NULL,
 	.collect_bmap = NULL,
@@ -1043,7 +1043,7 @@ static size_t nilfs_segctor_buffer_rest(struct nilfs_sc_info *sci)
 
 static int nilfs_segctor_scan_file(struct nilfs_sc_info *sci,
 				   struct inode *inode,
-				   struct nilfs_sc_operations *sc_ops)
+				   const struct nilfs_sc_operations *sc_ops)
 {
 	LIST_HEAD(data_buffers);
 	LIST_HEAD(node_buffers);
@@ -1550,7 +1550,7 @@ nilfs_segctor_update_payload_blocknr(struct nilfs_sc_info *sci,
 	sector_t blocknr;
 	unsigned long nfinfo = segbuf->sb_sum.nfinfo;
 	unsigned long nblocks = 0, ndatablk = 0;
-	struct nilfs_sc_operations *sc_op = NULL;
+	const struct nilfs_sc_operations *sc_op = NULL;
 	struct nilfs_segsum_pointer ssp;
 	struct nilfs_finfo *finfo = NULL;
 	union nilfs_binfo binfo;

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

* [PATCH] nilfs2: constify nilfs_sc_operations structures
@ 2016-04-09  8:28 ` Julia Lawall
  0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2016-04-09  8:28 UTC (permalink / raw)
  To: Ryusuke Konishi; +Cc: kernel-janitors, linux-nilfs, linux-kernel

The nilfs_sc_operations structures are never modified, so declare them
as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/nilfs2/segment.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index 4317f72..483e663 100644
--- a/fs/nilfs2/segment.c
+++ b/fs/nilfs2/segment.c
@@ -617,7 +617,7 @@ static void nilfs_write_file_node_binfo(struct nilfs_sc_info *sci,
 	*vblocknr = binfo->bi_v.bi_vblocknr;
 }
 
-static struct nilfs_sc_operations nilfs_sc_file_ops = {
+static const struct nilfs_sc_operations nilfs_sc_file_ops = {
 	.collect_data = nilfs_collect_file_data,
 	.collect_node = nilfs_collect_file_node,
 	.collect_bmap = nilfs_collect_file_bmap,
@@ -666,7 +666,7 @@ static void nilfs_write_dat_node_binfo(struct nilfs_sc_info *sci,
 	*binfo_dat = binfo->bi_dat;
 }
 
-static struct nilfs_sc_operations nilfs_sc_dat_ops = {
+static const struct nilfs_sc_operations nilfs_sc_dat_ops = {
 	.collect_data = nilfs_collect_dat_data,
 	.collect_node = nilfs_collect_file_node,
 	.collect_bmap = nilfs_collect_dat_bmap,
@@ -674,7 +674,7 @@ static struct nilfs_sc_operations nilfs_sc_dat_ops = {
 	.write_node_binfo = nilfs_write_dat_node_binfo,
 };
 
-static struct nilfs_sc_operations nilfs_sc_dsync_ops = {
+static const struct nilfs_sc_operations nilfs_sc_dsync_ops = {
 	.collect_data = nilfs_collect_file_data,
 	.collect_node = NULL,
 	.collect_bmap = NULL,
@@ -1043,7 +1043,7 @@ static size_t nilfs_segctor_buffer_rest(struct nilfs_sc_info *sci)
 
 static int nilfs_segctor_scan_file(struct nilfs_sc_info *sci,
 				   struct inode *inode,
-				   struct nilfs_sc_operations *sc_ops)
+				   const struct nilfs_sc_operations *sc_ops)
 {
 	LIST_HEAD(data_buffers);
 	LIST_HEAD(node_buffers);
@@ -1550,7 +1550,7 @@ nilfs_segctor_update_payload_blocknr(struct nilfs_sc_info *sci,
 	sector_t blocknr;
 	unsigned long nfinfo = segbuf->sb_sum.nfinfo;
 	unsigned long nblocks = 0, ndatablk = 0;
-	struct nilfs_sc_operations *sc_op = NULL;
+	const struct nilfs_sc_operations *sc_op = NULL;
 	struct nilfs_segsum_pointer ssp;
 	struct nilfs_finfo *finfo = NULL;
 	union nilfs_binfo binfo;


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

* [PATCH] nilfs2: constify nilfs_sc_operations structures
@ 2016-04-09  8:28 ` Julia Lawall
  0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2016-04-09  8:28 UTC (permalink / raw)
  To: Ryusuke Konishi
  Cc: kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-nilfs-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

The nilfs_sc_operations structures are never modified, so declare them
as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>

---
 fs/nilfs2/segment.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index 4317f72..483e663 100644
--- a/fs/nilfs2/segment.c
+++ b/fs/nilfs2/segment.c
@@ -617,7 +617,7 @@ static void nilfs_write_file_node_binfo(struct nilfs_sc_info *sci,
 	*vblocknr = binfo->bi_v.bi_vblocknr;
 }
 
-static struct nilfs_sc_operations nilfs_sc_file_ops = {
+static const struct nilfs_sc_operations nilfs_sc_file_ops = {
 	.collect_data = nilfs_collect_file_data,
 	.collect_node = nilfs_collect_file_node,
 	.collect_bmap = nilfs_collect_file_bmap,
@@ -666,7 +666,7 @@ static void nilfs_write_dat_node_binfo(struct nilfs_sc_info *sci,
 	*binfo_dat = binfo->bi_dat;
 }
 
-static struct nilfs_sc_operations nilfs_sc_dat_ops = {
+static const struct nilfs_sc_operations nilfs_sc_dat_ops = {
 	.collect_data = nilfs_collect_dat_data,
 	.collect_node = nilfs_collect_file_node,
 	.collect_bmap = nilfs_collect_dat_bmap,
@@ -674,7 +674,7 @@ static struct nilfs_sc_operations nilfs_sc_dat_ops = {
 	.write_node_binfo = nilfs_write_dat_node_binfo,
 };
 
-static struct nilfs_sc_operations nilfs_sc_dsync_ops = {
+static const struct nilfs_sc_operations nilfs_sc_dsync_ops = {
 	.collect_data = nilfs_collect_file_data,
 	.collect_node = NULL,
 	.collect_bmap = NULL,
@@ -1043,7 +1043,7 @@ static size_t nilfs_segctor_buffer_rest(struct nilfs_sc_info *sci)
 
 static int nilfs_segctor_scan_file(struct nilfs_sc_info *sci,
 				   struct inode *inode,
-				   struct nilfs_sc_operations *sc_ops)
+				   const struct nilfs_sc_operations *sc_ops)
 {
 	LIST_HEAD(data_buffers);
 	LIST_HEAD(node_buffers);
@@ -1550,7 +1550,7 @@ nilfs_segctor_update_payload_blocknr(struct nilfs_sc_info *sci,
 	sector_t blocknr;
 	unsigned long nfinfo = segbuf->sb_sum.nfinfo;
 	unsigned long nblocks = 0, ndatablk = 0;
-	struct nilfs_sc_operations *sc_op = NULL;
+	const struct nilfs_sc_operations *sc_op = NULL;
 	struct nilfs_segsum_pointer ssp;
 	struct nilfs_finfo *finfo = NULL;
 	union nilfs_binfo binfo;

--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] nilfs2: constify nilfs_sc_operations structures
  2016-04-09  8:28 ` Julia Lawall
@ 2016-04-10  3:11   ` Ryusuke Konishi
  -1 siblings, 0 replies; 5+ messages in thread
From: Ryusuke Konishi @ 2016-04-10  3:11 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, linux-nilfs, linux-kernel

On Sat,  9 Apr 2016 10:28:23 +0200, Julia Lawall wrote:
> The nilfs_sc_operations structures are never modified, so declare them
> as const.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 

Applied, thanks.

Ryusuke Konishi

> ---
>  fs/nilfs2/segment.c |   10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
> index 4317f72..483e663 100644
> --- a/fs/nilfs2/segment.c
> +++ b/fs/nilfs2/segment.c
> @@ -617,7 +617,7 @@ static void nilfs_write_file_node_binfo(struct nilfs_sc_info *sci,
>  	*vblocknr = binfo->bi_v.bi_vblocknr;
>  }
>  
> -static struct nilfs_sc_operations nilfs_sc_file_ops = {
> +static const struct nilfs_sc_operations nilfs_sc_file_ops = {
>  	.collect_data = nilfs_collect_file_data,
>  	.collect_node = nilfs_collect_file_node,
>  	.collect_bmap = nilfs_collect_file_bmap,
> @@ -666,7 +666,7 @@ static void nilfs_write_dat_node_binfo(struct nilfs_sc_info *sci,
>  	*binfo_dat = binfo->bi_dat;
>  }
>  
> -static struct nilfs_sc_operations nilfs_sc_dat_ops = {
> +static const struct nilfs_sc_operations nilfs_sc_dat_ops = {
>  	.collect_data = nilfs_collect_dat_data,
>  	.collect_node = nilfs_collect_file_node,
>  	.collect_bmap = nilfs_collect_dat_bmap,
> @@ -674,7 +674,7 @@ static struct nilfs_sc_operations nilfs_sc_dat_ops = {
>  	.write_node_binfo = nilfs_write_dat_node_binfo,
>  };
>  
> -static struct nilfs_sc_operations nilfs_sc_dsync_ops = {
> +static const struct nilfs_sc_operations nilfs_sc_dsync_ops = {
>  	.collect_data = nilfs_collect_file_data,
>  	.collect_node = NULL,
>  	.collect_bmap = NULL,
> @@ -1043,7 +1043,7 @@ static size_t nilfs_segctor_buffer_rest(struct nilfs_sc_info *sci)
>  
>  static int nilfs_segctor_scan_file(struct nilfs_sc_info *sci,
>  				   struct inode *inode,
> -				   struct nilfs_sc_operations *sc_ops)
> +				   const struct nilfs_sc_operations *sc_ops)
>  {
>  	LIST_HEAD(data_buffers);
>  	LIST_HEAD(node_buffers);
> @@ -1550,7 +1550,7 @@ nilfs_segctor_update_payload_blocknr(struct nilfs_sc_info *sci,
>  	sector_t blocknr;
>  	unsigned long nfinfo = segbuf->sb_sum.nfinfo;
>  	unsigned long nblocks = 0, ndatablk = 0;
> -	struct nilfs_sc_operations *sc_op = NULL;
> +	const struct nilfs_sc_operations *sc_op = NULL;
>  	struct nilfs_segsum_pointer ssp;
>  	struct nilfs_finfo *finfo = NULL;
>  	union nilfs_binfo binfo;
> 

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

* Re: [PATCH] nilfs2: constify nilfs_sc_operations structures
@ 2016-04-10  3:11   ` Ryusuke Konishi
  0 siblings, 0 replies; 5+ messages in thread
From: Ryusuke Konishi @ 2016-04-10  3:11 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, linux-nilfs, linux-kernel

On Sat,  9 Apr 2016 10:28:23 +0200, Julia Lawall wrote:
> The nilfs_sc_operations structures are never modified, so declare them
> as const.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 

Applied, thanks.

Ryusuke Konishi

> ---
>  fs/nilfs2/segment.c |   10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
> index 4317f72..483e663 100644
> --- a/fs/nilfs2/segment.c
> +++ b/fs/nilfs2/segment.c
> @@ -617,7 +617,7 @@ static void nilfs_write_file_node_binfo(struct nilfs_sc_info *sci,
>  	*vblocknr = binfo->bi_v.bi_vblocknr;
>  }
>  
> -static struct nilfs_sc_operations nilfs_sc_file_ops = {
> +static const struct nilfs_sc_operations nilfs_sc_file_ops = {
>  	.collect_data = nilfs_collect_file_data,
>  	.collect_node = nilfs_collect_file_node,
>  	.collect_bmap = nilfs_collect_file_bmap,
> @@ -666,7 +666,7 @@ static void nilfs_write_dat_node_binfo(struct nilfs_sc_info *sci,
>  	*binfo_dat = binfo->bi_dat;
>  }
>  
> -static struct nilfs_sc_operations nilfs_sc_dat_ops = {
> +static const struct nilfs_sc_operations nilfs_sc_dat_ops = {
>  	.collect_data = nilfs_collect_dat_data,
>  	.collect_node = nilfs_collect_file_node,
>  	.collect_bmap = nilfs_collect_dat_bmap,
> @@ -674,7 +674,7 @@ static struct nilfs_sc_operations nilfs_sc_dat_ops = {
>  	.write_node_binfo = nilfs_write_dat_node_binfo,
>  };
>  
> -static struct nilfs_sc_operations nilfs_sc_dsync_ops = {
> +static const struct nilfs_sc_operations nilfs_sc_dsync_ops = {
>  	.collect_data = nilfs_collect_file_data,
>  	.collect_node = NULL,
>  	.collect_bmap = NULL,
> @@ -1043,7 +1043,7 @@ static size_t nilfs_segctor_buffer_rest(struct nilfs_sc_info *sci)
>  
>  static int nilfs_segctor_scan_file(struct nilfs_sc_info *sci,
>  				   struct inode *inode,
> -				   struct nilfs_sc_operations *sc_ops)
> +				   const struct nilfs_sc_operations *sc_ops)
>  {
>  	LIST_HEAD(data_buffers);
>  	LIST_HEAD(node_buffers);
> @@ -1550,7 +1550,7 @@ nilfs_segctor_update_payload_blocknr(struct nilfs_sc_info *sci,
>  	sector_t blocknr;
>  	unsigned long nfinfo = segbuf->sb_sum.nfinfo;
>  	unsigned long nblocks = 0, ndatablk = 0;
> -	struct nilfs_sc_operations *sc_op = NULL;
> +	const struct nilfs_sc_operations *sc_op = NULL;
>  	struct nilfs_segsum_pointer ssp;
>  	struct nilfs_finfo *finfo = NULL;
>  	union nilfs_binfo binfo;
> 

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

end of thread, other threads:[~2016-04-10  3:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-09  8:28 [PATCH] nilfs2: constify nilfs_sc_operations structures Julia Lawall
2016-04-09  8:28 ` Julia Lawall
2016-04-09  8:28 ` Julia Lawall
2016-04-10  3:11 ` Ryusuke Konishi
2016-04-10  3:11   ` Ryusuke Konishi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.