Received: by 10.223.176.46 with SMTP id f43csp3332396wra; Mon, 22 Jan 2018 12:16:13 -0800 (PST) X-Google-Smtp-Source: AH8x2244WJQ/IEcaOII1Sw8YXwRGq4EbpvPNny0iLLUvqKGhPTXcE2suQpXsF1k8cIj6VSRnn5np X-Received: by 10.107.186.86 with SMTP id k83mr127120iof.208.1516652173667; Mon, 22 Jan 2018 12:16:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516652173; cv=none; d=google.com; s=arc-20160816; b=Tj8s4oaIGPPKYgM/lqJxtiMCgLyS0I+yXRnggvuHZNTcBpn/YnR03/OXIgl+npfdYM wstSiey2JqeQNMnV00ev07f1ehSvl1wGMEHXJOoHbk/UhYsPD36lorsZlhsqHLIV2YKt 8tA5uXhzzS46I6C7v0ecEC1NlfmWlhdQHAiC+OssGRX/VxqYjbiWyq8dnklEd6GwFN4p U9upbv7HJRV/4UMHNh2f7bZozdgNy6p95/NvZ/YqeamngljhT5ovXfirAxdPAPkN9Xdo XlKJfFLHn5pPnLWt48o+K19AdkEVH9LgYQAcvQ6WYVpXn3MuweiNDsXvBenDSreSFNFN 1dAg== 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=4MwRBDhCLemkmM5gh81R88g8Neg7Wve2HJJ/6AR3mcE=; b=xobgN+aKG7aoXPTdpvwenY6It6XRBA7nJm107N3xZzBwY0z2ckhCz8TViL4vVEE3IK A9qJfGz27RBtmzzPfMrXN193qURcVLO+F3F4HFhqH84LGbBIHRWnty/2JpR9WvymGjh9 QTQft74QjZp9imozc8dRr4TvYVkZ5fijm2j/HP3IcbtZTgAVHz4NSagsjfAoG7QfRZF4 SkGo2c5mRYaYrjrMNqA9yEbT36B1hSv+FLBnlpWGJsUpWulTNXco+wjdIyDJV2naT1M/ JYvLmDR53DBNOlc4rWFAnsW7MPlLptnHhcmtZwh/FV6Gjnc+NFMpfiCqqNprZEs16cUl BM/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=D31xmu6W; 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 x10si6451682iti.171.2018.01.22.12.16.00; Mon, 22 Jan 2018 12:16:13 -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=D31xmu6W; 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 S1751996AbeAVUOp (ORCPT + 99 others); Mon, 22 Jan 2018 15:14:45 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:42641 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751630AbeAVUOl (ORCPT ); Mon, 22 Jan 2018 15:14:41 -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=4MwRBDhCLemkmM5gh81R88g8Neg7Wve2HJJ/6AR3mcE=; b=D31xmu6WBDSmBfx1zY3rj6U2W XDwf5j6jzcO/klKoXHptPNjYSykMyLoaJ1/JSBXyB/bCnjiwvKiWl9G01G4c5NI/q4UVNE04fjfPJ rbWoaMvUkm4K1naTV+9LTag9WB0wzcPCl8FCVzlpcO8vtdYPx24EydajWs/QPXb5B2/meaWQDZsP5 3TzsERUat0gH3fu5aGz7rElhej5TWcVf5Q+A4iVX0wWtRU9jnSHuXWdhNJgjTyH+nKZmQ3C1iNAvP v2x623z8EXN8Ij0xkQgGb7CTIr9F9r1LsyVchO3mh36w0s8OrVN+ceueSGh5omIQcgzHwpYr6Lsw6 5BK2C9ozQ==; 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 1ediUJ-00080Q-FA; Mon, 22 Jan 2018 20:14:39 +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 35/36] timerfd: convert to ->poll_mask Date: Mon, 22 Jan 2018 21:12:42 +0100 Message-Id: <20180122201243.31610-36-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 --- fs/timerfd.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/timerfd.c b/fs/timerfd.c index 0510717f3a53..ee36bb5b2698 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c @@ -226,21 +226,20 @@ static int timerfd_release(struct inode *inode, struct file *file) kfree_rcu(ctx, rcu); return 0; } - -static __poll_t timerfd_poll(struct file *file, poll_table *wait) + +static struct wait_queue_head *timerfd_get_poll_head(struct file *file, + __poll_t eventmask) { struct timerfd_ctx *ctx = file->private_data; - __poll_t events = 0; - unsigned long flags; - poll_wait(file, &ctx->wqh, wait); + return &ctx->wqh; +} - spin_lock_irqsave(&ctx->wqh.lock, flags); - if (ctx->ticks) - events |= POLLIN; - spin_unlock_irqrestore(&ctx->wqh.lock, flags); +static __poll_t timerfd_poll_mask(struct file *file, __poll_t eventmask) +{ + struct timerfd_ctx *ctx = file->private_data; - return events; + return ctx->ticks ? POLLIN : 0; } static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count, @@ -364,7 +363,8 @@ static long timerfd_ioctl(struct file *file, unsigned int cmd, unsigned long arg static const struct file_operations timerfd_fops = { .release = timerfd_release, - .poll = timerfd_poll, + .get_poll_head = timerfd_get_poll_head, + .poll_mask = timerfd_poll_mask, .read = timerfd_read, .llseek = noop_llseek, .show_fdinfo = timerfd_show, -- 2.14.2