Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
98de8e91
Commit
98de8e91
authored
Nov 09, 2002
by
Christoph Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] switch over loop.c to ->sendfile
last direct call into fs code is gone
parent
5e3e6a25
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
drivers/block/loop.c
drivers/block/loop.c
+8
-8
No files found.
drivers/block/loop.c
View file @
98de8e91
...
@@ -303,22 +303,22 @@ do_lo_receive(struct loop_device *lo,
...
@@ -303,22 +303,22 @@ do_lo_receive(struct loop_device *lo,
struct
bio_vec
*
bvec
,
int
bsize
,
loff_t
pos
)
struct
bio_vec
*
bvec
,
int
bsize
,
loff_t
pos
)
{
{
struct
lo_read_data
cookie
;
struct
lo_read_data
cookie
;
read_descriptor_t
desc
;
struct
file
*
file
;
struct
file
*
file
;
int
error
;
cookie
.
lo
=
lo
;
cookie
.
lo
=
lo
;
cookie
.
data
=
kmap
(
bvec
->
bv_page
)
+
bvec
->
bv_offset
;
cookie
.
data
=
kmap
(
bvec
->
bv_page
)
+
bvec
->
bv_offset
;
cookie
.
bsize
=
bsize
;
cookie
.
bsize
=
bsize
;
desc
.
written
=
0
;
desc
.
count
=
bvec
->
bv_len
;
/* umm, what does this lock actually try to protect? */
desc
.
buf
=
(
char
*
)
&
cookie
;
desc
.
error
=
0
;
spin_lock_irq
(
&
lo
->
lo_lock
);
spin_lock_irq
(
&
lo
->
lo_lock
);
file
=
lo
->
lo_backing_file
;
file
=
lo
->
lo_backing_file
;
spin_unlock_irq
(
&
lo
->
lo_lock
);
spin_unlock_irq
(
&
lo
->
lo_lock
);
do_generic_file_read
(
file
,
&
pos
,
&
desc
,
lo_read_actor
);
error
=
file
->
f_op
->
sendfile
(
file
,
&
pos
,
bvec
->
bv_len
,
lo_read_actor
,
&
cookie
);
kunmap
(
bvec
->
bv_page
);
kunmap
(
bvec
->
bv_page
);
return
desc
.
error
;
return
error
;
}
}
static
int
static
int
...
@@ -682,7 +682,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
...
@@ -682,7 +682,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
* If we can't read - sorry. If we only can't write - well,
* If we can't read - sorry. If we only can't write - well,
* it's going to be read-only.
* it's going to be read-only.
*/
*/
if
(
!
aops
->
readpag
e
)
if
(
!
inode
->
i_fop
->
sendfil
e
)
goto
out_putf
;
goto
out_putf
;
if
(
!
aops
->
prepare_write
||
!
aops
->
commit_write
)
if
(
!
aops
->
prepare_write
||
!
aops
->
commit_write
)
...
...
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