summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Aksenov <a.aksenov@samsung.com>2014-10-20 14:21:16 +0400
committerAlexander Aksenov <a.aksenov@samsung.com>2015-02-24 11:18:32 +0300
commit640ff97831eabd2d8f0c33a10404c33f3b7102c5 (patch)
tree8b1540a260a4241b8a8ba0e59c02136d07e9ba6a
parentcbd0d6f9aa0913307a5bcf8a1ec861e8664d0c1d (diff)
downloadswap-modules-640ff97831eabd2d8f0c33a10404c33f3b7102c5.tar.gz
swap-modules-640ff97831eabd2d8f0c33a10404c33f3b7102c5.tar.bz2
swap-modules-640ff97831eabd2d8f0c33a10404c33f3b7102c5.zip
[REFACTOR] ip struct page initialization
*page field now is filled at create_ip() Change-Id: I8e3d32da5d0bd7d0d5512b4897d6523e3410be16 Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
-rw-r--r--us_manager/sspt/ip.c5
-rw-r--r--us_manager/sspt/ip.h3
-rw-r--r--us_manager/sspt/sspt_file.c2
-rw-r--r--us_manager/sspt/sspt_page.c1
4 files changed, 7 insertions, 4 deletions
diff --git a/us_manager/sspt/ip.c b/us_manager/sspt/ip.c
index 6e85c871..91ef57f7 100644
--- a/us_manager/sspt/ip.c
+++ b/us_manager/sspt/ip.c
@@ -35,9 +35,11 @@
* @param page User page
* @param offset Function offset from the beginning of the page
* @param probe_i Pointer to the probe data.
+ * @param page Pointer to the parent sspt_page struct
* @return Pointer to the created us_ip struct
*/
-struct us_ip *create_ip(unsigned long offset, const struct probe_info *probe_i)
+struct us_ip *create_ip(unsigned long offset, const struct probe_info *probe_i,
+ struct sspt_page *page)
{
size_t len = probe_i->size;
struct us_ip *ip;
@@ -48,6 +50,7 @@ struct us_ip *create_ip(unsigned long offset, const struct probe_info *probe_i)
INIT_LIST_HEAD(&ip->list);
ip->offset = offset;
+ ip->page = page;
probe_info_copy(probe_i, &ip->probe_i);
probe_info_init(&ip->probe_i, ip);
diff --git a/us_manager/sspt/ip.h b/us_manager/sspt/ip.h
index 27737ce4..7229f036 100644
--- a/us_manager/sspt/ip.h
+++ b/us_manager/sspt/ip.h
@@ -50,7 +50,8 @@ struct us_ip {
#define to_us_ip(rp) container_of(rp, struct us_ip, retprobe)
-struct us_ip *create_ip(unsigned long offset, const struct probe_info *probe_i);
+struct us_ip *create_ip(unsigned long offset, const struct probe_info *probe_i,
+ struct sspt_page *page);
void free_ip(struct us_ip *ip);
#endif /* __IP__ */
diff --git a/us_manager/sspt/sspt_file.c b/us_manager/sspt/sspt_file.c
index 91b0cdf1..86fb4485 100644
--- a/us_manager/sspt/sspt_file.c
+++ b/us_manager/sspt/sspt_file.c
@@ -172,7 +172,7 @@ void sspt_file_add_ip(struct sspt_file *file, unsigned long offset,
struct sspt_page *page = sspt_find_page_or_new(file, offset & PAGE_MASK);
// FIXME: delete ip
- struct us_ip *ip = create_ip(offset, probe_i);
+ struct us_ip *ip = create_ip(offset, probe_i, page);
sspt_add_ip(page, ip);
}
diff --git a/us_manager/sspt/sspt_page.c b/us_manager/sspt/sspt_page.c
index 31369cf3..64eab790 100644
--- a/us_manager/sspt/sspt_page.c
+++ b/us_manager/sspt/sspt_page.c
@@ -77,7 +77,6 @@ void sspt_page_free(struct sspt_page *page)
static void sspt_list_add_ip(struct sspt_page *page, struct us_ip *ip)
{
list_add(&ip->list, &page->ip_list_no_inst);
- ip->page = page;
}
static void sspt_list_del_ip(struct us_ip *ip)