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
b145333f
Commit
b145333f
authored
Jul 15, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Jul 15, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse: iovec cleanups - sunrpc, nfs and nfsd
sunrpc, nfs and nfsd switched to use of kvec and kernel_...msg()
parent
8af0afb2
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
100 additions
and
113 deletions
+100
-113
fs/nfs/nfs2xdr.c
fs/nfs/nfs2xdr.c
+3
-3
fs/nfs/nfs3xdr.c
fs/nfs/nfs3xdr.c
+3
-3
fs/nfs/nfs4xdr.c
fs/nfs/nfs4xdr.c
+6
-6
fs/nfsd/nfs3xdr.c
fs/nfsd/nfs3xdr.c
+2
-2
fs/nfsd/nfs4xdr.c
fs/nfsd/nfs4xdr.c
+1
-1
fs/nfsd/nfscache.c
fs/nfsd/nfscache.c
+4
-4
fs/nfsd/vfs.c
fs/nfsd/vfs.c
+4
-4
include/linux/nfsd/cache.h
include/linux/nfsd/cache.h
+1
-1
include/linux/nfsd/nfsd.h
include/linux/nfsd/nfsd.h
+2
-2
include/linux/nfsd/xdr.h
include/linux/nfsd/xdr.h
+2
-2
include/linux/nfsd/xdr3.h
include/linux/nfsd/xdr3.h
+2
-2
include/linux/nfsd/xdr4.h
include/linux/nfsd/xdr4.h
+2
-2
include/linux/sunrpc/svc.h
include/linux/sunrpc/svc.h
+5
-5
include/linux/sunrpc/xdr.h
include/linux/sunrpc/xdr.h
+7
-7
net/sunrpc/auth_gss/auth_gss.c
net/sunrpc/auth_gss/auth_gss.c
+5
-5
net/sunrpc/auth_gss/svcauth_gss.c
net/sunrpc/auth_gss/svcauth_gss.c
+8
-8
net/sunrpc/svc.c
net/sunrpc/svc.c
+2
-2
net/sunrpc/svcauth_unix.c
net/sunrpc/svcauth_unix.c
+4
-4
net/sunrpc/svcsock.c
net/sunrpc/svcsock.c
+6
-11
net/sunrpc/xdr.c
net/sunrpc/xdr.c
+31
-39
No files found.
fs/nfs/nfs2xdr.c
View file @
b145333f
...
...
@@ -231,7 +231,7 @@ nfs_xdr_readargs(struct rpc_rqst *req, u32 *p, struct nfs_readargs *args)
static
int
nfs_xdr_readres
(
struct
rpc_rqst
*
req
,
u32
*
p
,
struct
nfs_readres
*
res
)
{
struct
io
vec
*
iov
=
req
->
rq_rcv_buf
.
head
;
struct
k
vec
*
iov
=
req
->
rq_rcv_buf
.
head
;
int
status
,
count
,
recvd
,
hdrlen
;
if
((
status
=
ntohl
(
*
p
++
)))
...
...
@@ -375,7 +375,7 @@ static int
nfs_xdr_readdirres
(
struct
rpc_rqst
*
req
,
u32
*
p
,
void
*
dummy
)
{
struct
xdr_buf
*
rcvbuf
=
&
req
->
rq_rcv_buf
;
struct
io
vec
*
iov
=
rcvbuf
->
head
;
struct
k
vec
*
iov
=
rcvbuf
->
head
;
struct
page
**
page
;
int
hdrlen
,
recvd
;
int
status
,
nr
;
...
...
@@ -530,7 +530,7 @@ static int
nfs_xdr_readlinkres
(
struct
rpc_rqst
*
req
,
u32
*
p
,
void
*
dummy
)
{
struct
xdr_buf
*
rcvbuf
=
&
req
->
rq_rcv_buf
;
struct
io
vec
*
iov
=
rcvbuf
->
head
;
struct
k
vec
*
iov
=
rcvbuf
->
head
;
unsigned
int
hdrlen
;
u32
*
strlen
,
len
;
char
*
string
;
...
...
fs/nfs/nfs3xdr.c
View file @
b145333f
...
...
@@ -484,7 +484,7 @@ static int
nfs3_xdr_readdirres
(
struct
rpc_rqst
*
req
,
u32
*
p
,
struct
nfs3_readdirres
*
res
)
{
struct
xdr_buf
*
rcvbuf
=
&
req
->
rq_rcv_buf
;
struct
io
vec
*
iov
=
rcvbuf
->
head
;
struct
k
vec
*
iov
=
rcvbuf
->
head
;
struct
page
**
page
;
int
hdrlen
,
recvd
;
int
status
,
nr
;
...
...
@@ -721,7 +721,7 @@ static int
nfs3_xdr_readlinkres
(
struct
rpc_rqst
*
req
,
u32
*
p
,
struct
nfs_fattr
*
fattr
)
{
struct
xdr_buf
*
rcvbuf
=
&
req
->
rq_rcv_buf
;
struct
io
vec
*
iov
=
rcvbuf
->
head
;
struct
k
vec
*
iov
=
rcvbuf
->
head
;
unsigned
int
hdrlen
;
u32
*
strlen
,
len
;
char
*
string
;
...
...
@@ -761,7 +761,7 @@ nfs3_xdr_readlinkres(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr)
static
int
nfs3_xdr_readres
(
struct
rpc_rqst
*
req
,
u32
*
p
,
struct
nfs_readres
*
res
)
{
struct
io
vec
*
iov
=
req
->
rq_rcv_buf
.
head
;
struct
k
vec
*
iov
=
req
->
rq_rcv_buf
.
head
;
int
status
,
count
,
ocount
,
recvd
,
hdrlen
;
status
=
ntohl
(
*
p
++
);
...
...
fs/nfs/nfs4xdr.c
View file @
b145333f
...
...
@@ -933,7 +933,7 @@ static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg
WRITE32
(
FATTR4_WORD0_FILEID
);
WRITE32
(
0
);
/* set up reply
io
vec
/* set up reply
k
vec
* toplevel_status + taglen + rescount + OP_PUTFH + status
* + OP_READDIR + status + verifer(2) = 9
*/
...
...
@@ -954,7 +954,7 @@ static int encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *r
RESERVE_SPACE
(
4
);
WRITE32
(
OP_READLINK
);
/* set up reply
io
vec
/* set up reply
k
vec
* toplevel_status + taglen + rescount + OP_PUTFH + status
* + OP_READLINK + status = 7
*/
...
...
@@ -1501,7 +1501,7 @@ static int nfs4_xdr_enc_read(struct rpc_rqst *req, uint32_t *p, struct nfs_reada
if
(
status
)
goto
out
;
/* set up reply
io
vec
/* set up reply
k
vec
* toplevel status + taglen=0 + rescount + OP_PUTFH + status
* + OP_READ + status + eof + datalen = 9
*/
...
...
@@ -2785,7 +2785,7 @@ static int decode_putrootfh(struct xdr_stream *xdr)
static
int
decode_read
(
struct
xdr_stream
*
xdr
,
struct
rpc_rqst
*
req
,
struct
nfs_readres
*
res
)
{
struct
io
vec
*
iov
=
req
->
rq_rcv_buf
.
head
;
struct
k
vec
*
iov
=
req
->
rq_rcv_buf
.
head
;
uint32_t
*
p
;
uint32_t
count
,
eof
,
recvd
,
hdrlen
;
int
status
;
...
...
@@ -2814,7 +2814,7 @@ static int decode_readdir(struct xdr_stream *xdr, struct rpc_rqst *req, struct n
{
struct
xdr_buf
*
rcvbuf
=
&
req
->
rq_rcv_buf
;
struct
page
*
page
=
*
rcvbuf
->
pages
;
struct
io
vec
*
iov
=
rcvbuf
->
head
;
struct
k
vec
*
iov
=
rcvbuf
->
head
;
unsigned
int
nr
,
pglen
=
rcvbuf
->
page_len
;
uint32_t
*
end
,
*
entry
,
*
p
,
*
kaddr
;
uint32_t
len
,
attrlen
,
word
;
...
...
@@ -2897,7 +2897,7 @@ static int decode_readdir(struct xdr_stream *xdr, struct rpc_rqst *req, struct n
static
int
decode_readlink
(
struct
xdr_stream
*
xdr
,
struct
rpc_rqst
*
req
)
{
struct
xdr_buf
*
rcvbuf
=
&
req
->
rq_rcv_buf
;
struct
io
vec
*
iov
=
rcvbuf
->
head
;
struct
k
vec
*
iov
=
rcvbuf
->
head
;
uint32_t
*
strlen
;
unsigned
int
hdrlen
,
len
;
char
*
string
;
...
...
fs/nfsd/nfs3xdr.c
View file @
b145333f
...
...
@@ -340,7 +340,7 @@ nfs3svc_decode_readargs(struct svc_rqst *rqstp, u32 *p,
if
(
len
>
NFSSVC_MAXBLKSIZE
)
len
=
NFSSVC_MAXBLKSIZE
;
/* set up the
io
vec */
/* set up the
k
vec */
v
=
0
;
while
(
len
>
0
)
{
pn
=
rqstp
->
rq_resused
;
...
...
@@ -430,7 +430,7 @@ nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, u32 *p,
int
len
;
int
avail
;
char
*
old
,
*
new
;
struct
io
vec
*
vec
;
struct
k
vec
*
vec
;
if
(
!
(
p
=
decode_fh
(
p
,
&
args
->
ffh
))
||
!
(
p
=
decode_filename
(
p
,
&
args
->
fname
,
&
args
->
flen
))
...
...
fs/nfsd/nfs4xdr.c
View file @
b145333f
...
...
@@ -2519,7 +2519,7 @@ nfs4svc_encode_compoundres(struct svc_rqst *rqstp, u32 *p, struct nfsd4_compound
/*
* All that remains is to write the tag and operation count...
*/
struct
io
vec
*
iov
;
struct
k
vec
*
iov
;
p
=
resp
->
tagp
;
*
p
++
=
htonl
(
resp
->
taglen
);
memcpy
(
p
,
resp
->
tag
,
resp
->
taglen
);
...
...
fs/nfsd/nfscache.c
View file @
b145333f
...
...
@@ -41,7 +41,7 @@ static struct svc_cacherep * lru_tail;
static
struct
svc_cacherep
*
nfscache
;
static
int
cache_disabled
=
1
;
static
int
nfsd_cache_append
(
struct
svc_rqst
*
rqstp
,
struct
io
vec
*
vec
);
static
int
nfsd_cache_append
(
struct
svc_rqst
*
rqstp
,
struct
k
vec
*
vec
);
/*
* locking for the reply cache:
...
...
@@ -308,7 +308,7 @@ void
nfsd_cache_update
(
struct
svc_rqst
*
rqstp
,
int
cachetype
,
u32
*
statp
)
{
struct
svc_cacherep
*
rp
;
struct
io
vec
*
resv
=
&
rqstp
->
rq_res
.
head
[
0
],
*
cachv
;
struct
k
vec
*
resv
=
&
rqstp
->
rq_res
.
head
[
0
],
*
cachv
;
int
len
;
if
(
!
(
rp
=
rqstp
->
rq_cacherep
)
||
cache_disabled
)
...
...
@@ -358,9 +358,9 @@ nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, u32 *statp)
* keep a refcount....
*/
static
int
nfsd_cache_append
(
struct
svc_rqst
*
rqstp
,
struct
io
vec
*
data
)
nfsd_cache_append
(
struct
svc_rqst
*
rqstp
,
struct
k
vec
*
data
)
{
struct
io
vec
*
vec
=
&
rqstp
->
rq_res
.
head
[
0
];
struct
k
vec
*
vec
=
&
rqstp
->
rq_res
.
head
[
0
];
if
(
vec
->
iov_len
+
data
->
iov_len
>
PAGE_SIZE
)
{
printk
(
KERN_WARNING
"nfsd: cached reply too large (%Zd).
\n
"
,
...
...
fs/nfsd/vfs.c
View file @
b145333f
...
...
@@ -641,7 +641,7 @@ nfsd_read_actor(read_descriptor_t *desc, struct page *page, unsigned long offset
*/
int
nfsd_read
(
struct
svc_rqst
*
rqstp
,
struct
svc_fh
*
fhp
,
loff_t
offset
,
struct
io
vec
*
vec
,
int
vlen
,
unsigned
long
*
count
)
struct
k
vec
*
vec
,
int
vlen
,
unsigned
long
*
count
)
{
struct
raparms
*
ra
;
mm_segment_t
oldfs
;
...
...
@@ -673,7 +673,7 @@ nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
}
else
{
oldfs
=
get_fs
();
set_fs
(
KERNEL_DS
);
err
=
vfs_readv
(
&
file
,
vec
,
vlen
,
&
offset
);
err
=
vfs_readv
(
&
file
,
(
struct
iovec
__user
*
)
vec
,
vlen
,
&
offset
);
set_fs
(
oldfs
);
}
...
...
@@ -704,7 +704,7 @@ nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
*/
int
nfsd_write
(
struct
svc_rqst
*
rqstp
,
struct
svc_fh
*
fhp
,
loff_t
offset
,
struct
io
vec
*
vec
,
int
vlen
,
struct
k
vec
*
vec
,
int
vlen
,
unsigned
long
cnt
,
int
*
stablep
)
{
struct
svc_export
*
exp
;
...
...
@@ -753,7 +753,7 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
/* Write the data. */
oldfs
=
get_fs
();
set_fs
(
KERNEL_DS
);
err
=
vfs_writev
(
&
file
,
vec
,
vlen
,
&
offset
);
err
=
vfs_writev
(
&
file
,
(
struct
iovec
__user
*
)
vec
,
vlen
,
&
offset
);
set_fs
(
oldfs
);
if
(
err
>=
0
)
{
nfsdstats
.
io_write
+=
cnt
;
...
...
include/linux/nfsd/cache.h
View file @
b145333f
...
...
@@ -33,7 +33,7 @@ struct svc_cacherep {
u32
c_vers
;
unsigned
long
c_timestamp
;
union
{
struct
io
vec
u_vec
;
struct
k
vec
u_vec
;
u32
u_status
;
}
c_u
;
};
...
...
include/linux/nfsd/nfsd.h
View file @
b145333f
...
...
@@ -92,9 +92,9 @@ int nfsd_open(struct svc_rqst *, struct svc_fh *, int,
int
,
struct
file
*
);
void
nfsd_close
(
struct
file
*
);
int
nfsd_read
(
struct
svc_rqst
*
,
struct
svc_fh
*
,
loff_t
,
struct
io
vec
*
,
int
,
unsigned
long
*
);
loff_t
,
struct
k
vec
*
,
int
,
unsigned
long
*
);
int
nfsd_write
(
struct
svc_rqst
*
,
struct
svc_fh
*
,
loff_t
,
struct
io
vec
*
,
int
,
unsigned
long
,
int
*
);
loff_t
,
struct
k
vec
*
,
int
,
unsigned
long
,
int
*
);
int
nfsd_readlink
(
struct
svc_rqst
*
,
struct
svc_fh
*
,
char
*
,
int
*
);
int
nfsd_symlink
(
struct
svc_rqst
*
,
struct
svc_fh
*
,
...
...
include/linux/nfsd/xdr.h
View file @
b145333f
...
...
@@ -30,7 +30,7 @@ struct nfsd_readargs {
struct
svc_fh
fh
;
__u32
offset
;
__u32
count
;
struct
io
vec
vec
[
RPCSVC_MAXPAGES
];
struct
k
vec
vec
[
RPCSVC_MAXPAGES
];
int
vlen
;
};
...
...
@@ -38,7 +38,7 @@ struct nfsd_writeargs {
svc_fh
fh
;
__u32
offset
;
int
len
;
struct
io
vec
vec
[
RPCSVC_MAXPAGES
];
struct
k
vec
vec
[
RPCSVC_MAXPAGES
];
int
vlen
;
};
...
...
include/linux/nfsd/xdr3.h
View file @
b145333f
...
...
@@ -33,7 +33,7 @@ struct nfsd3_readargs {
struct
svc_fh
fh
;
__u64
offset
;
__u32
count
;
struct
io
vec
vec
[
RPCSVC_MAXPAGES
];
struct
k
vec
vec
[
RPCSVC_MAXPAGES
];
int
vlen
;
};
...
...
@@ -43,7 +43,7 @@ struct nfsd3_writeargs {
__u32
count
;
int
stable
;
int
len
;
struct
io
vec
vec
[
RPCSVC_MAXPAGES
];
struct
k
vec
vec
[
RPCSVC_MAXPAGES
];
int
vlen
;
};
...
...
include/linux/nfsd/xdr4.h
View file @
b145333f
...
...
@@ -241,7 +241,7 @@ struct nfsd4_read {
stateid_t
rd_stateid
;
/* request */
u64
rd_offset
;
/* request */
u32
rd_length
;
/* request */
struct
io
vec
rd_iov
[
RPCSVC_MAXPAGES
];
struct
k
vec
rd_iov
[
RPCSVC_MAXPAGES
];
int
rd_vlen
;
struct
svc_rqst
*
rd_rqstp
;
/* response */
...
...
@@ -324,7 +324,7 @@ struct nfsd4_write {
u64
wr_offset
;
/* request */
u32
wr_stable_how
;
/* request */
u32
wr_buflen
;
/* request */
struct
io
vec
wr_vec
[
RPCSVC_MAXPAGES
];
/* request */
struct
k
vec
wr_vec
[
RPCSVC_MAXPAGES
];
/* request */
int
wr_vlen
;
u32
wr_bytes_written
;
/* response */
...
...
include/linux/sunrpc/svc.h
View file @
b145333f
...
...
@@ -67,7 +67,7 @@ struct svc_serv {
* read responses (that have a header, and some data pages, and possibly
* a tail) and means we can share some client side routines.
*
* The xdr_buf.head
io
vec always points to the first page in the rq_*pages
* The xdr_buf.head
k
vec always points to the first page in the rq_*pages
* list. The xdr_buf.pages pointer points to the second page on that
* list. xdr_buf.tail points to the end of the first page.
* This assumes that the non-page part of an rpc reply will fit
...
...
@@ -78,7 +78,7 @@ struct svc_serv {
*/
#define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2)
static
inline
u32
svc_getu32
(
struct
io
vec
*
iov
)
static
inline
u32
svc_getu32
(
struct
k
vec
*
iov
)
{
u32
val
,
*
vp
;
vp
=
iov
->
iov_base
;
...
...
@@ -87,7 +87,7 @@ static inline u32 svc_getu32(struct iovec *iov)
iov
->
iov_len
-=
sizeof
(
u32
);
return
val
;
}
static
inline
void
svc_putu32
(
struct
io
vec
*
iov
,
u32
val
)
static
inline
void
svc_putu32
(
struct
k
vec
*
iov
,
u32
val
)
{
u32
*
vp
=
iov
->
iov_base
+
iov
->
iov_len
;
*
vp
=
val
;
...
...
@@ -162,14 +162,14 @@ static inline int
xdr_argsize_check
(
struct
svc_rqst
*
rqstp
,
u32
*
p
)
{
char
*
cp
=
(
char
*
)
p
;
struct
io
vec
*
vec
=
&
rqstp
->
rq_arg
.
head
[
0
];
struct
k
vec
*
vec
=
&
rqstp
->
rq_arg
.
head
[
0
];
return
cp
-
(
char
*
)
vec
->
iov_base
<=
vec
->
iov_len
;
}
static
inline
int
xdr_ressize_check
(
struct
svc_rqst
*
rqstp
,
u32
*
p
)
{
struct
io
vec
*
vec
=
&
rqstp
->
rq_res
.
head
[
0
];
struct
k
vec
*
vec
=
&
rqstp
->
rq_res
.
head
[
0
];
char
*
cp
=
(
char
*
)
p
;
vec
->
iov_len
=
cp
-
(
char
*
)
vec
->
iov_base
;
...
...
include/linux/sunrpc/xdr.h
View file @
b145333f
...
...
@@ -48,7 +48,7 @@ typedef int (*kxdrproc_t)(void *rqstp, u32 *data, void *obj);
* operations and/or has a need for scatter/gather involving pages.
*/
struct
xdr_buf
{
struct
io
vec
head
[
1
],
/* RPC header + non-page data */
struct
k
vec
head
[
1
],
/* RPC header + non-page data */
tail
[
1
];
/* Appended after page data */
struct
page
**
pages
;
/* Array of contiguous pages */
...
...
@@ -127,15 +127,15 @@ xdr_decode_hyper(u32 *p, __u64 *valp)
}
/*
* Adjust
io
vec to reflect end of xdr'ed data (RPC client XDR)
* Adjust
k
vec to reflect end of xdr'ed data (RPC client XDR)
*/
static
inline
int
xdr_adjust_iovec
(
struct
io
vec
*
iov
,
u32
*
p
)
xdr_adjust_iovec
(
struct
k
vec
*
iov
,
u32
*
p
)
{
return
iov
->
iov_len
=
((
u8
*
)
p
-
(
u8
*
)
iov
->
iov_base
);
}
void
xdr_shift_iovec
(
struct
io
vec
*
,
int
,
size_t
);
void
xdr_shift_iovec
(
struct
k
vec
*
,
int
,
size_t
);
/*
* Maximum number of iov's we use.
...
...
@@ -145,11 +145,11 @@ void xdr_shift_iovec(struct iovec *, int, size_t);
/*
* XDR buffer helper functions
*/
extern
int
xdr_kmap
(
struct
io
vec
*
,
struct
xdr_buf
*
,
size_t
);
extern
int
xdr_kmap
(
struct
k
vec
*
,
struct
xdr_buf
*
,
size_t
);
extern
void
xdr_kunmap
(
struct
xdr_buf
*
,
size_t
);
extern
void
xdr_shift_buf
(
struct
xdr_buf
*
,
size_t
);
extern
void
_copy_from_pages
(
char
*
,
struct
page
**
,
size_t
,
size_t
);
extern
void
xdr_buf_from_iov
(
struct
io
vec
*
,
struct
xdr_buf
*
);
extern
void
xdr_buf_from_iov
(
struct
k
vec
*
,
struct
xdr_buf
*
);
extern
int
xdr_buf_subsegment
(
struct
xdr_buf
*
,
struct
xdr_buf
*
,
int
,
int
);
extern
int
xdr_buf_read_netobj
(
struct
xdr_buf
*
,
struct
xdr_netobj
*
,
int
);
extern
int
read_bytes_from_xdr_buf
(
struct
xdr_buf
*
buf
,
int
base
,
void
*
obj
,
int
len
);
...
...
@@ -182,7 +182,7 @@ struct xdr_stream {
struct
xdr_buf
*
buf
;
/* XDR buffer to read/write */
uint32_t
*
end
;
/* end of available buffer space */
struct
iovec
*
iov
;
/* pointer to the current io
vec */
struct
kvec
*
iov
;
/* pointer to the current k
vec */
};
extern
void
xdr_init_encode
(
struct
xdr_stream
*
xdr
,
struct
xdr_buf
*
buf
,
uint32_t
*
p
);
...
...
net/sunrpc/auth_gss/auth_gss.c
View file @
b145333f
...
...
@@ -417,7 +417,7 @@ gss_upcall(struct rpc_clnt *clnt, struct rpc_task *task, struct rpc_cred *cred)
static
ssize_t
gss_pipe_upcall
(
struct
file
*
filp
,
struct
rpc_pipe_msg
*
msg
,
char
*
dst
,
size_t
buflen
)
char
__user
*
dst
,
size_t
buflen
)
{
char
*
data
=
(
char
*
)
msg
->
data
+
msg
->
copied
;
ssize_t
mlen
=
msg
->
len
;
...
...
@@ -439,7 +439,7 @@ gss_pipe_upcall(struct file *filp, struct rpc_pipe_msg *msg,
#define MSG_BUF_MAXSIZE 1024
static
ssize_t
gss_pipe_downcall
(
struct
file
*
filp
,
const
char
*
src
,
size_t
mlen
)
gss_pipe_downcall
(
struct
file
*
filp
,
const
char
__user
*
src
,
size_t
mlen
)
{
struct
xdr_netobj
obj
=
{
.
len
=
mlen
,
...
...
@@ -697,7 +697,7 @@ gss_marshal(struct rpc_task *task, u32 *p, int ruid)
struct
rpc_rqst
*
req
=
task
->
tk_rqstp
;
u32
maj_stat
=
0
;
struct
xdr_netobj
mic
;
struct
io
vec
iov
;
struct
k
vec
iov
;
struct
xdr_buf
verf_buf
;
u32
service
;
...
...
@@ -774,7 +774,7 @@ gss_validate(struct rpc_task *task, u32 *p)
gc_base
);
struct
gss_cl_ctx
*
ctx
=
gss_cred_get_ctx
(
cred
);
u32
seq
,
qop_state
;
struct
io
vec
iov
;
struct
k
vec
iov
;
struct
xdr_buf
verf_buf
;
struct
xdr_netobj
mic
;
u32
flav
,
len
;
...
...
@@ -830,7 +830,7 @@ gss_wrap_req_integ(struct gss_cl_ctx *ctx,
u32
*
integ_len
=
NULL
;
struct
xdr_netobj
mic
;
u32
offset
,
*
q
;
struct
io
vec
*
iov
;
struct
k
vec
*
iov
;
u32
maj_stat
=
0
;
int
status
=
-
EIO
;
...
...
net/sunrpc/auth_gss/svcauth_gss.c
View file @
b145333f
...
...
@@ -503,7 +503,7 @@ static inline u32 round_up_to_quad(u32 i)
}
static
inline
int
svc_safe_getnetobj
(
struct
io
vec
*
argv
,
struct
xdr_netobj
*
o
)
svc_safe_getnetobj
(
struct
k
vec
*
argv
,
struct
xdr_netobj
*
o
)
{
int
l
;
...
...
@@ -520,7 +520,7 @@ svc_safe_getnetobj(struct iovec *argv, struct xdr_netobj *o)
}
static
inline
int
svc_safe_putnetobj
(
struct
io
vec
*
resv
,
struct
xdr_netobj
*
o
)
svc_safe_putnetobj
(
struct
k
vec
*
resv
,
struct
xdr_netobj
*
o
)
{
u32
*
p
;
...
...
@@ -548,8 +548,8 @@ gss_verify_header(struct svc_rqst *rqstp, struct rsc *rsci,
struct
xdr_buf
rpchdr
;
struct
xdr_netobj
checksum
;
u32
flavor
=
0
;
struct
io
vec
*
argv
=
&
rqstp
->
rq_arg
.
head
[
0
];
struct
io
vec
iov
;
struct
k
vec
*
argv
=
&
rqstp
->
rq_arg
.
head
[
0
];
struct
k
vec
iov
;
/* data to compute the checksum over: */
iov
.
iov_base
=
rpcstart
;
...
...
@@ -595,7 +595,7 @@ gss_write_verf(struct svc_rqst *rqstp, struct gss_ctx *ctx_id, u32 seq)
struct
xdr_buf
verf_data
;
struct
xdr_netobj
mic
;
u32
*
p
;
struct
io
vec
iov
;
struct
k
vec
iov
;
svc_putu32
(
rqstp
->
rq_res
.
head
,
htonl
(
RPC_AUTH_GSS
));
xdr_seq
=
htonl
(
seq
);
...
...
@@ -743,8 +743,8 @@ struct gss_svc_data {
static
int
svcauth_gss_accept
(
struct
svc_rqst
*
rqstp
,
u32
*
authp
)
{
struct
io
vec
*
argv
=
&
rqstp
->
rq_arg
.
head
[
0
];
struct
io
vec
*
resv
=
&
rqstp
->
rq_res
.
head
[
0
];
struct
k
vec
*
argv
=
&
rqstp
->
rq_arg
.
head
[
0
];
struct
k
vec
*
resv
=
&
rqstp
->
rq_res
.
head
[
0
];
u32
crlen
;
struct
xdr_netobj
tmpobj
;
struct
gss_svc_data
*
svcdata
=
rqstp
->
rq_auth_data
;
...
...
@@ -952,7 +952,7 @@ svcauth_gss_release(struct svc_rqst *rqstp)
struct
xdr_buf
*
resbuf
=
&
rqstp
->
rq_res
;
struct
xdr_buf
integ_buf
;
struct
xdr_netobj
mic
;
struct
io
vec
*
resv
;
struct
k
vec
*
resv
;
u32
*
p
;
int
integ_offset
,
integ_len
;
int
stat
=
-
EINVAL
;
...
...
net/sunrpc/svc.c
View file @
b145333f
...
...
@@ -257,8 +257,8 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
struct
svc_program
*
progp
;
struct
svc_version
*
versp
=
NULL
;
/* compiler food */
struct
svc_procedure
*
procp
=
NULL
;
struct
io
vec
*
argv
=
&
rqstp
->
rq_arg
.
head
[
0
];
struct
io
vec
*
resv
=
&
rqstp
->
rq_res
.
head
[
0
];
struct
k
vec
*
argv
=
&
rqstp
->
rq_arg
.
head
[
0
];
struct
k
vec
*
resv
=
&
rqstp
->
rq_res
.
head
[
0
];
kxdrproc_t
xdr
;
u32
*
statp
;
u32
dir
,
prog
,
vers
,
proc
,
...
...
net/sunrpc/svcauth_unix.c
View file @
b145333f
...
...
@@ -338,8 +338,8 @@ void svcauth_unix_purge(void)
static
int
svcauth_null_accept
(
struct
svc_rqst
*
rqstp
,
u32
*
authp
)
{
struct
io
vec
*
argv
=
&
rqstp
->
rq_arg
.
head
[
0
];
struct
io
vec
*
resv
=
&
rqstp
->
rq_res
.
head
[
0
];
struct
k
vec
*
argv
=
&
rqstp
->
rq_arg
.
head
[
0
];
struct
k
vec
*
resv
=
&
rqstp
->
rq_res
.
head
[
0
];
int
rv
=
0
;
struct
ip_map
key
,
*
ipm
;
...
...
@@ -422,8 +422,8 @@ struct auth_ops svcauth_null = {
int
svcauth_unix_accept
(
struct
svc_rqst
*
rqstp
,
u32
*
authp
)
{
struct
io
vec
*
argv
=
&
rqstp
->
rq_arg
.
head
[
0
];
struct
io
vec
*
resv
=
&
rqstp
->
rq_res
.
head
[
0
];
struct
k
vec
*
argv
=
&
rqstp
->
rq_arg
.
head
[
0
];
struct
k
vec
*
resv
=
&
rqstp
->
rq_res
.
head
[
0
];
struct
svc_cred
*
cred
=
&
rqstp
->
rq_cred
;
u32
slen
,
i
;
int
len
=
argv
->
iov_len
;
...
...
net/sunrpc/svcsock.c
View file @
b145333f
...
...
@@ -450,9 +450,8 @@ svc_recv_available(struct svc_sock *svsk)
* Generic recvfrom routine.
*/
static
int
svc_recvfrom
(
struct
svc_rqst
*
rqstp
,
struct
io
vec
*
iov
,
int
nr
,
int
buflen
)
svc_recvfrom
(
struct
svc_rqst
*
rqstp
,
struct
k
vec
*
iov
,
int
nr
,
int
buflen
)
{
mm_segment_t
oldfs
;
struct
msghdr
msg
;
struct
socket
*
sock
;
int
len
,
alen
;
...
...
@@ -462,16 +461,12 @@ svc_recvfrom(struct svc_rqst *rqstp, struct iovec *iov, int nr, int buflen)
msg
.
msg_name
=
&
rqstp
->
rq_addr
;
msg
.
msg_namelen
=
sizeof
(
rqstp
->
rq_addr
);
msg
.
msg_iov
=
iov
;
msg
.
msg_iovlen
=
nr
;
msg
.
msg_control
=
NULL
;
msg
.
msg_controllen
=
0
;
msg
.
msg_flags
=
MSG_DONTWAIT
;
oldfs
=
get_fs
();
set_fs
(
KERNEL_DS
);
len
=
sock_recvmsg
(
sock
,
&
msg
,
buflen
,
MSG_DONTWAIT
);
set_fs
(
oldfs
);
len
=
kernel_recvmsg
(
sock
,
&
msg
,
iov
,
nr
,
buflen
,
MSG_DONTWAIT
);
/* sock_recvmsg doesn't fill in the name/namelen, so we must..
* possibly we should cache this in the svc_sock structure
...
...
@@ -898,7 +893,7 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)
struct
svc_sock
*
svsk
=
rqstp
->
rq_sock
;
struct
svc_serv
*
serv
=
svsk
->
sk_server
;
int
len
;
struct
io
vec
vec
[
RPCSVC_MAXPAGES
];
struct
k
vec
vec
[
RPCSVC_MAXPAGES
];
int
pnum
,
vlen
;
dprintk
(
"svc: tcp_recv %p data %d conn %d close %d
\n
"
,
...
...
@@ -942,7 +937,7 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)
*/
if
(
svsk
->
sk_tcplen
<
4
)
{
unsigned
long
want
=
4
-
svsk
->
sk_tcplen
;
struct
io
vec
iov
;
struct
k
vec
iov
;
iov
.
iov_base
=
((
char
*
)
&
svsk
->
sk_reclen
)
+
svsk
->
sk_tcplen
;
iov
.
iov_len
=
want
;
...
...
@@ -1056,8 +1051,8 @@ svc_tcp_sendto(struct svc_rqst *rqstp)
int
sent
;
u32
reclen
;
/* Set up the first element of the reply
io
vec.
* Any other
io
vecs that may be in use have been taken
/* Set up the first element of the reply
k
vec.
* Any other
k
vecs that may be in use have been taken
* care of by the server implementation itself.
*/
reclen
=
htonl
(
0x80000000
|
((
xbufp
->
len
)
-
4
));
...
...
net/sunrpc/xdr.c
View file @
b145333f
...
...
@@ -141,7 +141,7 @@ void
xdr_encode_pages
(
struct
xdr_buf
*
xdr
,
struct
page
**
pages
,
unsigned
int
base
,
unsigned
int
len
)
{
struct
io
vec
*
tail
=
xdr
->
tail
;
struct
k
vec
*
tail
=
xdr
->
tail
;
u32
*
p
;
xdr
->
pages
=
pages
;
...
...
@@ -168,8 +168,8 @@ void
xdr_inline_pages
(
struct
xdr_buf
*
xdr
,
unsigned
int
offset
,
struct
page
**
pages
,
unsigned
int
base
,
unsigned
int
len
)
{
struct
io
vec
*
head
=
xdr
->
head
;
struct
io
vec
*
tail
=
xdr
->
tail
;
struct
k
vec
*
head
=
xdr
->
head
;
struct
k
vec
*
tail
=
xdr
->
tail
;
char
*
buf
=
(
char
*
)
head
->
iov_base
;
unsigned
int
buflen
=
head
->
iov_len
;
...
...
@@ -186,19 +186,19 @@ xdr_inline_pages(struct xdr_buf *xdr, unsigned int offset,
}
/*
* Realign the
io
vec if the server missed out some reply elements
* Realign the
k
vec if the server missed out some reply elements
* (such as post-op attributes,...)
* Note: This is a simple implementation that assumes that
* len <= iov->iov_len !!!
* The RPC header (assumed to be the 1st element in the iov array)
* is not shifted.
*/
void
xdr_shift_iovec
(
struct
io
vec
*
iov
,
int
nr
,
size_t
len
)
void
xdr_shift_iovec
(
struct
k
vec
*
iov
,
int
nr
,
size_t
len
)
{
struct
io
vec
*
pvec
;
struct
k
vec
*
pvec
;
for
(
pvec
=
iov
+
nr
-
1
;
nr
>
1
;
nr
--
,
pvec
--
)
{
struct
io
vec
*
svec
=
pvec
-
1
;
struct
k
vec
*
svec
=
pvec
-
1
;
if
(
len
>
pvec
->
iov_len
)
{
printk
(
KERN_DEBUG
"RPC: Urk! Large shift of short iovec.
\n
"
);
...
...
@@ -217,11 +217,11 @@ void xdr_shift_iovec(struct iovec *iov, int nr, size_t len)
}
/*
* Map a struct xdr_buf into an
io
vec array.
* Map a struct xdr_buf into an
k
vec array.
*/
int
xdr_kmap
(
struct
io
vec
*
iov_base
,
struct
xdr_buf
*
xdr
,
size_t
base
)
int
xdr_kmap
(
struct
k
vec
*
iov_base
,
struct
xdr_buf
*
xdr
,
size_t
base
)
{
struct
io
vec
*
iov
=
iov_base
;
struct
k
vec
*
iov
=
iov_base
;
struct
page
**
ppage
=
xdr
->
pages
;
unsigned
int
len
,
pglen
=
xdr
->
page_len
;
...
...
@@ -371,11 +371,10 @@ xdr_sendpages(struct socket *sock, struct sockaddr *addr, int addrlen,
unsigned
int
len
,
pglen
=
xdr
->
page_len
;
int
err
,
ret
=
0
;
ssize_t
(
*
sendpage
)(
struct
socket
*
,
struct
page
*
,
int
,
size_t
,
int
);
mm_segment_t
oldfs
;
len
=
xdr
->
head
[
0
].
iov_len
;
if
(
base
<
len
||
(
addr
!=
NULL
&&
base
==
0
))
{
struct
io
vec
iov
=
{
struct
k
vec
iov
=
{
.
iov_base
=
xdr
->
head
[
0
].
iov_base
+
base
,
.
iov_len
=
len
-
base
,
};
...
...
@@ -384,16 +383,13 @@ xdr_sendpages(struct socket *sock, struct sockaddr *addr, int addrlen,
.
msg_namelen
=
addrlen
,
.
msg_flags
=
msgflags
,
};
if
(
iov
.
iov_len
!=
0
)
{
msg
.
msg_iov
=
&
iov
;
msg
.
msg_iovlen
=
1
;
}
if
(
xdr
->
len
>
len
)
msg
.
msg_flags
|=
MSG_MORE
;
oldfs
=
get_fs
();
set_fs
(
get_ds
());
err
=
sock_sendmsg
(
sock
,
&
msg
,
iov
.
iov_len
);
set_fs
(
oldfs
);
if
(
iov
.
iov_len
!=
0
)
err
=
kernel_sendmsg
(
sock
,
&
msg
,
&
iov
,
1
,
iov
.
iov_len
);
else
err
=
kernel_sendmsg
(
sock
,
&
msg
,
NULL
,
0
,
0
);
if
(
ret
==
0
)
ret
=
err
;
else
if
(
err
>
0
)
...
...
@@ -446,18 +442,14 @@ xdr_sendpages(struct socket *sock, struct sockaddr *addr, int addrlen,
copy_tail:
len
=
xdr
->
tail
[
0
].
iov_len
;
if
(
base
<
len
)
{
struct
io
vec
iov
=
{
struct
k
vec
iov
=
{
.
iov_base
=
xdr
->
tail
[
0
].
iov_base
+
base
,
.
iov_len
=
len
-
base
,
};
struct
msghdr
msg
=
{
.
msg_iov
=
&
iov
,
.
msg_iovlen
=
1
,
.
msg_flags
=
msgflags
,
};
oldfs
=
get_fs
();
set_fs
(
get_ds
());
err
=
sock_sendmsg
(
sock
,
&
msg
,
iov
.
iov_len
);
set_fs
(
oldfs
);
err
=
kernel_sendmsg
(
sock
,
&
msg
,
&
iov
,
1
,
iov
.
iov_len
);
if
(
ret
==
0
)
ret
=
err
;
else
if
(
err
>
0
)
...
...
@@ -614,14 +606,14 @@ _copy_from_pages(char *p, struct page **pages, size_t pgbase, size_t len)
* @buf: xdr_buf
* @len: bytes to remove from buf->head[0]
*
* Shrinks XDR buffer's header
io
vec buf->head[0] by
* Shrinks XDR buffer's header
k
vec buf->head[0] by
* 'len' bytes. The extra data is not lost, but is instead
* moved into the inlined pages and/or the tail.
*/
void
xdr_shrink_bufhead
(
struct
xdr_buf
*
buf
,
size_t
len
)
{
struct
io
vec
*
head
,
*
tail
;
struct
k
vec
*
head
,
*
tail
;
size_t
copy
,
offs
;
unsigned
int
pglen
=
buf
->
page_len
;
...
...
@@ -694,7 +686,7 @@ xdr_shrink_bufhead(struct xdr_buf *buf, size_t len)
void
xdr_shrink_pagelen
(
struct
xdr_buf
*
buf
,
size_t
len
)
{
struct
io
vec
*
tail
;
struct
k
vec
*
tail
;
size_t
copy
;
char
*
p
;
unsigned
int
pglen
=
buf
->
page_len
;
...
...
@@ -738,15 +730,15 @@ xdr_shift_buf(struct xdr_buf *buf, size_t len)
* @p: current pointer inside XDR buffer
*
* Note: at the moment the RPC client only passes the length of our
* scratch buffer in the xdr_buf's header
io
vec. Previously this
* scratch buffer in the xdr_buf's header
k
vec. Previously this
* meant we needed to call xdr_adjust_iovec() after encoding the
* data. With the new scheme, the xdr_stream manages the details
* of the buffer length, and takes care of adjusting the
io
vec
* of the buffer length, and takes care of adjusting the
k
vec
* length for us.
*/
void
xdr_init_encode
(
struct
xdr_stream
*
xdr
,
struct
xdr_buf
*
buf
,
uint32_t
*
p
)
{
struct
io
vec
*
iov
=
buf
->
head
;
struct
k
vec
*
iov
=
buf
->
head
;
xdr
->
buf
=
buf
;
xdr
->
iov
=
iov
;
...
...
@@ -763,7 +755,7 @@ EXPORT_SYMBOL(xdr_init_encode);
*
* Checks that we have enough buffer space to encode 'nbytes' more
* bytes of data. If so, update the total xdr_buf length, and
* adjust the length of the current
io
vec.
* adjust the length of the current
k
vec.
*/
uint32_t
*
xdr_reserve_space
(
struct
xdr_stream
*
xdr
,
size_t
nbytes
)
{
...
...
@@ -795,7 +787,7 @@ void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, unsigned int b
unsigned
int
len
)
{
struct
xdr_buf
*
buf
=
xdr
->
buf
;
struct
io
vec
*
iov
=
buf
->
tail
;
struct
k
vec
*
iov
=
buf
->
tail
;
buf
->
pages
=
pages
;
buf
->
page_base
=
base
;
buf
->
page_len
=
len
;
...
...
@@ -826,7 +818,7 @@ EXPORT_SYMBOL(xdr_write_pages);
*/
void
xdr_init_decode
(
struct
xdr_stream
*
xdr
,
struct
xdr_buf
*
buf
,
uint32_t
*
p
)
{
struct
io
vec
*
iov
=
buf
->
head
;
struct
k
vec
*
iov
=
buf
->
head
;
unsigned
int
len
=
iov
->
iov_len
;
if
(
len
>
buf
->
len
)
...
...
@@ -873,7 +865,7 @@ EXPORT_SYMBOL(xdr_inline_decode);
void
xdr_read_pages
(
struct
xdr_stream
*
xdr
,
unsigned
int
len
)
{
struct
xdr_buf
*
buf
=
xdr
->
buf
;
struct
io
vec
*
iov
;
struct
k
vec
*
iov
;
ssize_t
shift
;
unsigned
int
end
;
int
padding
;
...
...
@@ -905,10 +897,10 @@ void xdr_read_pages(struct xdr_stream *xdr, unsigned int len)
}
EXPORT_SYMBOL
(
xdr_read_pages
);
static
struct
io
vec
empty_iov
=
{.
iov_base
=
NULL
,
.
iov_len
=
0
};
static
struct
k
vec
empty_iov
=
{.
iov_base
=
NULL
,
.
iov_len
=
0
};
void
xdr_buf_from_iov
(
struct
io
vec
*
iov
,
struct
xdr_buf
*
buf
)
xdr_buf_from_iov
(
struct
k
vec
*
iov
,
struct
xdr_buf
*
buf
)
{
buf
->
head
[
0
]
=
*
iov
;
buf
->
tail
[
0
]
=
empty_iov
;
...
...
@@ -921,7 +913,7 @@ xdr_buf_from_iov(struct iovec *iov, struct xdr_buf *buf)
* length of subiov to zero. Decrements len by length of subiov, sets base
* to zero (or decrements it by length of iov if subiov is empty). */
static
void
iov_subsegment
(
struct
iovec
*
iov
,
struct
io
vec
*
subiov
,
int
*
base
,
int
*
len
)
iov_subsegment
(
struct
kvec
*
iov
,
struct
k
vec
*
subiov
,
int
*
base
,
int
*
len
)
{
if
(
*
base
>
iov
->
iov_len
)
{
subiov
->
iov_base
=
NULL
;
...
...
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