Received: by 10.223.148.5 with SMTP id 5csp6271046wrq; Wed, 17 Jan 2018 11:31:48 -0800 (PST) X-Google-Smtp-Source: ACJfBosInnQ12/LLt0J1R5inSLSylTOCVnYqJj3hkZwfqKnCxjz10Sj6BzDoU4Y1FF51YSVHYzod X-Received: by 10.99.1.151 with SMTP id 145mr26018734pgb.229.1516217507997; Wed, 17 Jan 2018 11:31:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516217507; cv=none; d=google.com; s=arc-20160816; b=x5LkBjxnBXZPbNIHwiuMWyd3AsBgTDXoQSTUvT5+XE2Ldx761Ki8OJ83H/ql2v89xT uJC0VuKbCrQzI1Zxr04nzHuRkJTu6OsCt2QKvULoFk92wOO0+yct5XucLFDYLPvwe+3X sUabYaBifzlJLRPWxqsi8InKqIIA18kA+1q9mCOlCWPP3iGJEYC4yvqyZsO65LqsD2dw 4z9mOMfjaFFu4HcApvUxP0E+VQw7g96qAR2f+xhbmjcohSPCq3qGi71vDxm8/vCexHj/ Ang8dJntp83TaifvDBLSwSu1pDwHpgZNOSp9/OZm2urriheC/QYoOpvQuHReb6oqNLhz ECxg== 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=CcCgatswMQj1Ex1sOnNMZpMZXlD6nNnmoTI0utEzYn78eV+t65wlxDFPDPA6yTmE4l IpxXRgBXRv840HKDJR6rWNqM3yFsrx42ftzvxnhPVMaWbSTv+QC6drdxpeka9bzxgVoQ BIyjmqB5hGMc0Ihk5iNiX0wTjHLXcd6ftEVNEU0lF/RF7B6lK8hU0R56ncIdVO91pZwY EorkSrLiMZJDy2PP/GebTAT/MP70WNm6S9daDkImE/j6qBqaWaA46VawR8th4udgbn95 TaPGLmx798qZ+CI6WDdeAGZ9KaqRKzsC3CAK4tfXG4cO/nb7hMbNwJzF0x9+QFJ8KkMQ 3JdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=FTDUtaUE; 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 1si5012160plp.678.2018.01.17.11.31.34; Wed, 17 Jan 2018 11:31:47 -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=FTDUtaUE; 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 S1753686AbeAQTal (ORCPT + 99 others); Wed, 17 Jan 2018 14:30:41 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:34533 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753245AbeAQT3v (ORCPT ); Wed, 17 Jan 2018 14:29:51 -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=FTDUtaUEUpOxRibyhRuC5+Zd+ GaQmdPpTgW1xVOTHYIiYx0mh/Gxb6UcyqfjUfioqeL6tZUSl33Cg6YuMlzOIzGyKtbioQFCEGu5To FASE3XKxK+SvCzSIIL66nu6Am5QzfFW3fObXI5By8gpbWeL7IfVwjmd6zZrKIEmBKc5NMWFQ/aCj9 P1q/lbgDyJtpk2lzRfjUvFYF+deaZM2Q7N/7v0S/dRr9VcCbSHhHgTCng4HPMenuvSJOKFBa3BaVR oJMF4fV9LB49GwENW5jo9qwIOZ49Fej1iJP9iE0nqUKogmX/PwZ/jLWL8eGsKJ1zda8oA+6gayxdU xSTx9obyg==; Received: from 77.117.185.35.wireless.dyn.drei.com ([77.117.185.35] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1ebtPB-0003Sd-Jx; Wed, 17 Jan 2018 19:29:50 +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: Wed, 17 Jan 2018 20:27:41 +0100 Message-Id: <20180117192742.710-36-hch@lst.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180117192742.710-1-hch@lst.de> References: <20180117192742.710-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