mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
uprobes: Fold uprobe_reset_state() into uprobe_dup_mmap()
Now that we have uprobe_dup_mmap() we can fold uprobe_reset_state() into the new hook and remove it. mmput()->uprobe_clear_state() can't be called before dup_mmap(). Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
This commit is contained in:
parent
f8ac4ec9c0
commit
61559a8165
@ -118,7 +118,6 @@ extern void uprobe_notify_resume(struct pt_regs *regs);
|
|||||||
extern bool uprobe_deny_signal(void);
|
extern bool uprobe_deny_signal(void);
|
||||||
extern bool __weak arch_uprobe_skip_sstep(struct arch_uprobe *aup, struct pt_regs *regs);
|
extern bool __weak arch_uprobe_skip_sstep(struct arch_uprobe *aup, struct pt_regs *regs);
|
||||||
extern void uprobe_clear_state(struct mm_struct *mm);
|
extern void uprobe_clear_state(struct mm_struct *mm);
|
||||||
extern void uprobe_reset_state(struct mm_struct *mm);
|
|
||||||
#else /* !CONFIG_UPROBES */
|
#else /* !CONFIG_UPROBES */
|
||||||
struct uprobes_state {
|
struct uprobes_state {
|
||||||
};
|
};
|
||||||
@ -163,8 +162,5 @@ static inline void uprobe_copy_process(struct task_struct *t)
|
|||||||
static inline void uprobe_clear_state(struct mm_struct *mm)
|
static inline void uprobe_clear_state(struct mm_struct *mm)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
static inline void uprobe_reset_state(struct mm_struct *mm)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif /* !CONFIG_UPROBES */
|
#endif /* !CONFIG_UPROBES */
|
||||||
#endif /* _LINUX_UPROBES_H */
|
#endif /* _LINUX_UPROBES_H */
|
||||||
|
@ -1148,16 +1148,10 @@ void uprobe_clear_state(struct mm_struct *mm)
|
|||||||
kfree(area);
|
kfree(area);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* uprobe_reset_state - Free the area allocated for slots.
|
|
||||||
*/
|
|
||||||
void uprobe_reset_state(struct mm_struct *mm)
|
|
||||||
{
|
|
||||||
mm->uprobes_state.xol_area = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm)
|
void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm)
|
||||||
{
|
{
|
||||||
|
newmm->uprobes_state.xol_area = NULL;
|
||||||
|
|
||||||
if (test_bit(MMF_HAS_UPROBES, &oldmm->flags))
|
if (test_bit(MMF_HAS_UPROBES, &oldmm->flags))
|
||||||
set_bit(MMF_HAS_UPROBES, &newmm->flags);
|
set_bit(MMF_HAS_UPROBES, &newmm->flags);
|
||||||
}
|
}
|
||||||
|
@ -837,8 +837,6 @@ struct mm_struct *dup_mm(struct task_struct *tsk)
|
|||||||
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
|
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
|
||||||
mm->pmd_huge_pte = NULL;
|
mm->pmd_huge_pte = NULL;
|
||||||
#endif
|
#endif
|
||||||
uprobe_reset_state(mm);
|
|
||||||
|
|
||||||
if (!mm_init(mm, tsk))
|
if (!mm_init(mm, tsk))
|
||||||
goto fail_nomem;
|
goto fail_nomem;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user