aboutsummaryrefslogtreecommitdiffstats
path: root/net/rds/af_rds.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/rds/af_rds.c')
-rw-r--r--net/rds/af_rds.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c
index 98e05382fd3c..f81862baf4d0 100644
--- a/net/rds/af_rds.c
+++ b/net/rds/af_rds.c
@@ -33,6 +33,7 @@
33#include <linux/module.h> 33#include <linux/module.h>
34#include <linux/errno.h> 34#include <linux/errno.h>
35#include <linux/kernel.h> 35#include <linux/kernel.h>
36#include <linux/gfp.h>
36#include <linux/in.h> 37#include <linux/in.h>
37#include <linux/poll.h> 38#include <linux/poll.h>
38#include <net/sock.h> 39#include <net/sock.h>
@@ -174,8 +175,8 @@ static unsigned int rds_poll(struct file *file, struct socket *sock,
174 mask |= (POLLIN | POLLRDNORM); 175 mask |= (POLLIN | POLLRDNORM);
175 spin_unlock(&rs->rs_lock); 176 spin_unlock(&rs->rs_lock);
176 } 177 }
177 if (!list_empty(&rs->rs_recv_queue) 178 if (!list_empty(&rs->rs_recv_queue) ||
178 || !list_empty(&rs->rs_notify_queue)) 179 !list_empty(&rs->rs_notify_queue))
179 mask |= (POLLIN | POLLRDNORM); 180 mask |= (POLLIN | POLLRDNORM);
180 if (rs->rs_snd_bytes < rds_sk_sndbuf(rs)) 181 if (rs->rs_snd_bytes < rds_sk_sndbuf(rs))
181 mask |= (POLLOUT | POLLWRNORM); 182 mask |= (POLLOUT | POLLWRNORM);
@@ -265,6 +266,9 @@ static int rds_setsockopt(struct socket *sock, int level, int optname,
265 case RDS_GET_MR: 266 case RDS_GET_MR:
266 ret = rds_get_mr(rs, optval, optlen); 267 ret = rds_get_mr(rs, optval, optlen);
267 break; 268 break;
269 case RDS_GET_MR_FOR_DEST:
270 ret = rds_get_mr_for_dest(rs, optval, optlen);
271 break;
268 case RDS_FREE_MR: 272 case RDS_FREE_MR:
269 ret = rds_free_mr(rs, optval, optlen); 273 ret = rds_free_mr(rs, optval, optlen);
270 break; 274 break;
@@ -305,8 +309,8 @@ static int rds_getsockopt(struct socket *sock, int level, int optname,
305 if (len < sizeof(int)) 309 if (len < sizeof(int))
306 ret = -EINVAL; 310 ret = -EINVAL;
307 else 311 else
308 if (put_user(rs->rs_recverr, (int __user *) optval) 312 if (put_user(rs->rs_recverr, (int __user *) optval) ||
309 || put_user(sizeof(int), optlen)) 313 put_user(sizeof(int), optlen))
310 ret = -EFAULT; 314 ret = -EFAULT;
311 else 315 else
312 ret = 0; 316 ret = 0;
@@ -407,7 +411,8 @@ static int __rds_create(struct socket *sock, struct sock *sk, int protocol)
407 return 0; 411 return 0;
408} 412}
409 413
410static int rds_create(struct net *net, struct socket *sock, int protocol) 414static int rds_create(struct net *net, struct socket *sock, int protocol,
415 int kern)
411{ 416{
412 struct sock *sk; 417 struct sock *sk;
413 418
@@ -431,7 +436,7 @@ void rds_sock_put(struct rds_sock *rs)
431 sock_put(rds_rs_to_sk(rs)); 436 sock_put(rds_rs_to_sk(rs));
432} 437}
433 438
434static struct net_proto_family rds_family_ops = { 439static const struct net_proto_family rds_family_ops = {
435 .family = AF_RDS, 440 .family = AF_RDS,
436 .create = rds_create, 441 .create = rds_create,
437 .owner = THIS_MODULE, 442 .owner = THIS_MODULE,