diff options
author | Helge Deller <deller@gmx.de> | 2006-12-06 23:40:36 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:46 -0500 |
commit | 15ad7cdcfd76450d4beebc789ec646664238184d (patch) | |
tree | 279d05a76ae0906c23ee2de8c5684d95d9886ad3 /mm | |
parent | 4a08a9f68168e547c2baf100020e9b96cae5fbd1 (diff) |
[PATCH] struct seq_operations and struct file_operations constification
- move some file_operations structs into the .rodata section
- move static strings from policy_types[] array into the .rodata section
- fix generic seq_operations usages, so that those structs may be defined
as "const" as well
[akpm@osdl.org: couple of fixes]
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mempolicy.c | 4 | ||||
-rw-r--r-- | mm/page_alloc.c | 2 | ||||
-rw-r--r-- | mm/shmem.c | 4 | ||||
-rw-r--r-- | mm/slab.c | 4 | ||||
-rw-r--r-- | mm/swapfile.c | 4 | ||||
-rw-r--r-- | mm/vmstat.c | 8 |
6 files changed, 13 insertions, 13 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index ad864f8708b0..b917d6fdc1bb 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -1707,8 +1707,8 @@ void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new) | |||
1707 | * Display pages allocated per node and memory policy via /proc. | 1707 | * Display pages allocated per node and memory policy via /proc. |
1708 | */ | 1708 | */ |
1709 | 1709 | ||
1710 | static const char *policy_types[] = { "default", "prefer", "bind", | 1710 | static const char * const policy_types[] = |
1711 | "interleave" }; | 1711 | { "default", "prefer", "bind", "interleave" }; |
1712 | 1712 | ||
1713 | /* | 1713 | /* |
1714 | * Convert a mempolicy into a string. | 1714 | * Convert a mempolicy into a string. |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 27ec7a1b8022..cace22b3ac25 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -83,7 +83,7 @@ int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1] = { | |||
83 | 83 | ||
84 | EXPORT_SYMBOL(totalram_pages); | 84 | EXPORT_SYMBOL(totalram_pages); |
85 | 85 | ||
86 | static char *zone_names[MAX_NR_ZONES] = { | 86 | static char * const zone_names[MAX_NR_ZONES] = { |
87 | "DMA", | 87 | "DMA", |
88 | #ifdef CONFIG_ZONE_DMA32 | 88 | #ifdef CONFIG_ZONE_DMA32 |
89 | "DMA32", | 89 | "DMA32", |
diff --git a/mm/shmem.c b/mm/shmem.c index 007653680a75..c820b4f77b8d 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -177,7 +177,7 @@ static inline void shmem_unacct_blocks(unsigned long flags, long pages) | |||
177 | 177 | ||
178 | static struct super_operations shmem_ops; | 178 | static struct super_operations shmem_ops; |
179 | static const struct address_space_operations shmem_aops; | 179 | static const struct address_space_operations shmem_aops; |
180 | static struct file_operations shmem_file_operations; | 180 | static const struct file_operations shmem_file_operations; |
181 | static struct inode_operations shmem_inode_operations; | 181 | static struct inode_operations shmem_inode_operations; |
182 | static struct inode_operations shmem_dir_inode_operations; | 182 | static struct inode_operations shmem_dir_inode_operations; |
183 | static struct inode_operations shmem_special_inode_operations; | 183 | static struct inode_operations shmem_special_inode_operations; |
@@ -2319,7 +2319,7 @@ static const struct address_space_operations shmem_aops = { | |||
2319 | .migratepage = migrate_page, | 2319 | .migratepage = migrate_page, |
2320 | }; | 2320 | }; |
2321 | 2321 | ||
2322 | static struct file_operations shmem_file_operations = { | 2322 | static const struct file_operations shmem_file_operations = { |
2323 | .mmap = shmem_mmap, | 2323 | .mmap = shmem_mmap, |
2324 | #ifdef CONFIG_TMPFS | 2324 | #ifdef CONFIG_TMPFS |
2325 | .llseek = generic_file_llseek, | 2325 | .llseek = generic_file_llseek, |
@@ -4142,7 +4142,7 @@ static int s_show(struct seq_file *m, void *p) | |||
4142 | * + further values on SMP and with statistics enabled | 4142 | * + further values on SMP and with statistics enabled |
4143 | */ | 4143 | */ |
4144 | 4144 | ||
4145 | struct seq_operations slabinfo_op = { | 4145 | const struct seq_operations slabinfo_op = { |
4146 | .start = s_start, | 4146 | .start = s_start, |
4147 | .next = s_next, | 4147 | .next = s_next, |
4148 | .stop = s_stop, | 4148 | .stop = s_stop, |
@@ -4340,7 +4340,7 @@ static int leaks_show(struct seq_file *m, void *p) | |||
4340 | return 0; | 4340 | return 0; |
4341 | } | 4341 | } |
4342 | 4342 | ||
4343 | struct seq_operations slabstats_op = { | 4343 | const struct seq_operations slabstats_op = { |
4344 | .start = leaks_start, | 4344 | .start = leaks_start, |
4345 | .next = s_next, | 4345 | .next = s_next, |
4346 | .stop = s_stop, | 4346 | .stop = s_stop, |
diff --git a/mm/swapfile.c b/mm/swapfile.c index 55242363de64..c5431072f422 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
@@ -1368,7 +1368,7 @@ static int swap_show(struct seq_file *swap, void *v) | |||
1368 | return 0; | 1368 | return 0; |
1369 | } | 1369 | } |
1370 | 1370 | ||
1371 | static struct seq_operations swaps_op = { | 1371 | static const struct seq_operations swaps_op = { |
1372 | .start = swap_start, | 1372 | .start = swap_start, |
1373 | .next = swap_next, | 1373 | .next = swap_next, |
1374 | .stop = swap_stop, | 1374 | .stop = swap_stop, |
@@ -1380,7 +1380,7 @@ static int swaps_open(struct inode *inode, struct file *file) | |||
1380 | return seq_open(file, &swaps_op); | 1380 | return seq_open(file, &swaps_op); |
1381 | } | 1381 | } |
1382 | 1382 | ||
1383 | static struct file_operations proc_swaps_operations = { | 1383 | static const struct file_operations proc_swaps_operations = { |
1384 | .open = swaps_open, | 1384 | .open = swaps_open, |
1385 | .read = seq_read, | 1385 | .read = seq_read, |
1386 | .llseek = seq_lseek, | 1386 | .llseek = seq_lseek, |
diff --git a/mm/vmstat.c b/mm/vmstat.c index ef4176843d9e..dc005a0c96ae 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c | |||
@@ -430,7 +430,7 @@ static int frag_show(struct seq_file *m, void *arg) | |||
430 | return 0; | 430 | return 0; |
431 | } | 431 | } |
432 | 432 | ||
433 | struct seq_operations fragmentation_op = { | 433 | const struct seq_operations fragmentation_op = { |
434 | .start = frag_start, | 434 | .start = frag_start, |
435 | .next = frag_next, | 435 | .next = frag_next, |
436 | .stop = frag_stop, | 436 | .stop = frag_stop, |
@@ -452,7 +452,7 @@ struct seq_operations fragmentation_op = { | |||
452 | #define TEXTS_FOR_ZONES(xx) xx "_dma", TEXT_FOR_DMA32(xx) xx "_normal", \ | 452 | #define TEXTS_FOR_ZONES(xx) xx "_dma", TEXT_FOR_DMA32(xx) xx "_normal", \ |
453 | TEXT_FOR_HIGHMEM(xx) | 453 | TEXT_FOR_HIGHMEM(xx) |
454 | 454 | ||
455 | static char *vmstat_text[] = { | 455 | static const char * const vmstat_text[] = { |
456 | /* Zoned VM counters */ | 456 | /* Zoned VM counters */ |
457 | "nr_anon_pages", | 457 | "nr_anon_pages", |
458 | "nr_mapped", | 458 | "nr_mapped", |
@@ -597,7 +597,7 @@ static int zoneinfo_show(struct seq_file *m, void *arg) | |||
597 | return 0; | 597 | return 0; |
598 | } | 598 | } |
599 | 599 | ||
600 | struct seq_operations zoneinfo_op = { | 600 | const struct seq_operations zoneinfo_op = { |
601 | .start = frag_start, /* iterate over all zones. The same as in | 601 | .start = frag_start, /* iterate over all zones. The same as in |
602 | * fragmentation. */ | 602 | * fragmentation. */ |
603 | .next = frag_next, | 603 | .next = frag_next, |
@@ -660,7 +660,7 @@ static void vmstat_stop(struct seq_file *m, void *arg) | |||
660 | m->private = NULL; | 660 | m->private = NULL; |
661 | } | 661 | } |
662 | 662 | ||
663 | struct seq_operations vmstat_op = { | 663 | const struct seq_operations vmstat_op = { |
664 | .start = vmstat_start, | 664 | .start = vmstat_start, |
665 | .next = vmstat_next, | 665 | .next = vmstat_next, |
666 | .stop = vmstat_stop, | 666 | .stop = vmstat_stop, |