Commit 5383f8ec authored by Art Haas's avatar Art Haas Committed by Linus Torvalds

[PATCH] designated initializer patches for fs_

  Here's a resend of C99 patches for the files in fs.
parent 5b6797cb
...@@ -53,7 +53,7 @@ static kmem_cache_t *kioctx_cachep; ...@@ -53,7 +53,7 @@ static kmem_cache_t *kioctx_cachep;
/* Used for rare fput completion. */ /* Used for rare fput completion. */
static void aio_fput_routine(void *); static void aio_fput_routine(void *);
static struct tq_struct fput_tqueue = { static struct tq_struct fput_tqueue = {
routine: aio_fput_routine, .routine = aio_fput_routine,
}; };
static spinlock_t fput_lock = SPIN_LOCK_UNLOCKED; static spinlock_t fput_lock = SPIN_LOCK_UNLOCKED;
......
...@@ -30,37 +30,37 @@ static int return_EIO(void) ...@@ -30,37 +30,37 @@ static int return_EIO(void)
static struct file_operations bad_file_ops = static struct file_operations bad_file_ops =
{ {
llseek: EIO_ERROR, .llseek = EIO_ERROR,
read: EIO_ERROR, .read = EIO_ERROR,
write: EIO_ERROR, .write = EIO_ERROR,
readdir: EIO_ERROR, .readdir = EIO_ERROR,
poll: EIO_ERROR, .poll = EIO_ERROR,
ioctl: EIO_ERROR, .ioctl = EIO_ERROR,
mmap: EIO_ERROR, .mmap = EIO_ERROR,
open: EIO_ERROR, .open = EIO_ERROR,
flush: EIO_ERROR, .flush = EIO_ERROR,
release: EIO_ERROR, .release = EIO_ERROR,
fsync: EIO_ERROR, .fsync = EIO_ERROR,
fasync: EIO_ERROR, .fasync = EIO_ERROR,
lock: EIO_ERROR, .lock = EIO_ERROR,
}; };
struct inode_operations bad_inode_ops = struct inode_operations bad_inode_ops =
{ {
create: EIO_ERROR, .create = EIO_ERROR,
lookup: EIO_ERROR, .lookup = EIO_ERROR,
link: EIO_ERROR, .link = EIO_ERROR,
unlink: EIO_ERROR, .unlink = EIO_ERROR,
symlink: EIO_ERROR, .symlink = EIO_ERROR,
mkdir: EIO_ERROR, .mkdir = EIO_ERROR,
rmdir: EIO_ERROR, .rmdir = EIO_ERROR,
mknod: EIO_ERROR, .mknod = EIO_ERROR,
rename: EIO_ERROR, .rename = EIO_ERROR,
readlink: EIO_ERROR, .readlink = EIO_ERROR,
follow_link: bad_follow_link, .follow_link = bad_follow_link,
truncate: EIO_ERROR, .truncate = EIO_ERROR,
permission: EIO_ERROR, .permission = EIO_ERROR,
getattr: EIO_ERROR, .getattr = EIO_ERROR,
}; };
......
...@@ -37,11 +37,11 @@ static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file); ...@@ -37,11 +37,11 @@ static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file);
extern void dump_thread(struct pt_regs *, struct user *); extern void dump_thread(struct pt_regs *, struct user *);
static struct linux_binfmt aout_format = { static struct linux_binfmt aout_format = {
module: THIS_MODULE, .module = THIS_MODULE,
load_binary: load_aout_binary, .load_binary = load_aout_binary,
load_shlib: load_aout_library, .load_shlib = load_aout_library,
core_dump: aout_core_dump, .core_dump = aout_core_dump,
min_coredump: PAGE_SIZE .min_coredump = PAGE_SIZE
}; };
static void set_brk(unsigned long start, unsigned long end) static void set_brk(unsigned long start, unsigned long end)
......
...@@ -71,11 +71,11 @@ static int elf_core_dump(long signr, struct pt_regs * regs, struct file * file); ...@@ -71,11 +71,11 @@ static int elf_core_dump(long signr, struct pt_regs * regs, struct file * file);
#define ELF_PAGEALIGN(_v) (((_v) + ELF_MIN_ALIGN - 1) & ~(ELF_MIN_ALIGN - 1)) #define ELF_PAGEALIGN(_v) (((_v) + ELF_MIN_ALIGN - 1) & ~(ELF_MIN_ALIGN - 1))
static struct linux_binfmt elf_format = { static struct linux_binfmt elf_format = {
module: THIS_MODULE, .module = THIS_MODULE,
load_binary: load_elf_binary, .load_binary = load_elf_binary,
load_shlib: load_elf_library, .load_shlib = load_elf_library,
core_dump: elf_core_dump, .core_dump = elf_core_dump,
min_coredump: ELF_EXEC_PAGESIZE .min_coredump = ELF_EXEC_PAGESIZE
}; };
#define BAD_ADDR(x) ((unsigned long)(x) > TASK_SIZE) #define BAD_ADDR(x) ((unsigned long)(x) > TASK_SIZE)
......
...@@ -96,8 +96,8 @@ static int load_em86(struct linux_binprm *bprm,struct pt_regs *regs) ...@@ -96,8 +96,8 @@ static int load_em86(struct linux_binprm *bprm,struct pt_regs *regs)
} }
struct linux_binfmt em86_format = { struct linux_binfmt em86_format = {
module: THIS_MODULE, .module = THIS_MODULE,
load_binary: load_em86, .load_binary = load_em86,
}; };
static int __init init_em86_binfmt(void) static int __init init_em86_binfmt(void)
......
...@@ -485,8 +485,8 @@ static ssize_t bm_entry_write(struct file *file, const char *buffer, ...@@ -485,8 +485,8 @@ static ssize_t bm_entry_write(struct file *file, const char *buffer,
} }
static struct file_operations bm_entry_operations = { static struct file_operations bm_entry_operations = {
read: bm_entry_read, .read = bm_entry_read,
write: bm_entry_write, .write = bm_entry_write,
}; };
static struct file_system_type bm_fs_type; static struct file_system_type bm_fs_type;
...@@ -566,7 +566,7 @@ static ssize_t bm_register_write(struct file *file, const char *buffer, ...@@ -566,7 +566,7 @@ static ssize_t bm_register_write(struct file *file, const char *buffer,
} }
static struct file_operations bm_register_operations = { static struct file_operations bm_register_operations = {
write: bm_register_write, .write = bm_register_write,
}; };
/* /status */ /* /status */
...@@ -613,21 +613,21 @@ static ssize_t bm_status_write(struct file * file, const char * buffer, ...@@ -613,21 +613,21 @@ static ssize_t bm_status_write(struct file * file, const char * buffer,
} }
static struct file_operations bm_status_operations = { static struct file_operations bm_status_operations = {
read: bm_status_read, .read = bm_status_read,
write: bm_status_write, .write = bm_status_write,
}; };
/* Superblock handling */ /* Superblock handling */
static struct super_operations s_ops = { static struct super_operations s_ops = {
statfs: simple_statfs, .statfs = simple_statfs,
drop_inode: generic_delete_inode, .drop_inode = generic_delete_inode,
clear_inode: bm_clear_inode, .clear_inode = bm_clear_inode,
}; };
static int bm_fill_super(struct super_block * sb, void * data, int silent) static int bm_fill_super(struct super_block * sb, void * data, int silent)
{ {
struct qstr names[2] = {{name:"status"}, {name:"register"}}; struct qstr names[2] = {{.name = "status"}, {.name = "register"}};
struct inode * inode; struct inode * inode;
struct dentry * dentry[3]; struct dentry * dentry[3];
int i; int i;
...@@ -688,15 +688,15 @@ static struct super_block *bm_get_sb(struct file_system_type *fs_type, ...@@ -688,15 +688,15 @@ static struct super_block *bm_get_sb(struct file_system_type *fs_type,
} }
static struct linux_binfmt misc_format = { static struct linux_binfmt misc_format = {
module: THIS_MODULE, .module = THIS_MODULE,
load_binary: load_misc_binary, .load_binary = load_misc_binary,
}; };
static struct file_system_type bm_fs_type = { static struct file_system_type bm_fs_type = {
owner: THIS_MODULE, .owner = THIS_MODULE,
name: "binfmt_misc", .name = "binfmt_misc",
get_sb: bm_get_sb, .get_sb = bm_get_sb,
kill_sb: kill_litter_super, .kill_sb = kill_litter_super,
}; };
static int __init init_misc_binfmt(void) static int __init init_misc_binfmt(void)
......
...@@ -95,8 +95,8 @@ static int load_script(struct linux_binprm *bprm,struct pt_regs *regs) ...@@ -95,8 +95,8 @@ static int load_script(struct linux_binprm *bprm,struct pt_regs *regs)
} }
struct linux_binfmt script_format = { struct linux_binfmt script_format = {
module: THIS_MODULE, .module = THIS_MODULE,
load_binary: load_script, .load_binary = load_script,
}; };
static int __init init_script_binfmt(void) static int __init init_script_binfmt(void)
......
...@@ -198,9 +198,9 @@ static struct super_block *bd_get_sb(struct file_system_type *fs_type, ...@@ -198,9 +198,9 @@ static struct super_block *bd_get_sb(struct file_system_type *fs_type,
} }
static struct file_system_type bd_type = { static struct file_system_type bd_type = {
name: "bdev", .name = "bdev",
get_sb: bd_get_sb, .get_sb = bd_get_sb,
kill_sb: kill_anon_super, .kill_sb = kill_anon_super,
}; };
static struct vfsmount *bd_mnt; static struct vfsmount *bd_mnt;
......
...@@ -168,7 +168,7 @@ int chrdev_open(struct inode * inode, struct file * filp) ...@@ -168,7 +168,7 @@ int chrdev_open(struct inode * inode, struct file * filp)
* depending on the special file... * depending on the special file...
*/ */
static struct file_operations def_chr_fops = { static struct file_operations def_chr_fops = {
open: chrdev_open, .open = chrdev_open,
}; };
/* /*
...@@ -199,7 +199,7 @@ static int sock_no_open(struct inode *irrelevant, struct file *dontcare) ...@@ -199,7 +199,7 @@ static int sock_no_open(struct inode *irrelevant, struct file *dontcare)
} }
static struct file_operations bad_sock_fops = { static struct file_operations bad_sock_fops = {
open: sock_no_open .open = sock_no_open
}; };
void init_special_inode(struct inode *inode, umode_t mode, int rdev) void init_special_inode(struct inode *inode, umode_t mode, int rdev)
......
...@@ -1211,13 +1211,13 @@ int dquot_transfer(struct inode *inode, struct iattr *iattr) ...@@ -1211,13 +1211,13 @@ int dquot_transfer(struct inode *inode, struct iattr *iattr)
* Definitions of diskquota operations. * Definitions of diskquota operations.
*/ */
struct dquot_operations dquot_operations = { struct dquot_operations dquot_operations = {
initialize: dquot_initialize, /* mandatory */ .initialize = dquot_initialize, /* mandatory */
drop: dquot_drop, /* mandatory */ .drop = dquot_drop, /* mandatory */
alloc_space: dquot_alloc_space, .alloc_space = dquot_alloc_space,
alloc_inode: dquot_alloc_inode, .alloc_inode = dquot_alloc_inode,
free_space: dquot_free_space, .free_space = dquot_free_space,
free_inode: dquot_free_inode, .free_inode = dquot_free_inode,
transfer: dquot_transfer .transfer = dquot_transfer
}; };
static inline void set_enable_flags(struct quota_info *dqopt, int type) static inline void set_enable_flags(struct quota_info *dqopt, int type)
...@@ -1471,13 +1471,13 @@ int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii) ...@@ -1471,13 +1471,13 @@ int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii)
} }
struct quotactl_ops vfs_quotactl_ops = { struct quotactl_ops vfs_quotactl_ops = {
quota_on: vfs_quota_on, .quota_on = vfs_quota_on,
quota_off: vfs_quota_off, .quota_off = vfs_quota_off,
quota_sync: vfs_quota_sync, .quota_sync = vfs_quota_sync,
get_info: vfs_get_dqinfo, .get_info = vfs_get_dqinfo,
set_info: vfs_set_dqinfo, .set_info = vfs_set_dqinfo,
get_dqblk: vfs_get_dqblk, .get_dqblk = vfs_get_dqblk,
set_dqblk: vfs_set_dqblk .set_dqblk = vfs_set_dqblk
}; };
static ctl_table fs_dqstats_table[] = { static ctl_table fs_dqstats_table[] = {
......
...@@ -154,5 +154,5 @@ static int fifo_open(struct inode *inode, struct file *filp) ...@@ -154,5 +154,5 @@ static int fifo_open(struct inode *inode, struct file *filp)
* depending on the access mode of the file... * depending on the access mode of the file...
*/ */
struct file_operations def_fifo_fops = { struct file_operations def_fifo_fops = {
open: fifo_open, /* will set read or write pipe_fops */ .open = fifo_open, /* will set read or write pipe_fops */
}; };
...@@ -32,7 +32,7 @@ int simple_sync_file(struct file * file, struct dentry *dentry, int datasync) ...@@ -32,7 +32,7 @@ int simple_sync_file(struct file * file, struct dentry *dentry, int datasync)
int dcache_dir_open(struct inode *inode, struct file *file) int dcache_dir_open(struct inode *inode, struct file *file)
{ {
static struct qstr cursor_name = {len:1, name:"."}; static struct qstr cursor_name = {.len = 1, .name = "."};
file->private_data = d_alloc(file->f_dentry, &cursor_name); file->private_data = d_alloc(file->f_dentry, &cursor_name);
...@@ -151,15 +151,15 @@ ssize_t generic_read_dir(struct file *filp, char *buf, size_t siz, loff_t *ppos) ...@@ -151,15 +151,15 @@ ssize_t generic_read_dir(struct file *filp, char *buf, size_t siz, loff_t *ppos)
} }
struct file_operations simple_dir_operations = { struct file_operations simple_dir_operations = {
open: dcache_dir_open, .open = dcache_dir_open,
release: dcache_dir_close, .release = dcache_dir_close,
llseek: dcache_dir_lseek, .llseek = dcache_dir_lseek,
read: generic_read_dir, .read = generic_read_dir,
readdir: dcache_readdir, .readdir = dcache_readdir,
}; };
struct inode_operations simple_dir_inode_operations = { struct inode_operations simple_dir_inode_operations = {
lookup: simple_lookup, .lookup = simple_lookup,
}; };
/* /*
...@@ -171,10 +171,10 @@ get_sb_pseudo(struct file_system_type *fs_type, char *name, ...@@ -171,10 +171,10 @@ get_sb_pseudo(struct file_system_type *fs_type, char *name,
struct super_operations *ops, unsigned long magic) struct super_operations *ops, unsigned long magic)
{ {
struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL); struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL);
static struct super_operations default_ops = {statfs: simple_statfs}; static struct super_operations default_ops = {.statfs = simple_statfs};
struct dentry *dentry; struct dentry *dentry;
struct inode *root; struct inode *root;
struct qstr d_name = {name:name, len:strlen(name)}; struct qstr d_name = {.name = name, .len = strlen(name)};
if (IS_ERR(s)) if (IS_ERR(s))
return s; return s;
......
...@@ -2230,6 +2230,6 @@ int page_symlink(struct inode *inode, const char *symname, int len) ...@@ -2230,6 +2230,6 @@ int page_symlink(struct inode *inode, const char *symname, int len)
} }
struct inode_operations page_symlink_inode_operations = { struct inode_operations page_symlink_inode_operations = {
readlink: page_readlink, .readlink = page_readlink,
follow_link: page_follow_link, .follow_link = page_follow_link,
}; };
...@@ -239,10 +239,10 @@ static int show_vfsmnt(struct seq_file *m, void *v) ...@@ -239,10 +239,10 @@ static int show_vfsmnt(struct seq_file *m, void *v)
} }
struct seq_operations mounts_op = { struct seq_operations mounts_op = {
start: m_start, .start = m_start,
next: m_next, .next = m_next,
stop: m_stop, .stop = m_stop,
show: show_vfsmnt .show = show_vfsmnt
}; };
/* /*
......
...@@ -444,69 +444,69 @@ pipe_rdwr_open(struct inode *inode, struct file *filp) ...@@ -444,69 +444,69 @@ pipe_rdwr_open(struct inode *inode, struct file *filp)
* are also used in linux/fs/fifo.c to do operations on FIFOs. * are also used in linux/fs/fifo.c to do operations on FIFOs.
*/ */
struct file_operations read_fifo_fops = { struct file_operations read_fifo_fops = {
llseek: no_llseek, .llseek = no_llseek,
read: pipe_read, .read = pipe_read,
write: bad_pipe_w, .write = bad_pipe_w,
poll: fifo_poll, .poll = fifo_poll,
ioctl: pipe_ioctl, .ioctl = pipe_ioctl,
open: pipe_read_open, .open = pipe_read_open,
release: pipe_read_release, .release = pipe_read_release,
fasync: pipe_read_fasync, .fasync = pipe_read_fasync,
}; };
struct file_operations write_fifo_fops = { struct file_operations write_fifo_fops = {
llseek: no_llseek, .llseek = no_llseek,
read: bad_pipe_r, .read = bad_pipe_r,
write: pipe_write, .write = pipe_write,
poll: fifo_poll, .poll = fifo_poll,
ioctl: pipe_ioctl, .ioctl = pipe_ioctl,
open: pipe_write_open, .open = pipe_write_open,
release: pipe_write_release, .release = pipe_write_release,
fasync: pipe_write_fasync, .fasync = pipe_write_fasync,
}; };
struct file_operations rdwr_fifo_fops = { struct file_operations rdwr_fifo_fops = {
llseek: no_llseek, .llseek = no_llseek,
read: pipe_read, .read = pipe_read,
write: pipe_write, .write = pipe_write,
poll: fifo_poll, .poll = fifo_poll,
ioctl: pipe_ioctl, .ioctl = pipe_ioctl,
open: pipe_rdwr_open, .open = pipe_rdwr_open,
release: pipe_rdwr_release, .release = pipe_rdwr_release,
fasync: pipe_rdwr_fasync, .fasync = pipe_rdwr_fasync,
}; };
struct file_operations read_pipe_fops = { struct file_operations read_pipe_fops = {
llseek: no_llseek, .llseek = no_llseek,
read: pipe_read, .read = pipe_read,
write: bad_pipe_w, .write = bad_pipe_w,
poll: pipe_poll, .poll = pipe_poll,
ioctl: pipe_ioctl, .ioctl = pipe_ioctl,
open: pipe_read_open, .open = pipe_read_open,
release: pipe_read_release, .release = pipe_read_release,
fasync: pipe_read_fasync, .fasync = pipe_read_fasync,
}; };
struct file_operations write_pipe_fops = { struct file_operations write_pipe_fops = {
llseek: no_llseek, .llseek = no_llseek,
read: bad_pipe_r, .read = bad_pipe_r,
write: pipe_write, .write = pipe_write,
poll: pipe_poll, .poll = pipe_poll,
ioctl: pipe_ioctl, .ioctl = pipe_ioctl,
open: pipe_write_open, .open = pipe_write_open,
release: pipe_write_release, .release = pipe_write_release,
fasync: pipe_write_fasync, .fasync = pipe_write_fasync,
}; };
struct file_operations rdwr_pipe_fops = { struct file_operations rdwr_pipe_fops = {
llseek: no_llseek, .llseek = no_llseek,
read: pipe_read, .read = pipe_read,
write: pipe_write, .write = pipe_write,
poll: pipe_poll, .poll = pipe_poll,
ioctl: pipe_ioctl, .ioctl = pipe_ioctl,
open: pipe_rdwr_open, .open = pipe_rdwr_open,
release: pipe_rdwr_release, .release = pipe_rdwr_release,
fasync: pipe_rdwr_fasync, .fasync = pipe_rdwr_fasync,
}; };
struct inode* pipe_new(struct inode* inode) struct inode* pipe_new(struct inode* inode)
...@@ -541,7 +541,7 @@ static int pipefs_delete_dentry(struct dentry *dentry) ...@@ -541,7 +541,7 @@ static int pipefs_delete_dentry(struct dentry *dentry)
return 1; return 1;
} }
static struct dentry_operations pipefs_dentry_operations = { static struct dentry_operations pipefs_dentry_operations = {
d_delete: pipefs_delete_dentry, .d_delete = pipefs_delete_dentry,
}; };
static struct inode * get_pipe_inode(void) static struct inode * get_pipe_inode(void)
...@@ -672,9 +672,9 @@ static struct super_block *pipefs_get_sb(struct file_system_type *fs_type, ...@@ -672,9 +672,9 @@ static struct super_block *pipefs_get_sb(struct file_system_type *fs_type,
} }
static struct file_system_type pipe_fs_type = { static struct file_system_type pipe_fs_type = {
name: "pipefs", .name = "pipefs",
get_sb: pipefs_get_sb, .get_sb = pipefs_get_sb,
kill_sb: kill_anon_super, .kill_sb = kill_anon_super,
}; };
static int __init init_pipe_fs(void) static int __init init_pipe_fs(void)
......
...@@ -210,18 +210,18 @@ static int v1_write_file_info(struct super_block *sb, int type) ...@@ -210,18 +210,18 @@ static int v1_write_file_info(struct super_block *sb, int type)
} }
static struct quota_format_ops v1_format_ops = { static struct quota_format_ops v1_format_ops = {
check_quota_file: v1_check_quota_file, .check_quota_file = v1_check_quota_file,
read_file_info: v1_read_file_info, .read_file_info = v1_read_file_info,
write_file_info: v1_write_file_info, .write_file_info = v1_write_file_info,
free_file_info: NULL, .free_file_info = NULL,
read_dqblk: v1_read_dqblk, .read_dqblk = v1_read_dqblk,
commit_dqblk: v1_commit_dqblk, .commit_dqblk = v1_commit_dqblk,
}; };
static struct quota_format_type v1_quota_format = { static struct quota_format_type v1_quota_format = {
qf_fmt_id: QFMT_VFS_OLD, .qf_fmt_id = QFMT_VFS_OLD,
qf_ops: &v1_format_ops, .qf_ops = &v1_format_ops,
qf_owner: THIS_MODULE .qf_owner = THIS_MODULE
}; };
static int __init init_v1_quota_format(void) static int __init init_v1_quota_format(void)
......
...@@ -662,18 +662,18 @@ static int v2_commit_dquot(struct dquot *dquot) ...@@ -662,18 +662,18 @@ static int v2_commit_dquot(struct dquot *dquot)
} }
static struct quota_format_ops v2_format_ops = { static struct quota_format_ops v2_format_ops = {
check_quota_file: v2_check_quota_file, .check_quota_file = v2_check_quota_file,
read_file_info: v2_read_file_info, .read_file_info = v2_read_file_info,
write_file_info: v2_write_file_info, .write_file_info = v2_write_file_info,
free_file_info: NULL, .free_file_info = NULL,
read_dqblk: v2_read_dquot, .read_dqblk = v2_read_dquot,
commit_dqblk: v2_commit_dquot, .commit_dqblk = v2_commit_dquot,
}; };
static struct quota_format_type v2_quota_format = { static struct quota_format_type v2_quota_format = {
qf_fmt_id: QFMT_VFS_V0, .qf_fmt_id = QFMT_VFS_V0,
qf_ops: &v2_format_ops, .qf_ops = &v2_format_ops,
qf_owner: THIS_MODULE .qf_owner = THIS_MODULE
}; };
static int __init init_v2_quota_format(void) static int __init init_v2_quota_format(void)
......
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
struct file_operations generic_ro_fops = { struct file_operations generic_ro_fops = {
llseek: generic_file_llseek, .llseek = generic_file_llseek,
read: generic_file_read, .read = generic_file_read,
mmap: generic_file_mmap, .mmap = generic_file_mmap,
sendfile: generic_file_sendfile, .sendfile = generic_file_sendfile,
}; };
loff_t generic_file_llseek(struct file *file, loff_t offset, int origin) loff_t generic_file_llseek(struct file *file, loff_t offset, int origin)
......
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