|
@@ -600,7 +600,7 @@ static int proc_fd_access_allowed(struct inode *inode)
|
|
return allowed;
|
|
return allowed;
|
|
}
|
|
}
|
|
|
|
|
|
-static int proc_setattr(struct dentry *dentry, struct iattr *attr)
|
|
|
|
|
|
+int proc_setattr(struct dentry *dentry, struct iattr *attr)
|
|
{
|
|
{
|
|
int error;
|
|
int error;
|
|
struct inode *inode = dentry->d_inode;
|
|
struct inode *inode = dentry->d_inode;
|
|
@@ -1736,8 +1736,7 @@ static int task_dumpable(struct task_struct *task)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-static struct inode *proc_pid_make_inode(struct super_block * sb, struct task_struct *task)
|
|
|
|
|
|
+struct inode *proc_pid_make_inode(struct super_block * sb, struct task_struct *task)
|
|
{
|
|
{
|
|
struct inode * inode;
|
|
struct inode * inode;
|
|
struct proc_inode *ei;
|
|
struct proc_inode *ei;
|
|
@@ -1779,7 +1778,7 @@ out_unlock:
|
|
return NULL;
|
|
return NULL;
|
|
}
|
|
}
|
|
|
|
|
|
-static int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
|
|
|
|
|
|
+int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
|
|
{
|
|
{
|
|
struct inode *inode = dentry->d_inode;
|
|
struct inode *inode = dentry->d_inode;
|
|
struct task_struct *task;
|
|
struct task_struct *task;
|
|
@@ -1820,7 +1819,7 @@ static int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat
|
|
* made this apply to all per process world readable and executable
|
|
* made this apply to all per process world readable and executable
|
|
* directories.
|
|
* directories.
|
|
*/
|
|
*/
|
|
-static int pid_revalidate(struct dentry *dentry, struct nameidata *nd)
|
|
|
|
|
|
+int pid_revalidate(struct dentry *dentry, struct nameidata *nd)
|
|
{
|
|
{
|
|
struct inode *inode;
|
|
struct inode *inode;
|
|
struct task_struct *task;
|
|
struct task_struct *task;
|
|
@@ -1862,7 +1861,7 @@ static int pid_delete_dentry(const struct dentry * dentry)
|
|
return !proc_pid(dentry->d_inode)->tasks[PIDTYPE_PID].first;
|
|
return !proc_pid(dentry->d_inode)->tasks[PIDTYPE_PID].first;
|
|
}
|
|
}
|
|
|
|
|
|
-static const struct dentry_operations pid_dentry_operations =
|
|
|
|
|
|
+const struct dentry_operations pid_dentry_operations =
|
|
{
|
|
{
|
|
.d_revalidate = pid_revalidate,
|
|
.d_revalidate = pid_revalidate,
|
|
.d_delete = pid_delete_dentry,
|
|
.d_delete = pid_delete_dentry,
|
|
@@ -1870,9 +1869,6 @@ static const struct dentry_operations pid_dentry_operations =
|
|
|
|
|
|
/* Lookups */
|
|
/* Lookups */
|
|
|
|
|
|
-typedef struct dentry *instantiate_t(struct inode *, struct dentry *,
|
|
|
|
- struct task_struct *, const void *);
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* Fill a directory entry.
|
|
* Fill a directory entry.
|
|
*
|
|
*
|
|
@@ -1885,8 +1881,8 @@ typedef struct dentry *instantiate_t(struct inode *, struct dentry *,
|
|
* reported by readdir in sync with the inode numbers reported
|
|
* reported by readdir in sync with the inode numbers reported
|
|
* by stat.
|
|
* by stat.
|
|
*/
|
|
*/
|
|
-static int proc_fill_cache(struct file *filp, void *dirent, filldir_t filldir,
|
|
|
|
- char *name, int len,
|
|
|
|
|
|
+int proc_fill_cache(struct file *filp, void *dirent, filldir_t filldir,
|
|
|
|
+ const char *name, int len,
|
|
instantiate_t instantiate, struct task_struct *task, const void *ptr)
|
|
instantiate_t instantiate, struct task_struct *task, const void *ptr)
|
|
{
|
|
{
|
|
struct dentry *child, *dir = filp->f_path.dentry;
|
|
struct dentry *child, *dir = filp->f_path.dentry;
|
|
@@ -2820,6 +2816,7 @@ static const struct pid_entry tgid_base_stuff[] = {
|
|
DIR("task", S_IRUGO|S_IXUGO, proc_task_inode_operations, proc_task_operations),
|
|
DIR("task", S_IRUGO|S_IXUGO, proc_task_inode_operations, proc_task_operations),
|
|
DIR("fd", S_IRUSR|S_IXUSR, proc_fd_inode_operations, proc_fd_operations),
|
|
DIR("fd", S_IRUSR|S_IXUSR, proc_fd_inode_operations, proc_fd_operations),
|
|
DIR("fdinfo", S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fdinfo_operations),
|
|
DIR("fdinfo", S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fdinfo_operations),
|
|
|
|
+ DIR("ns", S_IRUSR|S_IXUGO, proc_ns_dir_inode_operations, proc_ns_dir_operations),
|
|
#ifdef CONFIG_NET
|
|
#ifdef CONFIG_NET
|
|
DIR("net", S_IRUGO|S_IXUGO, proc_net_inode_operations, proc_net_operations),
|
|
DIR("net", S_IRUGO|S_IXUGO, proc_net_inode_operations, proc_net_operations),
|
|
#endif
|
|
#endif
|
|
@@ -3168,6 +3165,7 @@ out_no_task:
|
|
static const struct pid_entry tid_base_stuff[] = {
|
|
static const struct pid_entry tid_base_stuff[] = {
|
|
DIR("fd", S_IRUSR|S_IXUSR, proc_fd_inode_operations, proc_fd_operations),
|
|
DIR("fd", S_IRUSR|S_IXUSR, proc_fd_inode_operations, proc_fd_operations),
|
|
DIR("fdinfo", S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fdinfo_operations),
|
|
DIR("fdinfo", S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fdinfo_operations),
|
|
|
|
+ DIR("ns", S_IRUSR|S_IXUGO, proc_ns_dir_inode_operations, proc_ns_dir_operations),
|
|
REG("environ", S_IRUSR, proc_environ_operations),
|
|
REG("environ", S_IRUSR, proc_environ_operations),
|
|
INF("auxv", S_IRUSR, proc_pid_auxv),
|
|
INF("auxv", S_IRUSR, proc_pid_auxv),
|
|
ONE("status", S_IRUGO, proc_pid_status),
|
|
ONE("status", S_IRUGO, proc_pid_status),
|