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
6dc8bc0f
Commit
6dc8bc0f
authored
Apr 05, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ocfs2: switch to iter_file_splice_write()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
8d020765
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
80 deletions
+2
-80
fs/ocfs2/file.c
fs/ocfs2/file.c
+2
-80
No files found.
fs/ocfs2/file.c
View file @
6dc8bc0f
...
...
@@ -2430,84 +2430,6 @@ static ssize_t ocfs2_file_write_iter(struct kiocb *iocb,
return
ret
;
}
static
int
ocfs2_splice_to_file
(
struct
pipe_inode_info
*
pipe
,
struct
file
*
out
,
struct
splice_desc
*
sd
)
{
int
ret
;
ret
=
ocfs2_prepare_inode_for_write
(
out
,
&
sd
->
pos
,
sd
->
total_len
,
0
,
NULL
,
NULL
);
if
(
ret
<
0
)
{
mlog_errno
(
ret
);
return
ret
;
}
return
splice_from_pipe_feed
(
pipe
,
sd
,
pipe_to_file
);
}
static
ssize_t
ocfs2_file_splice_write
(
struct
pipe_inode_info
*
pipe
,
struct
file
*
out
,
loff_t
*
ppos
,
size_t
len
,
unsigned
int
flags
)
{
int
ret
;
struct
address_space
*
mapping
=
out
->
f_mapping
;
struct
inode
*
inode
=
mapping
->
host
;
struct
splice_desc
sd
=
{
.
total_len
=
len
,
.
flags
=
flags
,
.
pos
=
*
ppos
,
.
u
.
file
=
out
,
};
trace_ocfs2_file_splice_write
(
inode
,
out
,
out
->
f_path
.
dentry
,
(
unsigned
long
long
)
OCFS2_I
(
inode
)
->
ip_blkno
,
out
->
f_path
.
dentry
->
d_name
.
len
,
out
->
f_path
.
dentry
->
d_name
.
name
,
len
);
pipe_lock
(
pipe
);
splice_from_pipe_begin
(
&
sd
);
do
{
ret
=
splice_from_pipe_next
(
pipe
,
&
sd
);
if
(
ret
<=
0
)
break
;
mutex_lock_nested
(
&
inode
->
i_mutex
,
I_MUTEX_CHILD
);
ret
=
ocfs2_rw_lock
(
inode
,
1
);
if
(
ret
<
0
)
mlog_errno
(
ret
);
else
{
ret
=
ocfs2_splice_to_file
(
pipe
,
out
,
&
sd
);
ocfs2_rw_unlock
(
inode
,
1
);
}
mutex_unlock
(
&
inode
->
i_mutex
);
}
while
(
ret
>
0
);
splice_from_pipe_end
(
pipe
,
&
sd
);
pipe_unlock
(
pipe
);
if
(
sd
.
num_spliced
)
ret
=
sd
.
num_spliced
;
if
(
ret
>
0
)
{
int
err
;
err
=
generic_write_sync
(
out
,
*
ppos
,
ret
);
if
(
err
)
ret
=
err
;
else
*
ppos
+=
ret
;
balance_dirty_pages_ratelimited
(
mapping
);
}
return
ret
;
}
static
ssize_t
ocfs2_file_splice_read
(
struct
file
*
in
,
loff_t
*
ppos
,
struct
pipe_inode_info
*
pipe
,
...
...
@@ -2708,7 +2630,7 @@ const struct file_operations ocfs2_fops = {
.
lock
=
ocfs2_lock
,
.
flock
=
ocfs2_flock
,
.
splice_read
=
ocfs2_file_splice_read
,
.
splice_write
=
ocfs2
_file_splice_write
,
.
splice_write
=
iter
_file_splice_write
,
.
fallocate
=
ocfs2_fallocate
,
};
...
...
@@ -2755,7 +2677,7 @@ const struct file_operations ocfs2_fops_no_plocks = {
#endif
.
flock
=
ocfs2_flock
,
.
splice_read
=
ocfs2_file_splice_read
,
.
splice_write
=
ocfs2
_file_splice_write
,
.
splice_write
=
iter
_file_splice_write
,
.
fallocate
=
ocfs2_fallocate
,
};
...
...
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