Linux Kernel
3.7.1
|
#include <asm/uaccess.h>
#include <linux/errno.h>
#include <linux/time.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/task_io_accounting_ops.h>
#include <linux/init.h>
#include <linux/capability.h>
#include <linux/file.h>
#include <linux/fdtable.h>
#include <linux/string.h>
#include <linux/seq_file.h>
#include <linux/namei.h>
#include <linux/mnt_namespace.h>
#include <linux/mm.h>
#include <linux/swap.h>
#include <linux/rcupdate.h>
#include <linux/kallsyms.h>
#include <linux/stacktrace.h>
#include <linux/resource.h>
#include <linux/module.h>
#include <linux/mount.h>
#include <linux/security.h>
#include <linux/ptrace.h>
#include <linux/tracehook.h>
#include <linux/cgroup.h>
#include <linux/cpuset.h>
#include <linux/audit.h>
#include <linux/poll.h>
#include <linux/nsproxy.h>
#include <linux/oom.h>
#include <linux/elf.h>
#include <linux/pid_namespace.h>
#include <linux/user_namespace.h>
#include <linux/fs_struct.h>
#include <linux/slab.h>
#include <linux/flex_array.h>
#include <trace/events/oom.h>
#include "internal.h"
#include "fd.h"
Go to the source code of this file.
Data Structures | |
struct | pid_entry |
struct | limit_names |
struct | tgid_iter |
Macros | |
#define | NOD(NAME, MODE, IOP, FOP, OP) |
#define | DIR(NAME, MODE, iops, fops) NOD(NAME, (S_IFDIR|(MODE)), &iops, &fops, {} ) |
#define | LNK(NAME, get_link) |
#define | REG(NAME, MODE, fops) NOD(NAME, (S_IFREG|(MODE)), NULL, &fops, {}) |
#define | INF(NAME, MODE, read) |
#define | ONE(NAME, MODE, show) |
#define | PROC_BLOCK_SIZE (3*1024) /* 4K page size but our output routines use some slack for overruns */ |
#define | TGID_OFFSET (FIRST_PROCESS_ENTRY + ARRAY_SIZE(proc_base_stuff)) |
Functions | |
int | proc_setattr (struct dentry *dentry, struct iattr *attr) |
loff_t | mem_lseek (struct file *file, loff_t offset, int orig) |
struct inode * | proc_pid_make_inode (struct super_block *sb, struct task_struct *task) |
int | pid_getattr (struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) |
int | pid_revalidate (struct dentry *dentry, unsigned int flags) |
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) |
void | proc_flush_task (struct task_struct *task) |
struct dentry * | proc_pid_lookup (struct inode *dir, struct dentry *dentry, unsigned int flags) |
int | proc_pid_readdir (struct file *filp, void *dirent, filldir_t filldir) |
Variables | |
struct inode_operations | proc_pid_link_inode_operations |
struct dentry_operations | pid_dentry_operations |
#define LNK | ( | NAME, | |
get_link | |||
) |
#define PROC_BLOCK_SIZE (3*1024) /* 4K page size but our output routines use some slack for overruns */ |
#define TGID_OFFSET (FIRST_PROCESS_ENTRY + ARRAY_SIZE(proc_base_stuff)) |
void proc_flush_task | ( | struct task_struct * | task | ) |
proc_flush_task - Remove dcache entries for from the /proc dcache. : task that should be flushed.
When flushing dentries from proc, one needs to flush them from global proc (proc_mnt) and from all the namespaces' procs this task was seen in. This call is supposed to do all of this job.
Looks in the dcache for /proc/ /proc//task/ if either directory is present flushes it and all of it'ts children from the dcache.
It is safe and reasonable to cache /proc entries for a task until that task exits. After that they just clog up the dcache with useless entries, possibly causing useful dcache entries to be flushed instead. This routine is proved to flush those useless dcache entries at process exit time.
NOTE: This routine is just an optimization so it does not guarantee that no dcache entries will exist at process exit time it just makes it very unlikely that any will persist.
|
read |
struct dentry_operations pid_dentry_operations |
struct inode_operations proc_pid_link_inode_operations |