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
a457ac28
Commit
a457ac28
authored
Feb 04, 2015
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hypfs: switch to read_iter/write_iter
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
db671a8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
27 deletions
+24
-27
arch/s390/hypfs/inode.c
arch/s390/hypfs/inode.c
+24
-27
No files found.
arch/s390/hypfs/inode.c
View file @
a457ac28
...
...
@@ -144,36 +144,32 @@ static int hypfs_open(struct inode *inode, struct file *filp)
return
nonseekable_open
(
inode
,
filp
);
}
static
ssize_t
hypfs_aio_read
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
offset
)
static
ssize_t
hypfs_read_iter
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
to
)
{
char
*
data
;
ssize_t
ret
;
struct
file
*
filp
=
iocb
->
ki_filp
;
/* XXX: temporary */
char
__user
*
buf
=
iov
[
0
].
iov_base
;
size_t
count
=
iov
[
0
].
iov_len
;
if
(
nr_segs
!=
1
)
return
-
EINVAL
;
data
=
filp
->
private_data
;
ret
=
simple_read_from_buffer
(
buf
,
count
,
&
offset
,
data
,
strlen
(
data
));
if
(
ret
<=
0
)
return
ret
;
struct
file
*
file
=
iocb
->
ki_filp
;
char
*
data
=
file
->
private_data
;
size_t
available
=
strlen
(
data
);
loff_t
pos
=
iocb
->
ki_pos
;
size_t
count
;
iocb
->
ki_pos
+=
ret
;
file_accessed
(
filp
);
return
ret
;
if
(
pos
<
0
)
return
-
EINVAL
;
if
(
pos
>=
available
||
!
iov_iter_count
(
to
))
return
0
;
count
=
copy_to_iter
(
data
+
pos
,
available
-
pos
,
to
);
if
(
!
count
)
return
-
EFAULT
;
iocb
->
ki_pos
=
pos
+
count
;
file_accessed
(
file
);
return
count
;
}
static
ssize_t
hypfs_aio_write
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
offset
)
static
ssize_t
hypfs_write_iter
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
from
)
{
int
rc
;
struct
super_block
*
sb
=
file_inode
(
iocb
->
ki_filp
)
->
i_sb
;
struct
hypfs_sb_info
*
fs_info
=
sb
->
s_fs_info
;
size_t
count
=
iov_
length
(
iov
,
nr_segs
);
size_t
count
=
iov_
iter_count
(
from
);
/*
* Currently we only allow one update per second for two reasons:
...
...
@@ -202,6 +198,7 @@ static ssize_t hypfs_aio_write(struct kiocb *iocb, const struct iovec *iov,
}
hypfs_update_update
(
sb
);
rc
=
count
;
iov_iter_advance
(
from
,
count
);
out:
mutex_unlock
(
&
fs_info
->
lock
);
return
rc
;
...
...
@@ -440,10 +437,10 @@ struct dentry *hypfs_create_str(struct dentry *dir,
static
const
struct
file_operations
hypfs_file_ops
=
{
.
open
=
hypfs_open
,
.
release
=
hypfs_release
,
.
read
=
do
_sync_read
,
.
write
=
do
_sync_write
,
.
aio_read
=
hypfs_aio_read
,
.
aio_write
=
hypfs_aio_write
,
.
read
=
new
_sync_read
,
.
write
=
new
_sync_write
,
.
read_iter
=
hypfs_read_iter
,
.
write_iter
=
hypfs_write_iter
,
.
llseek
=
no_llseek
,
};
...
...
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