diff options
-rw-r--r-- | fs/proc/base.c | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 39a3d7c969c5..aeaf0d0f2f51 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -2255,27 +2255,6 @@ static const struct inode_operations proc_tgid_base_inode_operations = { | |||
2255 | .setattr = proc_setattr, | 2255 | .setattr = proc_setattr, |
2256 | }; | 2256 | }; |
2257 | 2257 | ||
2258 | /** | ||
2259 | * proc_flush_task - Remove dcache entries for @task from the /proc dcache. | ||
2260 | * | ||
2261 | * @task: task that should be flushed. | ||
2262 | * | ||
2263 | * Looks in the dcache for | ||
2264 | * /proc/@pid | ||
2265 | * /proc/@tgid/task/@pid | ||
2266 | * if either directory is present flushes it and all of it'ts children | ||
2267 | * from the dcache. | ||
2268 | * | ||
2269 | * It is safe and reasonable to cache /proc entries for a task until | ||
2270 | * that task exits. After that they just clog up the dcache with | ||
2271 | * useless entries, possibly causing useful dcache entries to be | ||
2272 | * flushed instead. This routine is proved to flush those useless | ||
2273 | * dcache entries at process exit time. | ||
2274 | * | ||
2275 | * NOTE: This routine is just an optimization so it does not guarantee | ||
2276 | * that no dcache entries will exist at process exit time it | ||
2277 | * just makes it very unlikely that any will persist. | ||
2278 | */ | ||
2279 | static void proc_flush_task_mnt(struct vfsmount *mnt, pid_t pid, pid_t tgid) | 2258 | static void proc_flush_task_mnt(struct vfsmount *mnt, pid_t pid, pid_t tgid) |
2280 | { | 2259 | { |
2281 | struct dentry *dentry, *leader, *dir; | 2260 | struct dentry *dentry, *leader, *dir; |
@@ -2322,10 +2301,29 @@ out: | |||
2322 | return; | 2301 | return; |
2323 | } | 2302 | } |
2324 | 2303 | ||
2325 | /* | 2304 | /** |
2326 | * when flushing dentries from proc one need to flush them from global | 2305 | * proc_flush_task - Remove dcache entries for @task from the /proc dcache. |
2306 | * @task: task that should be flushed. | ||
2307 | * | ||
2308 | * When flushing dentries from proc, one needs to flush them from global | ||
2327 | * proc (proc_mnt) and from all the namespaces' procs this task was seen | 2309 | * proc (proc_mnt) and from all the namespaces' procs this task was seen |
2328 | * in. this call is supposed to make all this job. | 2310 | * in. This call is supposed to do all of this job. |
2311 | * | ||
2312 | * Looks in the dcache for | ||
2313 | * /proc/@pid | ||
2314 | * /proc/@tgid/task/@pid | ||
2315 | * if either directory is present flushes it and all of it'ts children | ||
2316 | * from the dcache. | ||
2317 | * | ||
2318 | * It is safe and reasonable to cache /proc entries for a task until | ||
2319 | * that task exits. After that they just clog up the dcache with | ||
2320 | * useless entries, possibly causing useful dcache entries to be | ||
2321 | * flushed instead. This routine is proved to flush those useless | ||
2322 | * dcache entries at process exit time. | ||
2323 | * | ||
2324 | * NOTE: This routine is just an optimization so it does not guarantee | ||
2325 | * that no dcache entries will exist at process exit time it | ||
2326 | * just makes it very unlikely that any will persist. | ||
2329 | */ | 2327 | */ |
2330 | 2328 | ||
2331 | void proc_flush_task(struct task_struct *task) | 2329 | void proc_flush_task(struct task_struct *task) |