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
Kirill Smelkov
linux
Commits
b8e2df1f
Commit
b8e2df1f
authored
Jan 09, 2016
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ncpfs: switch to sock_sendmsg()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
2cebcc78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
22 deletions
+14
-22
fs/ncpfs/sock.c
fs/ncpfs/sock.c
+14
-22
No files found.
fs/ncpfs/sock.c
View file @
b8e2df1f
...
...
@@ -40,19 +40,12 @@ static int _recv(struct socket *sock, void *buf, int size, unsigned flags)
return
kernel_recvmsg
(
sock
,
&
msg
,
&
iov
,
1
,
size
,
flags
);
}
static
inline
int
do_send
(
struct
socket
*
sock
,
struct
kvec
*
vec
,
int
count
,
int
len
,
unsigned
flags
)
{
struct
msghdr
msg
=
{
.
msg_flags
=
flags
};
return
kernel_sendmsg
(
sock
,
&
msg
,
vec
,
count
,
len
);
}
static
int
_send
(
struct
socket
*
sock
,
const
void
*
buff
,
int
len
)
{
struct
kvec
vec
;
vec
.
iov_base
=
(
void
*
)
buff
;
vec
.
iov_len
=
len
;
return
do_send
(
sock
,
&
vec
,
1
,
len
,
0
);
struct
msghdr
msg
=
{
.
msg_flags
=
0
}
;
struct
kvec
vec
=
{.
iov_base
=
(
void
*
)
buff
,
.
iov_len
=
len
}
;
iov_iter_kvec
(
&
msg
.
msg_iter
,
WRITE
|
ITER_KVEC
,
&
vec
,
1
,
len
)
;
return
sock_sendmsg
(
sock
,
&
msg
);
}
struct
ncp_request_reply
{
...
...
@@ -345,18 +338,17 @@ static void __ncp_next_request(struct ncp_server *server)
static
void
info_server
(
struct
ncp_server
*
server
,
unsigned
int
id
,
const
void
*
data
,
size_t
len
)
{
if
(
server
->
info_sock
)
{
struct
kvec
iov
[
2
];
__be32
hdr
[
2
];
hdr
[
0
]
=
cpu_to_be32
(
len
+
8
);
hdr
[
1
]
=
cpu_to_be32
(
id
);
iov
[
0
].
iov_base
=
hdr
;
iov
[
0
].
iov_len
=
8
;
iov
[
1
].
iov_base
=
(
void
*
)
data
;
iov
[
1
].
iov_len
=
len
;
struct
msghdr
msg
=
{
.
msg_flags
=
MSG_NOSIGNAL
};
__be32
hdr
[
2
]
=
{
cpu_to_be32
(
len
+
8
),
cpu_to_be32
(
id
)};
struct
kvec
iov
[
2
]
=
{
{.
iov_base
=
hdr
,
.
iov_len
=
8
},
{.
iov_base
=
(
void
*
)
data
,
.
iov_len
=
len
},
};
iov_iter_kvec
(
&
msg
.
msg_iter
,
ITER_KVEC
|
WRITE
,
iov
,
2
,
len
+
8
);
do_send
(
server
->
info_sock
,
iov
,
2
,
len
+
8
,
MSG_NOSIGNAL
);
sock_sendmsg
(
server
->
info_sock
,
&
msg
);
}
}
...
...
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