X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lnet%2Flnet%2Flib-socket.c;h=57678b3d8a0be72cb325d2f922098b934121b58a;hb=f173f93032c62bd1f95330f331d3d93ce5a31598;hp=7d0dcbd1bcb0075f7a75cd05a9b7b6c321341edb;hpb=d10200a80770f0029d1d665af954187b9ad883df;p=fs%2Flustre-release.git diff --git a/lnet/lnet/lib-socket.c b/lnet/lnet/lib-socket.c index 7d0dcbd..57678b3 100644 --- a/lnet/lnet/lib-socket.c +++ b/lnet/lnet/lib-socket.c @@ -64,7 +64,11 @@ lnet_sock_ioctl(int cmd, unsigned long arg) int fd = -1; int rc; - rc = sock_create(PF_INET, SOCK_STREAM, 0, &sock); +#ifdef HAVE_SOCK_CREATE_KERN_USE_NET + rc = sock_create_kern(&init_net, PF_INET, SOCK_STREAM, 0, &sock); +#else + rc = sock_create_kern(PF_INET, SOCK_STREAM, 0, &sock); +#endif if (rc != 0) { CERROR("Can't create socket: %d\n", rc); return rc; @@ -413,7 +417,11 @@ lnet_sock_create(struct socket **sockp, int *fatal, /* All errors are fatal except bind failure if the port is in use */ *fatal = 1; - rc = sock_create(PF_INET, SOCK_STREAM, 0, &sock); +#ifdef HAVE_SOCK_CREATE_KERN_USE_NET + rc = sock_create_kern(&init_net, PF_INET, SOCK_STREAM, 0, &sock); +#else + rc = sock_create_kern(PF_INET, SOCK_STREAM, 0, &sock); +#endif *sockp = sock; if (rc != 0) { CERROR("Can't create socket: %d\n", rc); @@ -574,7 +582,11 @@ lnet_sock_accept(struct socket **newsockp, struct socket *sock) newsock->ops = sock->ops; +#ifdef HAVE_KERN_SOCK_ACCEPT_FLAG_ARG + rc = sock->ops->accept(sock, newsock, O_NONBLOCK, false); +#else rc = sock->ops->accept(sock, newsock, O_NONBLOCK); +#endif if (rc == -EAGAIN) { /* Nothing ready, so wait for activity */ init_waitqueue_entry(&wait, current); @@ -582,7 +594,11 @@ lnet_sock_accept(struct socket **newsockp, struct socket *sock) set_current_state(TASK_INTERRUPTIBLE); schedule(); remove_wait_queue(sk_sleep(sock->sk), &wait); +#ifdef HAVE_KERN_SOCK_ACCEPT_FLAG_ARG + rc = sock->ops->accept(sock, newsock, O_NONBLOCK, false); +#else rc = sock->ops->accept(sock, newsock, O_NONBLOCK); +#endif } if (rc != 0)