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
e9d1593d
Commit
e9d1593d
authored
Apr 06, 2015
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cifs: fold cifs_iovec_write() into the only caller
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
ccca2683
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
31 deletions
+16
-31
fs/cifs/file.c
fs/cifs/file.c
+16
-31
No files found.
fs/cifs/file.c
View file @
e9d1593d
...
@@ -2560,9 +2560,9 @@ cifs_write_from_iter(loff_t offset, size_t len, struct iov_iter *from,
...
@@ -2560,9 +2560,9 @@ cifs_write_from_iter(loff_t offset, size_t len, struct iov_iter *from,
return
rc
;
return
rc
;
}
}
static
ssize_t
ssize_t
cifs_user_writev
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
from
)
cifs_iovec_write
(
struct
file
*
file
,
struct
iov_iter
*
from
,
loff_t
*
poffset
)
{
{
struct
file
*
file
=
iocb
->
ki_filp
;
size_t
len
;
size_t
len
;
ssize_t
total_written
=
0
;
ssize_t
total_written
=
0
;
struct
cifsFileInfo
*
open_file
;
struct
cifsFileInfo
*
open_file
;
...
@@ -2573,8 +2573,14 @@ cifs_iovec_write(struct file *file, struct iov_iter *from, loff_t *poffset)
...
@@ -2573,8 +2573,14 @@ cifs_iovec_write(struct file *file, struct iov_iter *from, loff_t *poffset)
struct
iov_iter
saved_from
;
struct
iov_iter
saved_from
;
int
rc
;
int
rc
;
/*
* BB - optimize the way when signing is disabled. We can drop this
* extra memory-to-memory copying and use iovec buffers for constructing
* write request.
*/
len
=
iov_iter_count
(
from
);
len
=
iov_iter_count
(
from
);
rc
=
generic_write_checks
(
file
,
poffset
,
&
len
,
0
);
rc
=
generic_write_checks
(
file
,
&
iocb
->
ki_pos
,
&
len
,
0
);
if
(
rc
)
if
(
rc
)
return
rc
;
return
rc
;
...
@@ -2593,7 +2599,7 @@ cifs_iovec_write(struct file *file, struct iov_iter *from, loff_t *poffset)
...
@@ -2593,7 +2599,7 @@ cifs_iovec_write(struct file *file, struct iov_iter *from, loff_t *poffset)
memcpy
(
&
saved_from
,
from
,
sizeof
(
struct
iov_iter
));
memcpy
(
&
saved_from
,
from
,
sizeof
(
struct
iov_iter
));
rc
=
cifs_write_from_iter
(
*
poffset
,
len
,
from
,
open_file
,
cifs_sb
,
rc
=
cifs_write_from_iter
(
iocb
->
ki_pos
,
len
,
from
,
open_file
,
cifs_sb
,
&
wdata_list
);
&
wdata_list
);
/*
/*
...
@@ -2633,7 +2639,7 @@ cifs_iovec_write(struct file *file, struct iov_iter *from, loff_t *poffset)
...
@@ -2633,7 +2639,7 @@ cifs_iovec_write(struct file *file, struct iov_iter *from, loff_t *poffset)
memcpy
(
&
tmp_from
,
&
saved_from
,
memcpy
(
&
tmp_from
,
&
saved_from
,
sizeof
(
struct
iov_iter
));
sizeof
(
struct
iov_iter
));
iov_iter_advance
(
&
tmp_from
,
iov_iter_advance
(
&
tmp_from
,
wdata
->
offset
-
*
poffset
);
wdata
->
offset
-
iocb
->
ki_pos
);
rc
=
cifs_write_from_iter
(
wdata
->
offset
,
rc
=
cifs_write_from_iter
(
wdata
->
offset
,
wdata
->
bytes
,
&
tmp_from
,
wdata
->
bytes
,
&
tmp_from
,
...
@@ -2650,34 +2656,13 @@ cifs_iovec_write(struct file *file, struct iov_iter *from, loff_t *poffset)
...
@@ -2650,34 +2656,13 @@ cifs_iovec_write(struct file *file, struct iov_iter *from, loff_t *poffset)
kref_put
(
&
wdata
->
refcount
,
cifs_uncached_writedata_release
);
kref_put
(
&
wdata
->
refcount
,
cifs_uncached_writedata_release
);
}
}
if
(
total_written
>
0
)
if
(
unlikely
(
!
total_written
)
)
*
poffset
+=
total_written
;
return
rc
;
iocb
->
ki_pos
+=
total_written
;
set_bit
(
CIFS_INO_INVALID_MAPPING
,
&
CIFS_I
(
file_inode
(
file
))
->
flags
);
cifs_stats_bytes_written
(
tcon
,
total_written
);
cifs_stats_bytes_written
(
tcon
,
total_written
);
return
total_written
?
total_written
:
(
ssize_t
)
rc
;
return
total_written
;
}
ssize_t
cifs_user_writev
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
from
)
{
ssize_t
written
;
struct
inode
*
inode
;
loff_t
pos
=
iocb
->
ki_pos
;
inode
=
file_inode
(
iocb
->
ki_filp
);
/*
* BB - optimize the way when signing is disabled. We can drop this
* extra memory-to-memory copying and use iovec buffers for constructing
* write request.
*/
written
=
cifs_iovec_write
(
iocb
->
ki_filp
,
from
,
&
pos
);
if
(
written
>
0
)
{
set_bit
(
CIFS_INO_INVALID_MAPPING
,
&
CIFS_I
(
inode
)
->
flags
);
iocb
->
ki_pos
=
pos
;
}
return
written
;
}
}
static
ssize_t
static
ssize_t
...
...
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