Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
b96dd2c4
Commit
b96dd2c4
authored
Apr 18, 2012
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
files: Named constant for fdinfo_list_entry pool size
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
04800b6e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
files.c
files.c
+5
-2
No files found.
files.c
View file @
b96dd2c4
...
@@ -27,11 +27,14 @@ static int nr_fdinfo_list;
...
@@ -27,11 +27,14 @@ static int nr_fdinfo_list;
#define FDESC_HASH_SIZE 64
#define FDESC_HASH_SIZE 64
static
struct
list_head
file_descs
[
FDESC_HASH_SIZE
];
static
struct
list_head
file_descs
[
FDESC_HASH_SIZE
];
#define FDINFO_POOL_SIZE (4 * 4096)
int
prepare_shared_fdinfo
(
void
)
int
prepare_shared_fdinfo
(
void
)
{
{
int
i
;
int
i
;
fdinfo_list
=
mmap
(
NULL
,
4096
,
PROT_READ
|
PROT_WRITE
,
MAP_SHARED
|
MAP_ANON
,
0
,
0
);
fdinfo_list
=
mmap
(
NULL
,
FDINFO_POOL_SIZE
,
PROT_READ
|
PROT_WRITE
,
MAP_SHARED
|
MAP_ANON
,
0
,
0
);
if
(
fdinfo_list
==
MAP_FAILED
)
{
if
(
fdinfo_list
==
MAP_FAILED
)
{
pr_perror
(
"Can't map fdinfo_list"
);
pr_perror
(
"Can't map fdinfo_list"
);
return
-
1
;
return
-
1
;
...
@@ -334,7 +337,7 @@ static int collect_fd(int pid, struct fdinfo_entry *e)
...
@@ -334,7 +337,7 @@ static int collect_fd(int pid, struct fdinfo_entry *e)
pid
,
e
->
fd
,
e
->
id
);
pid
,
e
->
fd
,
e
->
id
);
nr_fdinfo_list
++
;
nr_fdinfo_list
++
;
if
((
nr_fdinfo_list
)
*
sizeof
(
struct
fdinfo_list_entry
)
>=
4096
)
{
if
((
nr_fdinfo_list
)
*
sizeof
(
struct
fdinfo_list_entry
)
>=
FDINFO_POOL_SIZE
)
{
pr_err
(
"OOM storing fdinfo_list_entries
\n
"
);
pr_err
(
"OOM storing fdinfo_list_entries
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment