Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
linux-elphel
Commits
1c5e28a8
Commit
1c5e28a8
authored
Jun 13, 2023
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Had to add get_page(cur_page); to avoid 'page dumped because: nonzero _refcount' BUG
parent
5a0e45c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
iov_iter.c
src/lib/iov_iter.c
+7
-3
No files found.
src/lib/iov_iter.c
View file @
1c5e28a8
...
@@ -1205,7 +1205,7 @@ ssize_t iov_iter_get_pages(struct iov_iter *i,
...
@@ -1205,7 +1205,7 @@ ssize_t iov_iter_get_pages(struct iov_iter *i,
len
=
maxpages
*
PAGE_SIZE
;
len
=
maxpages
*
PAGE_SIZE
;
addr
&=
~
(
PAGE_SIZE
-
1
);
addr
&=
~
(
PAGE_SIZE
-
1
);
n
=
DIV_ROUND_UP
(
len
,
PAGE_SIZE
);
n
=
DIV_ROUND_UP
(
len
,
PAGE_SIZE
);
pr_debug
(
"iterate_iovec(),
addr =0x%08lx, len=%u, n=%u, write=%u"
,
addr
,
len
,
n
,
(
i
->
type
&
WRITE
)
!=
WRITE
);
pr_debug
(
"iterate_iovec(),
v.iov_base=0x%08x, addr =0x%08lx, len=%u, n=%u, write=%u"
,
(
int
)
v
.
iov_base
,
addr
,
len
,
n
,
(
i
->
type
&
WRITE
)
!=
WRITE
);
res
=
get_user_pages_fast
(
addr
,
n
,
(
i
->
type
&
WRITE
)
!=
WRITE
,
pages
);
res
=
get_user_pages_fast
(
addr
,
n
,
(
i
->
type
&
WRITE
)
!=
WRITE
,
pages
);
if
(
unlikely
(
res
<
0
))
{
if
(
unlikely
(
res
<
0
))
{
pr_debug
(
"iterate_iovec(), res = %d"
,
res
);
pr_debug
(
"iterate_iovec(), res = %d"
,
res
);
...
@@ -1243,7 +1243,7 @@ ssize_t iov_iter_get_pages_elphel(struct iov_iter *i,
...
@@ -1243,7 +1243,7 @@ ssize_t iov_iter_get_pages_elphel(struct iov_iter *i,
// *** Putting temporary address here
// *** Putting temporary address here
struct
page
*
cur_page
=
(
struct
page
*
)
circbuf0_page0
;
struct
page
*
cur_page
=
(
struct
page
*
)
circbuf0_page0
;
addr
=
0
;
addr
=
0
;
pr_debug
(
"circbuf0_page0 = 0x%08x, circbuf0_page0->compound_head=0x%08lx"
,
(
int
)
circbuf0_page0
,
circbuf0_page0
->
compound_head
);
len
=
iov
->
iov_len
+
(
*
start
=
addr
&
(
PAGE_SIZE
-
1
));
// to inlude beginning of the page - for now 0;
len
=
iov
->
iov_len
+
(
*
start
=
addr
&
(
PAGE_SIZE
-
1
));
// to inlude beginning of the page - for now 0;
if
(
maxsize
>
i
->
count
)
if
(
maxsize
>
i
->
count
)
maxsize
=
i
->
count
;
maxsize
=
i
->
count
;
...
@@ -1252,10 +1252,14 @@ ssize_t iov_iter_get_pages_elphel(struct iov_iter *i,
...
@@ -1252,10 +1252,14 @@ ssize_t iov_iter_get_pages_elphel(struct iov_iter *i,
addr
&=
~
(
PAGE_SIZE
-
1
);
addr
&=
~
(
PAGE_SIZE
-
1
);
n
=
DIV_ROUND_UP
(
len
,
PAGE_SIZE
);
n
=
DIV_ROUND_UP
(
len
,
PAGE_SIZE
);
for
(
indx
=
0
;
indx
<
n
;
indx
++
){
for
(
indx
=
0
;
indx
<
n
;
indx
++
){
if
((
cur_page
->
compound_head
)
&
1
){
pr_debug
(
"**** COMPOUND HEAD! ****"
);
}
get_page
(
cur_page
);
// increments refcount
pages
[
indx
]
=
cur_page
++
;
pages
[
indx
]
=
cur_page
++
;
}
}
len
-=
*
start
;
len
-=
*
start
;
pr_debug
(
"iov_iter_get_pages_elphel()->0x%08x, n=%u
"
,
len
,
n
);
pr_debug
(
"iov_iter_get_pages_elphel()->0x%08x, n=%u
, current->mm->map_count=%u"
,
len
,
n
,
current
->
mm
->
map_count
);
return
len
;
return
len
;
}
}
EXPORT_SYMBOL
(
iov_iter_get_pages_elphel
);
EXPORT_SYMBOL
(
iov_iter_get_pages_elphel
);
...
...
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