Skip to contentSkip to conversation

C99 designated initializer patch for fs/proc

PATCH Art Haas 1 participant 1 message Sep 28, 2002

Subsystems (2)
lore
Share & tools
lore

Art Haas

author
#0 lore raw

Hi.

Here's a small set of patches for fs/proc to use C99 initializers. The patches are all against 2.5.39.

Art Haas

fs/proc/base.c renamed from fs/proc/base.c.old +28 -28
@@ -310,7 +310,7 @@
 }
 
 static struct file_operations proc_maps_operations = {
-	read:		pid_maps_read,
+	.read		= pid_maps_read,
 };
 
 extern struct seq_operations mounts_op;
@@ -347,10 +347,10 @@
 }
 
 static struct file_operations proc_mounts_operations = {
-	open:		mounts_open,
-	read:		seq_read,
-	llseek:		seq_lseek,
-	release:	mounts_release,
+	.open		= mounts_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= mounts_release,
 };
 
 #define PROC_BLOCK_SIZE	(3*1024)		/* 4K page size but our output routines use some slack for overruns */
@@ -390,7 +390,7 @@
 }
 
 static struct file_operations proc_info_file_operations = {
-	read:		proc_info_read,
+	.read		= proc_info_read,
 };
 
 #define MAY_PTRACE(p) \
@@ -509,13 +509,13 @@
 #endif
 
 static struct file_operations proc_mem_operations = {
-	read:		mem_read,
-	write:		mem_write,
-	open:		mem_open,
+	.read		= mem_read,
+	.write		= mem_write,
+	.open		= mem_open,
 };
 
 static struct inode_operations proc_mem_inode_operations = {
-	permission:	proc_permission,
+	.permission	= proc_permission,
 };
 
 static int proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd)
@@ -587,8 +587,8 @@
 }
 
 static struct inode_operations proc_pid_link_inode_operations = {
-	readlink:	proc_pid_readlink,
-	follow_link:	proc_pid_follow_link
+	.readlink	= proc_pid_readlink,
+	.follow_link	= proc_pid_follow_link
 };
 
 #define NUMBUF 10
@@ -823,21 +823,21 @@
 
 static struct dentry_operations pid_fd_dentry_operations =
 {
-	d_revalidate:	pid_fd_revalidate,
-	d_delete:	pid_delete_dentry,
+	.d_revalidate	= pid_fd_revalidate,
+	.d_delete	= pid_delete_dentry,
 };
 
 static struct dentry_operations pid_dentry_operations =
 {
-	d_revalidate:	pid_revalidate,
-	d_delete:	pid_delete_dentry,
+	.d_revalidate	= pid_revalidate,
+	.d_delete	= pid_delete_dentry,
 };
 
 static struct dentry_operations pid_base_dentry_operations =
 {
-	d_revalidate:	pid_revalidate,
-	d_iput:		pid_base_iput,
-	d_delete:	pid_delete_dentry,
+	.d_revalidate	= pid_revalidate,
+	.d_iput		= pid_base_iput,
+	.d_delete	= pid_delete_dentry,
 };
 
 /* Lookups */
@@ -918,16 +918,16 @@
 }
 
 static struct file_operations proc_fd_operations = {
-	read:		generic_read_dir,
-	readdir:	proc_readfd,
+	.read		= generic_read_dir,
+	.readdir	= proc_readfd,
 };
 
 /*
  * proc directories can do almost nothing..
  */
 static struct inode_operations proc_fd_inode_operations = {
-	lookup:		proc_lookupfd,
-	permission:	proc_permission,
+	.lookup		= proc_lookupfd,
+	.permission	= proc_permission,
 };
 
 /* SMP-safe */
@@ -1032,12 +1032,12 @@
 }
 
 static struct file_operations proc_base_operations = {
-	read:		generic_read_dir,
-	readdir:	proc_base_readdir,
+	.read		= generic_read_dir,
+	.readdir	= proc_base_readdir,
 };
 
 static struct inode_operations proc_base_inode_operations = {
-	lookup:		proc_base_lookup,
+	.lookup		= proc_base_lookup,
 };
 
 /*
@@ -1058,8 +1058,8 @@
 }	
 
 static struct inode_operations proc_self_inode_operations = {
-	readlink:	proc_self_readlink,
-	follow_link:	proc_self_follow_link,
+	.readlink	= proc_self_readlink,
+	.follow_link	= proc_self_follow_link,
 };
 
 /* SMP-safe */
fs/proc/generic.c renamed from fs/proc/generic.c.old +9 -9
@@ -33,9 +33,9 @@
 }
 
 static struct file_operations proc_file_operations = {
-	llseek:		proc_file_lseek,
-	read:		proc_file_read,
-	write:		proc_file_write,
+	.llseek		= proc_file_lseek,
+	.read		= proc_file_read,
+	.write		= proc_file_write,
 };
 
 #ifndef MIN
