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
6571a999
Commit
6571a999
authored
Jun 23, 2003
by
Neil Brown
Committed by
Linus Torvalds
Jun 23, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] Get buf size and page count right for RPC services.
The old calculations BUGed on 64k PAGESIZE machines.
parent
4f819f27
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
include/linux/sunrpc/svc.h
include/linux/sunrpc/svc.h
+9
-6
net/sunrpc/svc.c
net/sunrpc/svc.c
+4
-1
No files found.
include/linux/sunrpc/svc.h
View file @
6571a999
...
...
@@ -57,11 +57,11 @@ struct svc_serv {
* Requests are copied into these pages as they arrive. Remaining
* pages are available to write the reply into.
*
*
Currently pages are all re-used by the same server. Later we
*
will use ->sendpage to transmit pages with reduced copying. In
*
that case we will need to give away the page and allocate new ones.
*
In preparation for this, we explicitly move pages off the recv
*
list onto the transmit list, and back
.
*
Pages are sent using ->sendpage so each server thread needs to
*
allocate more to replace those used in sending. To help keep track
*
of these pages we have a receive list where all pages initialy live,
*
and a send list where pages are moved to when there are to be part
*
of a reply
.
*
* We use xdr_buf for holding responses as it fits well with NFS
* read responses (that have a header, and some data pages, and possibly
...
...
@@ -72,8 +72,11 @@ struct svc_serv {
* 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
* in a page - NFSd ensures this. lockd also has no trouble.
*
* Each request/reply pair can have at most one "payload", plus two pages,
* one for the request, and one for the reply.
*/
#define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE +
1
)
#define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE +
2
)
static
inline
u32
svc_getu32
(
struct
iovec
*
iov
)
{
...
...
net/sunrpc/svc.c
View file @
6571a999
...
...
@@ -113,9 +113,12 @@ svc_destroy(struct svc_serv *serv)
static
int
svc_init_buffer
(
struct
svc_rqst
*
rqstp
,
unsigned
int
size
)
{
int
pages
=
2
+
(
size
+
PAGE_SIZE
-
1
)
/
PAGE_SIZE
;
int
pages
;
int
arghi
;
if
(
size
>
RPCSVC_MAXPAYLOAD
)
size
=
RPCSVC_MAXPAYLOAD
;
pages
=
2
+
(
size
+
PAGE_SIZE
-
1
)
/
PAGE_SIZE
;
rqstp
->
rq_argused
=
0
;
rqstp
->
rq_resused
=
0
;
arghi
=
0
;
...
...
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