patch-2.3.48 linux/fs/proc/generic.c

Next file: linux/fs/proc/inode.c
Previous file: linux/fs/proc/base.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.47/linux/fs/proc/generic.c linux/fs/proc/generic.c
@@ -37,10 +37,6 @@
 	write:		proc_file_write,
 };
 
-static struct inode_operations proc_file_inode_operations = {
-	&proc_file_operations,  /* default proc file-ops */
-};
-
 #ifndef MIN
 #define MIN(a,b) (((a) < (b)) ? (a) : (b))
 #endif
@@ -343,10 +339,8 @@
 /*
  * proc directories can do almost nothing..
  */
-struct inode_operations proc_dir_inode_operations = {
-	&proc_dir_operations,	/* default net directory file-ops */
-	NULL,			/* create */
-	proc_lookup,		/* lookup */
+static struct inode_operations proc_dir_inode_operations = {
+	lookup:		proc_lookup,
 };
 
 int proc_register(struct proc_dir_entry * dir, struct proc_dir_entry * dp)
@@ -361,15 +355,17 @@
 	dp->parent = dir;
 	dir->subdir = dp;
 	if (S_ISDIR(dp->mode)) {
-		if (dp->ops == NULL)
-			dp->ops = &proc_dir_inode_operations;
+		if (dp->proc_iops == NULL) {
+			dp->proc_fops = &proc_dir_operations;
+			dp->proc_iops = &proc_dir_inode_operations;
+		}
 		dir->nlink++;
 	} else if (S_ISLNK(dp->mode)) {
-		if (dp->ops == NULL)
-			dp->ops = &proc_link_inode_operations;
+		if (dp->proc_iops == NULL)
+			dp->proc_iops = &proc_link_inode_operations;
 	} else if (S_ISREG(dp->mode)) {
-		if (dp->ops == NULL)
-			dp->ops = &proc_file_inode_operations;
+		if (dp->proc_fops == NULL)
+			dp->proc_fops = &proc_file_operations;
 	}
 	return 0;
 }
@@ -490,7 +486,8 @@
 	memcpy(((char *) ent) + sizeof(*ent), fn, len + 1);
 	ent->name = ((char *) ent) + sizeof(*ent);
 	ent->namelen = len;
-	ent->ops = &proc_dir_inode_operations;
+	ent->proc_fops = &proc_dir_operations;
+	ent->proc_iops = &proc_dir_inode_operations;
 	ent->nlink = 2;
 	ent->mode = S_IFDIR | S_IRUGO | S_IXUGO;
 
@@ -522,7 +519,8 @@
 	if (S_ISDIR(mode)) {
 		if ((mode & S_IALLUGO) == 0)
 		mode |= S_IRUGO | S_IXUGO;
-		ent->ops = &proc_dir_inode_operations;
+		ent->proc_fops = &proc_dir_operations;
+		ent->proc_iops = &proc_dir_inode_operations;
 		ent->nlink = 2;
 	} else {
 		if ((mode & S_IFMT) == 0)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)