Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c613cb9 authored by Julia Lawall's avatar Julia Lawall Committed by Linus Torvalds
Browse files

nilfs2: constify nilfs_sc_operations structures



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

Done with the help of Coccinelle.

Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a46d8c3f
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -617,7 +617,7 @@ static void nilfs_write_file_node_binfo(struct nilfs_sc_info *sci,
	*vblocknr = binfo->bi_v.bi_vblocknr;
	*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_data = nilfs_collect_file_data,
	.collect_node = nilfs_collect_file_node,
	.collect_node = nilfs_collect_file_node,
	.collect_bmap = nilfs_collect_file_bmap,
	.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;
	*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_data = nilfs_collect_dat_data,
	.collect_node = nilfs_collect_file_node,
	.collect_node = nilfs_collect_file_node,
	.collect_bmap = nilfs_collect_dat_bmap,
	.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,
	.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_data = nilfs_collect_file_data,
	.collect_node = NULL,
	.collect_node = NULL,
	.collect_bmap = 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,
static int nilfs_segctor_scan_file(struct nilfs_sc_info *sci,
				   struct inode *inode,
				   struct inode *inode,
				   struct nilfs_sc_operations *sc_ops)
				   const struct nilfs_sc_operations *sc_ops)
{
{
	LIST_HEAD(data_buffers);
	LIST_HEAD(data_buffers);
	LIST_HEAD(node_buffers);
	LIST_HEAD(node_buffers);
@@ -1550,7 +1550,7 @@ nilfs_segctor_update_payload_blocknr(struct nilfs_sc_info *sci,
	sector_t blocknr;
	sector_t blocknr;
	unsigned long nfinfo = segbuf->sb_sum.nfinfo;
	unsigned long nfinfo = segbuf->sb_sum.nfinfo;
	unsigned long nblocks = 0, ndatablk = 0;
	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_segsum_pointer ssp;
	struct nilfs_finfo *finfo = NULL;
	struct nilfs_finfo *finfo = NULL;
	union nilfs_binfo binfo;
	union nilfs_binfo binfo;