diff options
author | Pavel Emelyanov <xemul@parallels.com> | 2010-10-05 15:30:19 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2010-10-19 10:48:16 -0400 |
commit | 8f3a6de313391b6910aa7db185eb9f3e930a51cf (patch) | |
tree | 9f288895541f1f5feb06f6f3964671d63850df2f | |
parent | 50fa0d40a9d601bb8e6c9a595e90940bc846f7df (diff) |
sunrpc: Turn list_for_each-s into the ..._entry-s
Saves some lines of code and some branticks when reading one.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r-- | net/sunrpc/svc_xprt.c | 6 | ||||
-rw-r--r-- | net/sunrpc/svcsock.c | 12 | ||||
-rw-r--r-- | net/sunrpc/xprt.c | 6 |
3 files changed, 7 insertions, 17 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 12025eedc78..bef1e8844a2 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -100,16 +100,14 @@ EXPORT_SYMBOL_GPL(svc_unreg_xprt_class); | |||
100 | */ | 100 | */ |
101 | int svc_print_xprts(char *buf, int maxlen) | 101 | int svc_print_xprts(char *buf, int maxlen) |
102 | { | 102 | { |
103 | struct list_head *le; | 103 | struct svc_xprt_class *xcl; |
104 | char tmpstr[80]; | 104 | char tmpstr[80]; |
105 | int len = 0; | 105 | int len = 0; |
106 | buf[0] = '\0'; | 106 | buf[0] = '\0'; |
107 | 107 | ||
108 | spin_lock(&svc_xprt_class_lock); | 108 | spin_lock(&svc_xprt_class_lock); |
109 | list_for_each(le, &svc_xprt_class_list) { | 109 | list_for_each_entry(xcl, &svc_xprt_class_list, xcl_list) { |
110 | int slen; | 110 | int slen; |
111 | struct svc_xprt_class *xcl = | ||
112 | list_entry(le, struct svc_xprt_class, xcl_list); | ||
113 | 111 | ||
114 | sprintf(tmpstr, "%s %d\n", xcl->xcl_name, xcl->xcl_max_payload); | 112 | sprintf(tmpstr, "%s %d\n", xcl->xcl_name, xcl->xcl_max_payload); |
115 | slen = strlen(tmpstr); | 113 | slen = strlen(tmpstr); |
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 88de3d09316..1454739b423 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -1261,19 +1261,13 @@ void svc_sock_update_bufs(struct svc_serv *serv) | |||
1261 | * The number of server threads has changed. Update | 1261 | * The number of server threads has changed. Update |
1262 | * rcvbuf and sndbuf accordingly on all sockets | 1262 | * rcvbuf and sndbuf accordingly on all sockets |
1263 | */ | 1263 | */ |
1264 | struct list_head *le; | 1264 | struct svc_sock *svsk; |
1265 | 1265 | ||
1266 | spin_lock_bh(&serv->sv_lock); | 1266 | spin_lock_bh(&serv->sv_lock); |
1267 | list_for_each(le, &serv->sv_permsocks) { | 1267 | list_for_each_entry(svsk, &serv->sv_permsocks, sk_xprt.xpt_list) |
1268 | struct svc_sock *svsk = | ||
1269 | list_entry(le, struct svc_sock, sk_xprt.xpt_list); | ||
1270 | set_bit(XPT_CHNGBUF, &svsk->sk_xprt.xpt_flags); | 1268 | set_bit(XPT_CHNGBUF, &svsk->sk_xprt.xpt_flags); |
1271 | } | 1269 | list_for_each_entry(svsk, &serv->sv_tempsocks, sk_xprt.xpt_list) |
1272 | list_for_each(le, &serv->sv_tempsocks) { | ||
1273 | struct svc_sock *svsk = | ||
1274 | list_entry(le, struct svc_sock, sk_xprt.xpt_list); | ||
1275 | set_bit(XPT_CHNGBUF, &svsk->sk_xprt.xpt_flags); | 1270 | set_bit(XPT_CHNGBUF, &svsk->sk_xprt.xpt_flags); |
1276 | } | ||
1277 | spin_unlock_bh(&serv->sv_lock); | 1271 | spin_unlock_bh(&serv->sv_lock); |
1278 | } | 1272 | } |
1279 | EXPORT_SYMBOL_GPL(svc_sock_update_bufs); | 1273 | EXPORT_SYMBOL_GPL(svc_sock_update_bufs); |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 64a4a94fd6d..4c8f18aff7c 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -755,13 +755,11 @@ static void xprt_connect_status(struct rpc_task *task) | |||
755 | */ | 755 | */ |
756 | struct rpc_rqst *xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid) | 756 | struct rpc_rqst *xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid) |
757 | { | 757 | { |
758 | struct list_head *pos; | 758 | struct rpc_rqst *entry; |
759 | 759 | ||
760 | list_for_each(pos, &xprt->recv) { | 760 | list_for_each_entry(entry, &xprt->recv, rq_list) |
761 | struct rpc_rqst *entry = list_entry(pos, struct rpc_rqst, rq_list); | ||
762 | if (entry->rq_xid == xid) | 761 | if (entry->rq_xid == xid) |
763 | return entry; | 762 | return entry; |
764 | } | ||
765 | 763 | ||
766 | dprintk("RPC: xprt_lookup_rqst did not find xid %08x\n", | 764 | dprintk("RPC: xprt_lookup_rqst did not find xid %08x\n", |
767 | ntohl(xid)); | 765 | ntohl(xid)); |