From: Vyacheslav Cherkashin Date: Tue, 7 May 2013 08:43:18 +0000 (+0400) Subject: [REFACTOR] create field 'task' in 'srtuct sspt_procs' X-Git-Tag: Tizen_SDK_2.3~512 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=02662481d18de1276bd3c11a01f0d40018585ef7;p=kernel%2Fswap-modules.git [REFACTOR] create field 'task' in 'srtuct sspt_procs' --- diff --git a/driver/sspt/sspt_procs.c b/driver/sspt/sspt_procs.c index bae8d68..46ca2c2 100644 --- a/driver/sspt/sspt_procs.c +++ b/driver/sspt/sspt_procs.c @@ -29,13 +29,14 @@ static LIST_HEAD(proc_probes_list); -struct sspt_procs *sspt_procs_create(struct dentry* dentry, pid_t tgid) +struct sspt_procs *sspt_procs_create(struct dentry* dentry, struct task_struct *task) { struct sspt_procs *procs = kmalloc(sizeof(*procs), GFP_ATOMIC); if (procs) { INIT_LIST_HEAD(&procs->list); - procs->tgid = tgid; + procs->tgid = task ? task->tgid : 0; + procs->task = task; procs->dentry = dentry; procs->sm = NULL; INIT_LIST_HEAD(&procs->file_list); @@ -136,7 +137,7 @@ void sspt_procs_add_ip_data(struct sspt_procs *procs, struct dentry* dentry, struct sspt_procs *sspt_procs_copy(struct sspt_procs *procs, struct task_struct *task) { struct sspt_file *file; - struct sspt_procs *procs_out = sspt_procs_create(procs->dentry, task->tgid); + struct sspt_procs *procs_out = sspt_procs_create(procs->dentry, task); list_for_each_entry(file, &procs->file_list, list) { sspt_procs_add_file(procs_out, sspt_file_copy(file)); diff --git a/driver/sspt/sspt_procs.h b/driver/sspt/sspt_procs.h index 7a5855c..1099107 100644 --- a/driver/sspt/sspt_procs.h +++ b/driver/sspt/sspt_procs.h @@ -29,17 +29,19 @@ #include "sspt_file.h" struct slot_manager; +struct task_struct; struct sspt_procs { struct list_head list; pid_t tgid; + struct task_struct *task; struct dentry *dentry; struct slot_manager *sm; struct list_head file_list; }; -struct sspt_procs *sspt_procs_create(struct dentry* dentry, pid_t tgid); +struct sspt_procs *sspt_procs_create(struct dentry* dentry, struct task_struct *task); struct sspt_procs *sspt_procs_copy(struct sspt_procs *procs, struct task_struct *task); void sspt_procs_free(struct sspt_procs *procs); diff --git a/driver/us_proc_inst.c b/driver/us_proc_inst.c index 1ba4756..4a0a360 100644 --- a/driver/us_proc_inst.c +++ b/driver/us_proc_inst.c @@ -615,7 +615,7 @@ int register_usprobe(struct task_struct *task, struct us_ip *ip) } ip->jprobe.priv_arg = ip; - ip->jprobe.up.task = task; + ip->jprobe.up.task = ip->page->file->procs->task; ip->jprobe.up.sm = ip->page->file->procs->sm; ret = dbi_register_ujprobe(&ip->jprobe); if (ret) { @@ -636,7 +636,7 @@ int register_usprobe(struct task_struct *task, struct us_ip *ip) } ip->retprobe.priv_arg = ip; - ip->retprobe.up.task = task; + ip->retprobe.up.task = ip->page->file->procs->task; ip->retprobe.up.sm = ip->page->file->procs->sm; ret = dbi_register_uretprobe(&ip->retprobe); if (ret) {