Coverage Report

Created: 2026-11-28 06:58

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/barebox/fs/squashfs/page_actor.h
Line
Count
Source
1
#ifndef PAGE_ACTOR_H
2
#define PAGE_ACTOR_H
3
/*
4
 * Copyright (c) 2013
5
 * Phillip Lougher <phillip@squashfs.org.uk>
6
 *
7
 * This work is licensed under the terms of the GNU GPL, version 2. See
8
 * the COPYING file in the top-level directory.
9
 */
10
11
#include <malloc.h>
12
#include <linux/barebox-wrapper.h>
13
#include <linux/pagemap.h>
14
15
struct squashfs_page_actor {
16
  void  **page;
17
  int pages;
18
  int length;
19
  int next_page;
20
};
21
22
static inline struct squashfs_page_actor *squashfs_page_actor_init(void **page,
23
  int pages, int length)
24
97.6k
{
25
97.6k
  struct squashfs_page_actor *actor = kmalloc(sizeof(*actor), GFP_KERNEL);
26
27
97.6k
  if (actor == NULL)
28
0
    return NULL;
29
30
97.6k
  actor->length = length ? : pages * PAGE_CACHE_SIZE;
31
97.6k
  actor->page = page;
32
97.6k
  actor->pages = pages;
33
97.6k
  actor->next_page = 0;
34
97.6k
  return actor;
35
97.6k
}
Unexecuted instantiation: block.c:squashfs_page_actor_init
cache.c:squashfs_page_actor_init
Line
Count
Source
24
95.6k
{
25
95.6k
  struct squashfs_page_actor *actor = kmalloc(sizeof(*actor), GFP_KERNEL);
26
27
95.6k
  if (actor == NULL)
28
0
    return NULL;
29
30
95.6k
  actor->length = length ? : pages * PAGE_CACHE_SIZE;
31
95.6k
  actor->page = page;
32
95.6k
  actor->pages = pages;
33
95.6k
  actor->next_page = 0;
34
95.6k
  return actor;
35
95.6k
}
decompressor.c:squashfs_page_actor_init
Line
Count
Source
24
1.99k
{
25
1.99k
  struct squashfs_page_actor *actor = kmalloc(sizeof(*actor), GFP_KERNEL);
26
27
1.99k
  if (actor == NULL)
28
0
    return NULL;
29
30
1.99k
  actor->length = length ? : pages * PAGE_CACHE_SIZE;
31
1.99k
  actor->page = page;
32
1.99k
  actor->pages = pages;
33
1.99k
  actor->next_page = 0;
34
1.99k
  return actor;
35
1.99k
}
Unexecuted instantiation: super.c:squashfs_page_actor_init
Unexecuted instantiation: xz_wrapper.c:squashfs_page_actor_init
Unexecuted instantiation: lzo_wrapper.c:squashfs_page_actor_init
Unexecuted instantiation: lz4_wrapper.c:squashfs_page_actor_init
Unexecuted instantiation: zlib_wrapper.c:squashfs_page_actor_init
Unexecuted instantiation: zstd_wrapper.c:squashfs_page_actor_init
36
37
static inline void *squashfs_first_page(struct squashfs_page_actor *actor)
38
241k
{
39
241k
  actor->next_page = 1;
40
241k
  return actor->page[0];
41
241k
}
block.c:squashfs_first_page
Line
Count
Source
38
141k
{
39
141k
  actor->next_page = 1;
40
141k
  return actor->page[0];
41
141k
}
Unexecuted instantiation: cache.c:squashfs_first_page
Unexecuted instantiation: decompressor.c:squashfs_first_page
Unexecuted instantiation: super.c:squashfs_first_page
xz_wrapper.c:squashfs_first_page
Line
Count
Source
38
26.3k
{
39
26.3k
  actor->next_page = 1;
40
26.3k
  return actor->page[0];
41
26.3k
}
lzo_wrapper.c:squashfs_first_page
Line
Count
Source
38
743
{
39
743
  actor->next_page = 1;
40
743
  return actor->page[0];
41
743
}
lz4_wrapper.c:squashfs_first_page
Line
Count
Source
38
985
{
39
985
  actor->next_page = 1;
40
985
  return actor->page[0];
41
985
}
zlib_wrapper.c:squashfs_first_page
Line
Count
Source
38
18.7k
{
39
18.7k
  actor->next_page = 1;
40
18.7k
  return actor->page[0];
41
18.7k
}
zstd_wrapper.c:squashfs_first_page
Line
Count
Source
38
53.7k
{
39
53.7k
  actor->next_page = 1;
40
53.7k
  return actor->page[0];
41
53.7k
}
42
43
static inline void *squashfs_next_page(struct squashfs_page_actor *actor)
44
121k
{
45
121k
  return actor->next_page == actor->pages ? NULL :
46
121k
    actor->page[actor->next_page++];
47
121k
}
block.c:squashfs_next_page
Line
Count
Source
44
1.81k
{
45
1.81k
  return actor->next_page == actor->pages ? NULL :
46
1.81k
    actor->page[actor->next_page++];
47
1.81k
}
Unexecuted instantiation: cache.c:squashfs_next_page
Unexecuted instantiation: decompressor.c:squashfs_next_page
Unexecuted instantiation: super.c:squashfs_next_page
xz_wrapper.c:squashfs_next_page
Line
Count
Source
44
78.7k
{
45
78.7k
  return actor->next_page == actor->pages ? NULL :
46
78.7k
    actor->page[actor->next_page++];
47
78.7k
}
lzo_wrapper.c:squashfs_next_page
Line
Count
Source
44
7.32k
{
45
7.32k
  return actor->next_page == actor->pages ? NULL :
46
7.32k
    actor->page[actor->next_page++];
47
7.32k
}
lz4_wrapper.c:squashfs_next_page
Line
Count
Source
44
8.96k
{
45
8.96k
  return actor->next_page == actor->pages ? NULL :
46
8.96k
    actor->page[actor->next_page++];
47
8.96k
}
zlib_wrapper.c:squashfs_next_page
Line
Count
Source
44
1.14k
{
45
1.14k
  return actor->next_page == actor->pages ? NULL :
46
1.14k
    actor->page[actor->next_page++];
47
1.14k
}
zstd_wrapper.c:squashfs_next_page
Line
Count
Source
44
23.3k
{
45
23.3k
  return actor->next_page == actor->pages ? NULL :
46
23.3k
    actor->page[actor->next_page++];
47
23.3k
}
48
49
static inline void squashfs_finish_page(struct squashfs_page_actor *actor)
50
241k
{
51
  /* empty */
52
241k
}
block.c:squashfs_finish_page
Line
Count
Source
50
141k
{
51
  /* empty */
52
141k
}
Unexecuted instantiation: cache.c:squashfs_finish_page
Unexecuted instantiation: decompressor.c:squashfs_finish_page
Unexecuted instantiation: super.c:squashfs_finish_page
xz_wrapper.c:squashfs_finish_page
Line
Count
Source
50
26.3k
{
51
  /* empty */
52
26.3k
}
lzo_wrapper.c:squashfs_finish_page
Line
Count
Source
50
743
{
51
  /* empty */
52
743
}
lz4_wrapper.c:squashfs_finish_page
Line
Count
Source
50
985
{
51
  /* empty */
52
985
}
zlib_wrapper.c:squashfs_finish_page
Line
Count
Source
50
18.7k
{
51
  /* empty */
52
18.7k
}
zstd_wrapper.c:squashfs_finish_page
Line
Count
Source
50
53.7k
{
51
  /* empty */
52
53.7k
}
53
#endif