Received: by 10.223.176.46 with SMTP id f43csp3337980wra; Mon, 22 Jan 2018 12:22:20 -0800 (PST) X-Google-Smtp-Source: AH8x2245fyoqccnS6XH+Mheq5nPJlQaAgO6fLee3IEJPTZBp2Qmz7p9qHrUifH3rwDck9kJ6Yfa7 X-Received: by 10.107.136.86 with SMTP id k83mr156876iod.128.1516652540005; Mon, 22 Jan 2018 12:22:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516652539; cv=none; d=google.com; s=arc-20160816; b=sRYGcNf56NSpwt2hVbAmcQ600zSnJtqGC+w5HE4n+GCLBkiOcetdiynarNsJSNIrDS sHYvN4hrMc6zyabaFovg1ZKl2CeAlt3sgFde4v6yCyWFNcP0wmK55rv5EJy4WPBD7qaV QhBRp6HhNfZCVHHSHVyt9Zp6LDXurlLB1fN669PgxeI0T5p9uyZc6jWRyfBzbHrt4yQN WcD+DTWQ4ly8L1mDgT/VkTrmcal+/d6m80gVuTGfPZazVqVBvjZdoY0o5+AJQdL9BG9h lVw7rAjRYFsLjgBHEYQqDAXp0lrmKHipmrGog20z+/4rP8HBJsRIJ1Spzs+Tp63jFcR7 Crkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=WNxwEV8k7SDnygB+PlcFC0mZF/iravB7I/oFLu58pLw=; b=BqcJccTdKkfqPjhRzepKY1u+8O5YnhdJgBtHJ+e57K7zTCgKhuOLwf17WzJ0vxpWqV 1izIrQT0T16wKh1cwOAJUapsBKmYpX3EPPeYdd3L5GWv5mwsOw1V68Go08YjG4Q7qqRG TwXWif29PO5xhDnL2HdgIa5yEhn6X3PET+mXoG2jAUvwsYt/y5Z34NQ1lEzGsCXymxuL zTbwyykHvbqQwxgvuKtxRcoX6aVQtFQuCGeqPhNppUdnKHow3iO+C0M5GsVIAbagtbo8 W1MoCFC56xuGqzyYve99OlTLxus7l0MsCa9SWI9J5ZwXU0LttvsRtFZquB6dpkuObeHI stEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=hRYQ/Gw1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 21si6852588itu.74.2018.01.22.12.22.06; Mon, 22 Jan 2018 12:22:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=hRYQ/Gw1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751687AbeAVUNz (ORCPT + 99 others); Mon, 22 Jan 2018 15:13:55 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:48427 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751655AbeAVUNu (ORCPT ); Mon, 22 Jan 2018 15:13:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WNxwEV8k7SDnygB+PlcFC0mZF/iravB7I/oFLu58pLw=; b=hRYQ/Gw1x2LekO9OzdFMTkqM8 yyDt6tF1lfaGUAAs2E+AHJ76uNd3sg5rkce9BDFghXxVeP+c5kPEA0LIQddeRhLKaohyRdNIUCqUU gFbiMKCT1Q+o/DUyHSSXDjG0zgdSCiByAcZimteRkFajfxUPLp1D0YVTiIQ27oyj+lzd0zLFSgFwW g9ELWHY/HjcvJAPPYdgMTFEqBpZ8Tzm2zQ0O1PUkvj1ADFW/zXR5F2bs1uE/UvzycUyslGTjiYPbY DR+SdhNaz/V93gEJeKR3DOsnS0f6yM7/E9wFlLFjWk0fJP5BSabLOrZ05aZvSVg0ADHFNpilqKpGK HzAn/kzxg==; Received: from 178.114.226.247.wireless.dyn.drei.com ([178.114.226.247] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1ediTU-0007fK-S0; Mon, 22 Jan 2018 20:13:49 +0000 From: Christoph Hellwig To: viro@zeniv.linux.org.uk Cc: Avi Kivity , linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 19/36] net/unix: convert to ->poll_mask Date: Mon, 22 Jan 2018 21:12:26 +0100 Message-Id: <20180122201243.31610-20-hch@lst.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180122201243.31610-1-hch@lst.de> References: <20180122201243.31610-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Christoph Hellwig --- net/unix/af_unix.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 6b7678df41e5..f426a6f68355 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -638,9 +638,8 @@ static int unix_stream_connect(struct socket *, struct sockaddr *, static int unix_socketpair(struct socket *, struct socket *); static int unix_accept(struct socket *, struct socket *, int, bool); static int unix_getname(struct socket *, struct sockaddr *, int *, int); -static __poll_t unix_poll(struct file *, struct socket *, poll_table *); -static __poll_t unix_dgram_poll(struct file *, struct socket *, - poll_table *); +static __poll_t unix_poll_mask(struct socket *, __poll_t); +static __poll_t unix_dgram_poll_mask(struct socket *, __poll_t); static int unix_ioctl(struct socket *, unsigned int, unsigned long); static int unix_shutdown(struct socket *, int); static int unix_stream_sendmsg(struct socket *, struct msghdr *, size_t); @@ -681,7 +680,7 @@ static const struct proto_ops unix_stream_ops = { .socketpair = unix_socketpair, .accept = unix_accept, .getname = unix_getname, - .poll = unix_poll, + .poll_mask = unix_poll_mask, .ioctl = unix_ioctl, .listen = unix_listen, .shutdown = unix_shutdown, @@ -704,7 +703,7 @@ static const struct proto_ops unix_dgram_ops = { .socketpair = unix_socketpair, .accept = sock_no_accept, .getname = unix_getname, - .poll = unix_dgram_poll, + .poll_mask = unix_dgram_poll_mask, .ioctl = unix_ioctl, .listen = sock_no_listen, .shutdown = unix_shutdown, @@ -726,7 +725,7 @@ static const struct proto_ops unix_seqpacket_ops = { .socketpair = unix_socketpair, .accept = unix_accept, .getname = unix_getname, - .poll = unix_dgram_poll, + .poll_mask = unix_dgram_poll_mask, .ioctl = unix_ioctl, .listen = unix_listen, .shutdown = unix_shutdown, @@ -2640,13 +2639,10 @@ static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) return err; } -static __poll_t unix_poll(struct file *file, struct socket *sock, poll_table *wait) +static __poll_t unix_poll_mask(struct socket *sock, __poll_t events) { struct sock *sk = sock->sk; - __poll_t mask; - - sock_poll_wait(file, sk_sleep(sk), wait); - mask = 0; + __poll_t mask = 0; /* exceptional events? */ if (sk->sk_err) @@ -2675,15 +2671,11 @@ static __poll_t unix_poll(struct file *file, struct socket *sock, poll_table *wa return mask; } -static __poll_t unix_dgram_poll(struct file *file, struct socket *sock, - poll_table *wait) +static __poll_t unix_dgram_poll_mask(struct socket *sock, __poll_t events) { struct sock *sk = sock->sk, *other; - unsigned int writable; - __poll_t mask; - - sock_poll_wait(file, sk_sleep(sk), wait); - mask = 0; + int writable; + __poll_t mask = 0; /* exceptional events? */ if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) @@ -2709,7 +2701,7 @@ static __poll_t unix_dgram_poll(struct file *file, struct socket *sock, } /* No write status requested, avoid expensive OUT tests. */ - if (!(poll_requested_events(wait) & (POLLWRBAND|POLLWRNORM|POLLOUT))) + if (!(events & (POLLWRBAND|POLLWRNORM|POLLOUT))) return mask; writable = unix_writable(sk); -- 2.14.2