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
2881ae74
Commit
2881ae74
authored
Dec 20, 2007
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SUNRPC: Clean up the transport timeout initialisation
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
698b6d08
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
31 deletions
+27
-31
include/linux/sunrpc/xprt.h
include/linux/sunrpc/xprt.h
+0
-5
net/sunrpc/xprt.c
net/sunrpc/xprt.c
+0
-17
net/sunrpc/xprtrdma/transport.c
net/sunrpc/xprtrdma/transport.c
+6
-1
net/sunrpc/xprtsock.c
net/sunrpc/xprtsock.c
+21
-8
No files found.
include/linux/sunrpc/xprt.h
View file @
2881ae74
...
@@ -202,11 +202,6 @@ struct xprt_class {
...
@@ -202,11 +202,6 @@ struct xprt_class {
char
name
[
32
];
char
name
[
32
];
};
};
/*
* Transport operations used by ULPs
*/
void
xprt_set_timeout
(
struct
rpc_timeout
*
to
,
unsigned
int
retr
,
unsigned
long
incr
);
/*
/*
* Generic internal transport functions
* Generic internal transport functions
*/
*/
...
...
net/sunrpc/xprt.c
View file @
2881ae74
...
@@ -977,23 +977,6 @@ void xprt_release(struct rpc_task *task)
...
@@ -977,23 +977,6 @@ void xprt_release(struct rpc_task *task)
spin_unlock
(
&
xprt
->
reserve_lock
);
spin_unlock
(
&
xprt
->
reserve_lock
);
}
}
/**
* xprt_set_timeout - set constant RPC timeout
* @to: RPC timeout parameters to set up
* @retr: number of retries
* @incr: amount of increase after each retry
*
*/
void
xprt_set_timeout
(
struct
rpc_timeout
*
to
,
unsigned
int
retr
,
unsigned
long
incr
)
{
to
->
to_initval
=
to
->
to_increment
=
incr
;
to
->
to_maxval
=
to
->
to_initval
+
(
incr
*
retr
);
to
->
to_retries
=
retr
;
to
->
to_exponential
=
0
;
}
EXPORT_SYMBOL_GPL
(
xprt_set_timeout
);
/**
/**
* xprt_create_transport - create an RPC transport
* xprt_create_transport - create an RPC transport
* @args: rpc transport creation arguments
* @args: rpc transport creation arguments
...
...
net/sunrpc/xprtrdma/transport.c
View file @
2881ae74
...
@@ -289,6 +289,11 @@ xprt_rdma_destroy(struct rpc_xprt *xprt)
...
@@ -289,6 +289,11 @@ xprt_rdma_destroy(struct rpc_xprt *xprt)
module_put
(
THIS_MODULE
);
module_put
(
THIS_MODULE
);
}
}
static
const
struct
rpc_timeout
xprt_rdma_default_timeout
=
{
.
to_initval
=
60
*
HZ
,
.
to_maxval
=
60
*
HZ
,
};
/**
/**
* xprt_setup_rdma - Set up transport to use RDMA
* xprt_setup_rdma - Set up transport to use RDMA
*
*
...
@@ -327,7 +332,7 @@ xprt_setup_rdma(struct xprt_create *args)
...
@@ -327,7 +332,7 @@ xprt_setup_rdma(struct xprt_create *args)
}
}
/* 60 second timeout, no retries */
/* 60 second timeout, no retries */
xprt_set_timeout
(
&
xprt
->
timeout
,
0
,
60UL
*
HZ
);
memcpy
(
&
xprt
->
timeout
,
&
xprt_rdma_default_timeout
,
sizeof
(
xprt
->
timeout
)
);
xprt
->
bind_timeout
=
(
60U
*
HZ
);
xprt
->
bind_timeout
=
(
60U
*
HZ
);
xprt
->
connect_timeout
=
(
60U
*
HZ
);
xprt
->
connect_timeout
=
(
60U
*
HZ
);
xprt
->
reestablish_timeout
=
(
5U
*
HZ
);
xprt
->
reestablish_timeout
=
(
5U
*
HZ
);
...
...
net/sunrpc/xprtsock.c
View file @
2881ae74
...
@@ -1895,6 +1895,13 @@ static struct rpc_xprt *xs_setup_xprt(struct xprt_create *args,
...
@@ -1895,6 +1895,13 @@ static struct rpc_xprt *xs_setup_xprt(struct xprt_create *args,
return
xprt
;
return
xprt
;
}
}
static
const
struct
rpc_timeout
xs_udp_default_timeout
=
{
.
to_initval
=
5
*
HZ
,
.
to_maxval
=
30
*
HZ
,
.
to_increment
=
5
*
HZ
,
.
to_retries
=
5
,
};
/**
/**
* xs_setup_udp - Set up transport to use a UDP socket
* xs_setup_udp - Set up transport to use a UDP socket
* @args: rpc transport creation arguments
* @args: rpc transport creation arguments
...
@@ -1905,6 +1912,7 @@ static struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
...
@@ -1905,6 +1912,7 @@ static struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
struct
sockaddr
*
addr
=
args
->
dstaddr
;
struct
sockaddr
*
addr
=
args
->
dstaddr
;
struct
rpc_xprt
*
xprt
;
struct
rpc_xprt
*
xprt
;
struct
sock_xprt
*
transport
;
struct
sock_xprt
*
transport
;
const
struct
rpc_timeout
*
timeo
=
&
xs_udp_default_timeout
;
xprt
=
xs_setup_xprt
(
args
,
xprt_udp_slot_table_entries
);
xprt
=
xs_setup_xprt
(
args
,
xprt_udp_slot_table_entries
);
if
(
IS_ERR
(
xprt
))
if
(
IS_ERR
(
xprt
))
...
@@ -1923,10 +1931,9 @@ static struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
...
@@ -1923,10 +1931,9 @@ static struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
xprt
->
ops
=
&
xs_udp_ops
;
xprt
->
ops
=
&
xs_udp_ops
;
if
(
args
->
timeout
)
if
(
args
->
timeout
!=
NULL
)
xprt
->
timeout
=
*
args
->
timeout
;
timeo
=
args
->
timeout
;
else
memcpy
(
&
xprt
->
timeout
,
timeo
,
sizeof
(
xprt
->
timeout
));
xprt_set_timeout
(
&
xprt
->
timeout
,
5
,
5
*
HZ
);
switch
(
addr
->
sa_family
)
{
switch
(
addr
->
sa_family
)
{
case
AF_INET
:
case
AF_INET
:
...
@@ -1961,6 +1968,12 @@ static struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
...
@@ -1961,6 +1968,12 @@ static struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
return
ERR_PTR
(
-
EINVAL
);
return
ERR_PTR
(
-
EINVAL
);
}
}
static
const
struct
rpc_timeout
xs_tcp_default_timeout
=
{
.
to_initval
=
60
*
HZ
,
.
to_maxval
=
60
*
HZ
,
.
to_retries
=
2
,
};
/**
/**
* xs_setup_tcp - Set up transport to use a TCP socket
* xs_setup_tcp - Set up transport to use a TCP socket
* @args: rpc transport creation arguments
* @args: rpc transport creation arguments
...
@@ -1971,6 +1984,7 @@ static struct rpc_xprt *xs_setup_tcp(struct xprt_create *args)
...
@@ -1971,6 +1984,7 @@ static struct rpc_xprt *xs_setup_tcp(struct xprt_create *args)
struct
sockaddr
*
addr
=
args
->
dstaddr
;
struct
sockaddr
*
addr
=
args
->
dstaddr
;
struct
rpc_xprt
*
xprt
;
struct
rpc_xprt
*
xprt
;
struct
sock_xprt
*
transport
;
struct
sock_xprt
*
transport
;
const
struct
rpc_timeout
*
timeo
=
&
xs_tcp_default_timeout
;
xprt
=
xs_setup_xprt
(
args
,
xprt_tcp_slot_table_entries
);
xprt
=
xs_setup_xprt
(
args
,
xprt_tcp_slot_table_entries
);
if
(
IS_ERR
(
xprt
))
if
(
IS_ERR
(
xprt
))
...
@@ -1988,10 +2002,9 @@ static struct rpc_xprt *xs_setup_tcp(struct xprt_create *args)
...
@@ -1988,10 +2002,9 @@ static struct rpc_xprt *xs_setup_tcp(struct xprt_create *args)
xprt
->
ops
=
&
xs_tcp_ops
;
xprt
->
ops
=
&
xs_tcp_ops
;
if
(
args
->
timeout
)
if
(
args
->
timeout
!=
NULL
)
xprt
->
timeout
=
*
args
->
timeout
;
timeo
=
args
->
timeout
;
else
memcpy
(
&
xprt
->
timeout
,
timeo
,
sizeof
(
xprt
->
timeout
));
xprt_set_timeout
(
&
xprt
->
timeout
,
2
,
60
*
HZ
);
switch
(
addr
->
sa_family
)
{
switch
(
addr
->
sa_family
)
{
case
AF_INET
:
case
AF_INET
:
...
...
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