patch-2.3.27 linux/include/linux/proc_fs.h

Next file: linux/include/linux/proc_fs_i.h
Previous file: linux/include/linux/parport.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.26/linux/include/linux/proc_fs.h linux/include/linux/proc_fs.h
@@ -9,6 +9,12 @@
  */
 
 /*
+ * Offset of the first process in the /proc root directory..
+ */
+#define FIRST_PROCESS_ENTRY 256
+
+
+/*
  * We always define these enumerators
  */
 
@@ -16,111 +22,6 @@
 	PROC_ROOT_INO = 1,
 };
 
-enum pid_directory_inos {
-	PROC_PID_INO = 2,
-	PROC_PID_STATUS,
-	PROC_PID_MEM,
-	PROC_PID_CWD,
-	PROC_PID_ROOT,
-	PROC_PID_EXE,
-	PROC_PID_FD,
-	PROC_PID_ENVIRON,
-	PROC_PID_CMDLINE,
-	PROC_PID_STAT,
-	PROC_PID_STATM,
-	PROC_PID_MAPS,
-#if CONFIG_AP1000
-	PROC_PID_RINGBUF,
-#endif
-	PROC_PID_CPU,
-};
-
-enum pid_subdirectory_inos {
-	PROC_PID_FD_DIR = 0x8000,	/* 0x8000-0xffff */
-};
-
-enum net_directory_inos {
-	PROC_NET_LAST
-};
-
-enum scsi_directory_inos {
-	PROC_SCSI_SCSI = 256,
-	PROC_SCSI_ADVANSYS,
-	PROC_SCSI_PCI2000,
-	PROC_SCSI_PCI2220I,
-	PROC_SCSI_PSI240I,
-	PROC_SCSI_EATA,
-	PROC_SCSI_EATA_PIO,
-	PROC_SCSI_AHA152X,
-	PROC_SCSI_AHA1542,
-	PROC_SCSI_AHA1740,
-	PROC_SCSI_AIC7XXX,
-	PROC_SCSI_BUSLOGIC,
-	PROC_SCSI_U14_34F,
-	PROC_SCSI_FDOMAIN,
-	PROC_SCSI_GDTH,
-	PROC_SCSI_GENERIC_NCR5380,
-	PROC_SCSI_IN2000,
-	PROC_SCSI_PAS16,
-	PROC_SCSI_QLOGICFAS,
-	PROC_SCSI_QLOGICISP,
-	PROC_SCSI_QLOGICFC,
-	PROC_SCSI_SEAGATE,
-	PROC_SCSI_T128,
-	PROC_SCSI_NCR53C7xx,
-	PROC_SCSI_SYM53C8XX,
-	PROC_SCSI_NCR53C8XX,
-	PROC_SCSI_ULTRASTOR,
-	PROC_SCSI_7000FASST,
-	PROC_SCSI_IBMMCA,
-	PROC_SCSI_FD_MCS,
-	PROC_SCSI_EATA2X,
-	PROC_SCSI_DC390T,
-	PROC_SCSI_AM53C974,
-	PROC_SCSI_SSC,
-	PROC_SCSI_NCR53C406A,
-	PROC_SCSI_SYM53C416,
-	PROC_SCSI_MEGARAID,
-	PROC_SCSI_PPA,
-	PROC_SCSI_ATP870U,
-	PROC_SCSI_ESP,
-	PROC_SCSI_QLOGICPTI,
-	PROC_SCSI_AMIGA7XX,
-	PROC_SCSI_MVME147,
-	PROC_SCSI_MVME16x,
-	PROC_SCSI_BVME6000,
-	PROC_SCSI_SIM710,
-	PROC_SCSI_A3000,
-	PROC_SCSI_A2091,
-	PROC_SCSI_GVP11,
-	PROC_SCSI_ATARI,
-	PROC_SCSI_MAC,
-	PROC_SCSI_IDESCSI,
-	PROC_SCSI_SGIWD93,
-	PROC_SCSI_MESH,
-	PROC_SCSI_53C94,
-	PROC_SCSI_PLUTO,
-	PROC_SCSI_INI9100U,
-	PROC_SCSI_INIA100,
- 	PROC_SCSI_IPH5526_FC,
-	PROC_SCSI_FCAL,
-	PROC_SCSI_I2O,
-	PROC_SCSI_USB_SCSI,
-	PROC_SCSI_SCSI_DEBUG,	
-	PROC_SCSI_NOT_PRESENT,
-	PROC_SCSI_FILE,                        /* I'm assuming here that we */
-	PROC_SCSI_LAST = (PROC_SCSI_FILE + 16) /* won't ever see more than */
-};                                             /* 16 HBAs in one machine   */
-
-enum mca_directory_inos {
-	PROC_MCA_MACHINE = (PROC_SCSI_LAST+1),
-	PROC_MCA_REGISTERS,
-	PROC_MCA_VIDEO,
-	PROC_MCA_SCSI,
-	PROC_MCA_SLOT,	/* the 8 adapter slots */
-	PROC_MCA_LAST = (PROC_MCA_SLOT + 8)
-};
-
 /* Finally, the dynamically allocatable proc entries are reserved: */
 
 #define PROC_DYNAMIC_FIRST 4096
