Commit 846b6ce2 authored by Hugh Dickins's avatar Hugh Dickins Committed by Linus Torvalds

[PATCH] C99 initializers for mm

ISO C99 designated initializers by Art Haas for mm.
parent 9a7219b3
...@@ -1346,7 +1346,7 @@ struct page * filemap_nopage(struct vm_area_struct * area, unsigned long address ...@@ -1346,7 +1346,7 @@ struct page * filemap_nopage(struct vm_area_struct * area, unsigned long address
} }
static struct vm_operations_struct generic_file_vm_ops = { static struct vm_operations_struct generic_file_vm_ops = {
nopage: filemap_nopage, .nopage = filemap_nopage,
}; };
/* This is used for a general mmap of a disk file */ /* This is used for a general mmap of a disk file */
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
int numnodes = 1; /* Initialized for UMA platforms */ int numnodes = 1; /* Initialized for UMA platforms */
static bootmem_data_t contig_bootmem_data; static bootmem_data_t contig_bootmem_data;
pg_data_t contig_page_data = { bdata: &contig_bootmem_data }; pg_data_t contig_page_data = { .bdata = &contig_bootmem_data };
#ifndef CONFIG_DISCONTIGMEM #ifndef CONFIG_DISCONTIGMEM
......
...@@ -132,11 +132,11 @@ static int swap_vm_writeback(struct page *page, int *nr_to_write) ...@@ -132,11 +132,11 @@ static int swap_vm_writeback(struct page *page, int *nr_to_write)
} }
struct address_space_operations swap_aops = { struct address_space_operations swap_aops = {
vm_writeback: swap_vm_writeback, .vm_writeback = swap_vm_writeback,
writepage: swap_writepage, .writepage = swap_writepage,
readpage: swap_readpage, .readpage = swap_readpage,
sync_page: block_sync_page, .sync_page = block_sync_page,
set_page_dirty: __set_page_dirty_nobuffers, .set_page_dirty = __set_page_dirty_nobuffers,
}; };
/* /*
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#include <linux/backing-dev.h> #include <linux/backing-dev.h>
struct backing_dev_info default_backing_dev_info = { struct backing_dev_info default_backing_dev_info = {
ra_pages: (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE, .ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE,
state: 0, .state = 0,
}; };
/* /*
......
...@@ -1312,14 +1312,14 @@ static int shmem_follow_link(struct dentry *dentry, struct nameidata *nd) ...@@ -1312,14 +1312,14 @@ static int shmem_follow_link(struct dentry *dentry, struct nameidata *nd)
} }
static struct inode_operations shmem_symlink_inline_operations = { static struct inode_operations shmem_symlink_inline_operations = {
readlink: shmem_readlink_inline, .readlink = shmem_readlink_inline,
follow_link: shmem_follow_link_inline, .follow_link = shmem_follow_link_inline,
}; };
static struct inode_operations shmem_symlink_inode_operations = { static struct inode_operations shmem_symlink_inode_operations = {
truncate: shmem_truncate, .truncate = shmem_truncate,
readlink: shmem_readlink, .readlink = shmem_readlink,
follow_link: shmem_follow_link, .follow_link = shmem_follow_link,
}; };
static int shmem_parse_options(char *options, int *mode, uid_t *uid, gid_t *gid, unsigned long * blocks, unsigned long *inodes) static int shmem_parse_options(char *options, int *mode, uid_t *uid, gid_t *gid, unsigned long * blocks, unsigned long *inodes)
...@@ -1520,52 +1520,52 @@ static void destroy_inodecache(void) ...@@ -1520,52 +1520,52 @@ static void destroy_inodecache(void)
} }
static struct address_space_operations shmem_aops = { static struct address_space_operations shmem_aops = {
writepage: shmem_writepage, .writepage = shmem_writepage,
set_page_dirty: __set_page_dirty_nobuffers, .set_page_dirty = __set_page_dirty_nobuffers,
}; };
static struct file_operations shmem_file_operations = { static struct file_operations shmem_file_operations = {
mmap: shmem_mmap, .mmap = shmem_mmap,
#ifdef CONFIG_TMPFS #ifdef CONFIG_TMPFS
read: shmem_file_read, .read = shmem_file_read,
write: shmem_file_write, .write = shmem_file_write,
fsync: shmem_sync_file, .fsync = shmem_sync_file,
#endif #endif
}; };
static struct inode_operations shmem_inode_operations = { static struct inode_operations shmem_inode_operations = {
truncate: shmem_truncate, .truncate = shmem_truncate,
setattr: shmem_notify_change, .setattr = shmem_notify_change,
}; };
static struct inode_operations shmem_dir_inode_operations = { static struct inode_operations shmem_dir_inode_operations = {
#ifdef CONFIG_TMPFS #ifdef CONFIG_TMPFS
create: shmem_create, .create = shmem_create,
lookup: simple_lookup, .lookup = simple_lookup,
link: shmem_link, .link = shmem_link,
unlink: shmem_unlink, .unlink = shmem_unlink,
symlink: shmem_symlink, .symlink = shmem_symlink,
mkdir: shmem_mkdir, .mkdir = shmem_mkdir,
rmdir: shmem_rmdir, .rmdir = shmem_rmdir,
mknod: shmem_mknod, .mknod = shmem_mknod,
rename: shmem_rename, .rename = shmem_rename,
#endif #endif
}; };
static struct super_operations shmem_ops = { static struct super_operations shmem_ops = {
alloc_inode: shmem_alloc_inode, .alloc_inode = shmem_alloc_inode,
destroy_inode: shmem_destroy_inode, .destroy_inode = shmem_destroy_inode,
#ifdef CONFIG_TMPFS #ifdef CONFIG_TMPFS
statfs: shmem_statfs, .statfs = shmem_statfs,
remount_fs: shmem_remount_fs, .remount_fs = shmem_remount_fs,
#endif #endif
delete_inode: shmem_delete_inode, .delete_inode = shmem_delete_inode,
drop_inode: generic_delete_inode, .drop_inode = generic_delete_inode,
put_super: shmem_put_super, .put_super = shmem_put_super,
}; };
static struct vm_operations_struct shmem_vm_ops = { static struct vm_operations_struct shmem_vm_ops = {
nopage: shmem_nopage, .nopage = shmem_nopage,
}; };
static struct super_block *shmem_get_sb(struct file_system_type *fs_type, static struct super_block *shmem_get_sb(struct file_system_type *fs_type,
...@@ -1577,17 +1577,17 @@ static struct super_block *shmem_get_sb(struct file_system_type *fs_type, ...@@ -1577,17 +1577,17 @@ static struct super_block *shmem_get_sb(struct file_system_type *fs_type,
#ifdef CONFIG_TMPFS #ifdef CONFIG_TMPFS
/* type "shm" will be tagged obsolete in 2.5 */ /* type "shm" will be tagged obsolete in 2.5 */
static struct file_system_type shmem_fs_type = { static struct file_system_type shmem_fs_type = {
owner: THIS_MODULE, .owner = THIS_MODULE,
name: "shmem", .name = "shmem",
get_sb: shmem_get_sb, .get_sb = shmem_get_sb,
kill_sb: kill_litter_super, .kill_sb = kill_litter_super,
}; };
#endif #endif
static struct file_system_type tmpfs_fs_type = { static struct file_system_type tmpfs_fs_type = {
owner: THIS_MODULE, .owner = THIS_MODULE,
name: "tmpfs", .name = "tmpfs",
get_sb: shmem_get_sb, .get_sb = shmem_get_sb,
kill_sb: kill_litter_super, .kill_sb = kill_litter_super,
}; };
static struct vfsmount *shm_mnt; static struct vfsmount *shm_mnt;
......
...@@ -384,14 +384,14 @@ static struct { ...@@ -384,14 +384,14 @@ static struct {
/* internal cache of cache description objs */ /* internal cache of cache description objs */
static kmem_cache_t cache_cache = { static kmem_cache_t cache_cache = {
slabs_full: LIST_HEAD_INIT(cache_cache.slabs_full), .slabs_full = LIST_HEAD_INIT(cache_cache.slabs_full),
slabs_partial: LIST_HEAD_INIT(cache_cache.slabs_partial), .slabs_partial = LIST_HEAD_INIT(cache_cache.slabs_partial),
slabs_free: LIST_HEAD_INIT(cache_cache.slabs_free), .slabs_free = LIST_HEAD_INIT(cache_cache.slabs_free),
objsize: sizeof(kmem_cache_t), .objsize = sizeof(kmem_cache_t),
flags: SLAB_NO_REAP, .flags = SLAB_NO_REAP,
spinlock: SPIN_LOCK_UNLOCKED, .spinlock = SPIN_LOCK_UNLOCKED,
colour_off: L1_CACHE_BYTES, .colour_off = L1_CACHE_BYTES,
name: "kmem_cache", .name = "kmem_cache",
}; };
/* Guard access to the cache-chain. */ /* Guard access to the cache-chain. */
...@@ -2053,10 +2053,10 @@ static int s_show(struct seq_file *m, void *p) ...@@ -2053,10 +2053,10 @@ static int s_show(struct seq_file *m, void *p)
*/ */
struct seq_operations slabinfo_op = { struct seq_operations slabinfo_op = {
start: s_start, .start = s_start,
next: s_next, .next = s_next,
stop: s_stop, .stop = s_stop,
show: s_show .show = s_show,
}; };
#define MAX_SLABINFO_WRITE 128 #define MAX_SLABINFO_WRITE 128
......
...@@ -22,23 +22,23 @@ ...@@ -22,23 +22,23 @@
* avoid some special-casing in other parts of the kernel. * avoid some special-casing in other parts of the kernel.
*/ */
static struct inode swapper_inode = { static struct inode swapper_inode = {
i_mapping: &swapper_space, .i_mapping = &swapper_space,
}; };
extern struct address_space_operations swap_aops; extern struct address_space_operations swap_aops;
struct address_space swapper_space = { struct address_space swapper_space = {
page_tree: RADIX_TREE_INIT(GFP_ATOMIC), .page_tree = RADIX_TREE_INIT(GFP_ATOMIC),
page_lock: RW_LOCK_UNLOCKED, .page_lock = RW_LOCK_UNLOCKED,
clean_pages: LIST_HEAD_INIT(swapper_space.clean_pages), .clean_pages = LIST_HEAD_INIT(swapper_space.clean_pages),
dirty_pages: LIST_HEAD_INIT(swapper_space.dirty_pages), .dirty_pages = LIST_HEAD_INIT(swapper_space.dirty_pages),
io_pages: LIST_HEAD_INIT(swapper_space.io_pages), .io_pages = LIST_HEAD_INIT(swapper_space.io_pages),
locked_pages: LIST_HEAD_INIT(swapper_space.locked_pages), .locked_pages = LIST_HEAD_INIT(swapper_space.locked_pages),
host: &swapper_inode, .host = &swapper_inode,
a_ops: &swap_aops, .a_ops = &swap_aops,
i_shared_lock: SPIN_LOCK_UNLOCKED, .i_shared_lock = SPIN_LOCK_UNLOCKED,
private_lock: SPIN_LOCK_UNLOCKED, .private_lock = SPIN_LOCK_UNLOCKED,
private_list: LIST_HEAD_INIT(swapper_space.private_list), .private_list = LIST_HEAD_INIT(swapper_space.private_list),
}; };
#define INC_CACHE_INFO(x) do { swap_cache_info.x++; } while (0) #define INC_CACHE_INFO(x) do { swap_cache_info.x++; } while (0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment