diff options
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 5eb02069e1b8..851ba3dcdc29 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -1107,13 +1107,6 @@ static ssize_t oom_adjust_write(struct file *file, const char __user *buf, | |||
1107 | goto err_sighand; | 1107 | goto err_sighand; |
1108 | } | 1108 | } |
1109 | 1109 | ||
1110 | if (oom_adjust != task->signal->oom_adj) { | ||
1111 | if (oom_adjust == OOM_DISABLE) | ||
1112 | atomic_inc(&task->mm->oom_disable_count); | ||
1113 | if (task->signal->oom_adj == OOM_DISABLE) | ||
1114 | atomic_dec(&task->mm->oom_disable_count); | ||
1115 | } | ||
1116 | |||
1117 | /* | 1110 | /* |
1118 | * Warn that /proc/pid/oom_adj is deprecated, see | 1111 | * Warn that /proc/pid/oom_adj is deprecated, see |
1119 | * Documentation/feature-removal-schedule.txt. | 1112 | * Documentation/feature-removal-schedule.txt. |
@@ -1215,12 +1208,6 @@ static ssize_t oom_score_adj_write(struct file *file, const char __user *buf, | |||
1215 | goto err_sighand; | 1208 | goto err_sighand; |
1216 | } | 1209 | } |
1217 | 1210 | ||
1218 | if (oom_score_adj != task->signal->oom_score_adj) { | ||
1219 | if (oom_score_adj == OOM_SCORE_ADJ_MIN) | ||
1220 | atomic_inc(&task->mm->oom_disable_count); | ||
1221 | if (task->signal->oom_score_adj == OOM_SCORE_ADJ_MIN) | ||
1222 | atomic_dec(&task->mm->oom_disable_count); | ||
1223 | } | ||
1224 | task->signal->oom_score_adj = oom_score_adj; | 1211 | task->signal->oom_score_adj = oom_score_adj; |
1225 | if (has_capability_noaudit(current, CAP_SYS_RESOURCE)) | 1212 | if (has_capability_noaudit(current, CAP_SYS_RESOURCE)) |
1226 | task->signal->oom_score_adj_min = oom_score_adj; | 1213 | task->signal->oom_score_adj_min = oom_score_adj; |
@@ -2261,7 +2248,7 @@ static struct dentry *proc_pident_instantiate(struct inode *dir, | |||
2261 | ei = PROC_I(inode); | 2248 | ei = PROC_I(inode); |
2262 | inode->i_mode = p->mode; | 2249 | inode->i_mode = p->mode; |
2263 | if (S_ISDIR(inode->i_mode)) | 2250 | if (S_ISDIR(inode->i_mode)) |
2264 | inode->i_nlink = 2; /* Use getattr to fix if necessary */ | 2251 | set_nlink(inode, 2); /* Use getattr to fix if necessary */ |
2265 | if (p->iop) | 2252 | if (p->iop) |
2266 | inode->i_op = p->iop; | 2253 | inode->i_op = p->iop; |
2267 | if (p->fop) | 2254 | if (p->fop) |
@@ -2655,7 +2642,7 @@ static struct dentry *proc_base_instantiate(struct inode *dir, | |||
2655 | 2642 | ||
2656 | inode->i_mode = p->mode; | 2643 | inode->i_mode = p->mode; |
2657 | if (S_ISDIR(inode->i_mode)) | 2644 | if (S_ISDIR(inode->i_mode)) |
2658 | inode->i_nlink = 2; | 2645 | set_nlink(inode, 2); |
2659 | if (S_ISLNK(inode->i_mode)) | 2646 | if (S_ISLNK(inode->i_mode)) |
2660 | inode->i_size = 64; | 2647 | inode->i_size = 64; |
2661 | if (p->iop) | 2648 | if (p->iop) |
@@ -2994,8 +2981,8 @@ static struct dentry *proc_pid_instantiate(struct inode *dir, | |||
2994 | inode->i_fop = &proc_tgid_base_operations; | 2981 | inode->i_fop = &proc_tgid_base_operations; |
2995 | inode->i_flags|=S_IMMUTABLE; | 2982 | inode->i_flags|=S_IMMUTABLE; |
2996 | 2983 | ||
2997 | inode->i_nlink = 2 + pid_entry_count_dirs(tgid_base_stuff, | 2984 | set_nlink(inode, 2 + pid_entry_count_dirs(tgid_base_stuff, |
2998 | ARRAY_SIZE(tgid_base_stuff)); | 2985 | ARRAY_SIZE(tgid_base_stuff))); |
2999 | 2986 | ||
3000 | d_set_d_op(dentry, &pid_dentry_operations); | 2987 | d_set_d_op(dentry, &pid_dentry_operations); |
3001 | 2988 | ||
@@ -3246,8 +3233,8 @@ static struct dentry *proc_task_instantiate(struct inode *dir, | |||
3246 | inode->i_fop = &proc_tid_base_operations; | 3233 | inode->i_fop = &proc_tid_base_operations; |
3247 | inode->i_flags|=S_IMMUTABLE; | 3234 | inode->i_flags|=S_IMMUTABLE; |
3248 | 3235 | ||
3249 | inode->i_nlink = 2 + pid_entry_count_dirs(tid_base_stuff, | 3236 | set_nlink(inode, 2 + pid_entry_count_dirs(tid_base_stuff, |
3250 | ARRAY_SIZE(tid_base_stuff)); | 3237 | ARRAY_SIZE(tid_base_stuff))); |
3251 | 3238 | ||
3252 | d_set_d_op(dentry, &pid_dentry_operations); | 3239 | d_set_d_op(dentry, &pid_dentry_operations); |
3253 | 3240 | ||