@@ -144,9 +45,8 @@
  * /proc file has a parent, but "subdir" is NULL for all
  * non-directory entries).
  *
- * "get_info" is called at "read", while "fill_inode" is used to
- * fill in file type/protection/owner information specific to the
- * particular /proc file.
+ * "get_info" is called at "read", while "owner" is used to protect module
+ * from unloading while proc_dir_entry is in use
  */
 
 typedef	int (read_proc_t)(char *page, char **start, off_t off,
@@ -166,7 +66,7 @@
 	unsigned long size;
 	struct inode_operations * ops;
 	get_info_t *get_info;
-	void (*fill_inode)(struct inode *, int);
+	struct module *owner;
 	struct proc_dir_entry *next, *parent, *subdir;
 	void *data;
 	read_proc_t *read_proc;
@@ -176,30 +76,30 @@
 	int deleted;		/* delete flag */
 };
 
-extern int (* dispatch_scsi_info_ptr) (int ino, char *buffer, char **start,
-				off_t offset, int length, int inout);
+#define PROC_INODE_PROPER(inode) ((inode)->i_ino & ~0xffff)
+#define PROC_INODE_OPENPROM(inode) \
+	((inode->i_ino >= PROC_OPENPROM_FIRST) \
+	    && (inode->i_ino < PROC_OPENPROM_FIRST + PROC_NOPENPROM))
 
 #ifdef CONFIG_PROC_FS
 
 extern struct proc_dir_entry proc_root;
 extern struct proc_dir_entry *proc_root_fs;
 extern struct proc_dir_entry *proc_net;
-extern struct proc_dir_entry *proc_scsi;
 extern struct proc_dir_entry proc_sys;
 extern struct proc_dir_entry proc_openprom;
-extern struct proc_dir_entry proc_pid;
-extern struct proc_dir_entry proc_pid_fd;
 extern struct proc_dir_entry *proc_mca;
 extern struct proc_dir_entry *proc_bus;
-extern struct proc_dir_entry *proc_sysvipc;
 extern struct proc_dir_entry *proc_root_driver;
-
-extern struct inode_operations proc_scsi_inode_operations;
+extern struct proc_dir_entry proc_root_kcore;
 
 extern void proc_root_init(void);
-extern void proc_base_init(void);
 extern void proc_misc_init(void);
 
+struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry);
+void proc_pid_delete_inode(struct inode *inode);
+int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir);
+
 extern int proc_register(struct proc_dir_entry *, struct proc_dir_entry *);
 extern int proc_unregister(struct proc_dir_entry *, int);
 
@@ -208,39 +108,6 @@
 extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent);
 
 