@@ -230,8 +230,8 @@
 }
 
 static struct inode_operations proc_link_inode_operations = {
-	readlink:	proc_readlink,
-	follow_link:	proc_follow_link,
+	.readlink	= proc_readlink,
+	.follow_link	= proc_follow_link,
 };
 
 /*
@@ -247,7 +247,7 @@
 
 static struct dentry_operations proc_dentry_operations =
 {
-	d_delete:	proc_delete_dentry,
+	.d_delete	= proc_delete_dentry,
 };
 
 /*
@@ -359,15 +359,15 @@
  * the /proc directory.
  */
 static struct file_operations proc_dir_operations = {
-	read:			generic_read_dir,
-	readdir:		proc_readdir,
+	.read			= generic_read_dir,
+	.readdir		= proc_readdir,
 };
 
 /*
  * proc directories can do almost nothing..
  */
 static struct inode_operations proc_dir_inode_operations = {
-	lookup:		proc_lookup,
+	.lookup		= proc_lookup,
 };
 
 static int proc_register(struct proc_dir_entry * dir, struct proc_dir_entry * dp)
fs/proc/inode.c renamed from fs/proc/inode.c.old +6 -6
@@ -130,12 +130,12 @@
 }
 
 static struct super_operations proc_sops = { 
-	alloc_inode:	proc_alloc_inode,
-	destroy_inode:	proc_destroy_inode,
-	read_inode:	proc_read_inode,
-	drop_inode:	generic_delete_inode,
-	delete_inode:	proc_delete_inode,
-	statfs:		simple_statfs,
+	.alloc_inode	= proc_alloc_inode,
+	.destroy_inode	= proc_destroy_inode,
+	.read_inode	= proc_read_inode,
+	.drop_inode	= generic_delete_inode,
+	.delete_inode	= proc_delete_inode,
+	.statfs		= simple_statfs,
 };
 
 static int parse_options(char *options,uid_t *uid,gid_t *gid)
fs/proc/kcore.c renamed from fs/proc/kcore.c.old +2 -2
@@ -30,8 +30,8 @@
 static ssize_t read_kcore(struct file *, char *, size_t, loff_t *);
 
 struct file_operations proc_kcore_operations = {
-	read:		read_kcore,
-	open:		open_kcore,
+	.read		= read_kcore,
+	.open		= open_kcore,
 };
 
 #ifdef CONFIG_KCORE_AOUT
fs/proc/kmsg.c renamed from fs/proc/kmsg.c.old +4 -4
@@ -46,8 +46,8 @@
 
 
 struct file_operations proc_kmsg_operations = {
-	read:		kmsg_read,
-	poll:		kmsg_poll,
-	open:		kmsg_open,
-	release:	kmsg_release,
+	.read		= kmsg_read,
+	.poll		= kmsg_poll,
+	.open		= kmsg_open,
+	.release	= kmsg_release,
 };
fs/proc/proc_misc.c renamed from fs/proc/proc_misc.c.old +27 -27

96 lines not on this page · raw message

fs/proc/root.c renamed from fs/proc/root.c.old +14 -14
@@ -31,9 +31,9 @@
 }
 
 static struct file_system_type proc_fs_type = {
-	name:		"proc",
-	get_sb:		proc_get_sb,
-	kill_sb:	kill_anon_super,
+	.name		= "proc",
+	.get_sb		= proc_get_sb,
+	.kill_sb	= kill_anon_super,
 };
 
 extern int __init proc_init_inodecache(void);
@@ -122,29 +122,29 @@
  * directory handling functions for that..
  */
 static struct file_operations proc_root_operations = {
-	read:		 generic_read_dir,
-	readdir:	 proc_root_readdir,
+	.read		 = generic_read_dir,
+	.readdir	 = proc_root_readdir,
 };
 
 /*
  * proc root can do almost nothing..
  */
 static struct inode_operations proc_root_inode_operations = {
-	lookup:		proc_root_lookup,
+	.lookup		= proc_root_lookup,
 };
 
 /*
  * This is the root "inode" in the /proc tree..
  */
 struct proc_dir_entry proc_root = {
-	low_ino:	PROC_ROOT_INO, 
-	namelen:	5, 
-	name:		"/proc",
-	mode:		S_IFDIR | S_IRUGO | S_IXUGO, 
-	nlink:		2, 
-	proc_iops:	&proc_root_inode_operations, 
-	proc_fops:	&proc_root_operations,
-	parent:		&proc_root,
+	.low_ino	= PROC_ROOT_INO, 
+	.namelen	= 5, 
+	.name		= "/proc",
+	.mode		= S_IFDIR | S_IRUGO | S_IXUGO, 
+	.nlink		= 2, 
+	.proc_iops	= &proc_root_inode_operations, 
+	.proc_fops	= &proc_root_operations,
+	.parent		= &proc_root,
 };
 
 #ifdef CONFIG_SYSCTL
Signature · 3 lines
They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety.
 -- Benjamin Franklin, Historical Review of Pennsylvania, 1759