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
512b2268
Commit
512b2268
authored
Aug 23, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch hci_vhci to ->write_iter()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
13ba33e8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
14 deletions
+8
-14
drivers/bluetooth/hci_vhci.c
drivers/bluetooth/hci_vhci.c
+8
-14
No files found.
drivers/bluetooth/hci_vhci.c
View file @
512b2268
...
...
@@ -160,13 +160,11 @@ static int vhci_create_device(struct vhci_data *data, __u8 opcode)
}
static
inline
ssize_t
vhci_get_user
(
struct
vhci_data
*
data
,
const
struct
iovec
*
iov
,
unsigned
long
count
)
struct
iov_iter
*
from
)
{
size_t
len
=
iov_
length
(
iov
,
count
);
size_t
len
=
iov_
iter_count
(
from
);
struct
sk_buff
*
skb
;
__u8
pkt_type
,
opcode
;
unsigned
long
i
;
int
ret
;
if
(
len
<
2
||
len
>
HCI_MAX_FRAME_SIZE
)
...
...
@@ -176,13 +174,10 @@ static inline ssize_t vhci_get_user(struct vhci_data *data,
if
(
!
skb
)
return
-
ENOMEM
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(
copy_from_user
(
skb_put
(
skb
,
iov
[
i
].
iov_len
),
iov
[
i
].
iov_base
,
iov
[
i
].
iov_len
))
{
if
(
copy_from_iter
(
skb_put
(
skb
,
len
),
len
,
from
)
!=
len
)
{
kfree_skb
(
skb
);
return
-
EFAULT
;
}
}
pkt_type
=
*
((
__u8
*
)
skb
->
data
);
skb_pull
(
skb
,
1
);
...
...
@@ -294,13 +289,12 @@ static ssize_t vhci_read(struct file *file,
return
ret
;
}
static
ssize_t
vhci_write
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
count
,
loff_t
pos
)
static
ssize_t
vhci_write
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
from
)
{
struct
file
*
file
=
iocb
->
ki_filp
;
struct
vhci_data
*
data
=
file
->
private_data
;
return
vhci_get_user
(
data
,
iov
,
count
);
return
vhci_get_user
(
data
,
from
);
}
static
unsigned
int
vhci_poll
(
struct
file
*
file
,
poll_table
*
wait
)
...
...
@@ -365,7 +359,7 @@ static int vhci_release(struct inode *inode, struct file *file)
static
const
struct
file_operations
vhci_fops
=
{
.
owner
=
THIS_MODULE
,
.
read
=
vhci_read
,
.
aio_write
=
vhci_write
,
.
write_iter
=
vhci_write
,
.
poll
=
vhci_poll
,
.
open
=
vhci_open
,
.
release
=
vhci_release
,
...
...
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