-extern inline int proc_scsi_register(struct proc_dir_entry *driver, 
-				     struct proc_dir_entry *x)
-{
-    x->ops = &proc_scsi_inode_operations;
-    if(x->low_ino < PROC_SCSI_FILE){
-	return(proc_register(proc_scsi, x));
-    }else{
-	return(proc_register(driver, x));
-    }
-}
-
-extern inline int proc_scsi_unregister(struct proc_dir_entry *driver, int x)
-{
-    extern void scsi_init_free(char *ptr, unsigned int size);
-
-    if(x < PROC_SCSI_FILE)
-	return(proc_unregister(proc_scsi, x));
-    else {
-	struct proc_dir_entry **p = &driver->subdir, *dp;
-	int ret;
-
-	while ((dp = *p) != NULL) {
-		if (dp->low_ino == x) 
-		    break;
-		p = &dp->next;
-	}
-	ret = proc_unregister(driver, x);
-	scsi_init_free((char *) dp, sizeof(struct proc_dir_entry) + 4);
-	return(ret);
-    }
-}
-
-
 /*
  * retrieve the proc_dir_entry associated with /proc/driver/$module_name
  */
@@ -282,8 +149,6 @@
         return (p == NULL) ? -1 : 0;
 }
 
-
-
 extern struct super_block *proc_super_blocks;
 extern struct dentry_operations proc_dentry_operations;
 extern struct super_block *proc_read_super(struct super_block *,void *,int);
@@ -292,7 +157,6 @@
 extern int proc_statfs(struct super_block *, struct statfs *, int);
 extern void proc_read_inode(struct inode *);
 extern void proc_write_inode(struct inode *);
-extern int proc_permission(struct inode *, int);
 
 extern int proc_match(int, const char *,struct proc_dir_entry *);
 
@@ -326,23 +190,16 @@
   
 extern struct inode_operations proc_dir_inode_operations;
 extern struct inode_operations proc_file_inode_operations;
-extern struct inode_operations proc_netdir_inode_operations;
 extern struct inode_operations proc_openprom_inode_operations;
-extern struct inode_operations proc_mem_inode_operations;
 extern struct inode_operations proc_sys_inode_operations;
-extern struct inode_operations proc_array_inode_operations;
-extern struct inode_operations proc_arraylong_inode_operations;
 extern struct inode_operations proc_kcore_inode_operations;
 extern struct inode_operations proc_profile_inode_operations;
 extern struct inode_operations proc_kmsg_inode_operations;
-extern struct inode_operations proc_link_inode_operations;
-extern struct inode_operations proc_fd_inode_operations;
 #if CONFIG_AP1000
 extern struct inode_operations proc_ringbuf_inode_operations;
 #endif
 extern struct inode_operations proc_omirr_inode_operations;
 extern struct inode_operations proc_ppc_htab_inode_operations;
-extern struct inode_operations proc_sysvipc_inode_operations;
 
 /*
  * proc_tty.c
@@ -387,16 +244,6 @@
 	remove_proc_entry(name,proc_net);
 }
 
-extern inline int proc_net_register(struct proc_dir_entry * x)
-{
-	return proc_register(proc_net, x);
-}
-
-extern inline int proc_net_unregister(int x)
-{
-	return proc_unregister(proc_net, x);
-}
-
 #else
 
 extern inline int proc_register(struct proc_dir_entry *a, struct proc_dir_entry *b) { return 0; }
@@ -404,10 +251,6 @@
 extern inline struct proc_dir_entry *proc_net_create(const char *name, mode_t mode, 
 	get_info_t *get_info) {return NULL;}
 extern inline void proc_net_remove(const char *name) {}
-extern inline int proc_net_register(struct proc_dir_entry * x) { return 0; }
-extern inline int proc_net_unregister(int x) { return 0; }
-extern inline int proc_scsi_register(struct proc_dir_entry *b, struct proc_dir_entry *c) { return 0; }
-extern inline int proc_scsi_unregister(struct proc_dir_entry *a, int x) { return 0; }
 
 extern inline struct proc_dir_entry *create_proc_entry(const char *name,
 	mode_t mode, struct proc_dir_entry *parent) { return NULL; }

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