Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4388207rwd; Tue, 23 May 2023 07:08:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4vKnuWxY1yxfOZOasTADvXrHhIuWrI6JMSMcIPnivGtcXrWjbjNKGph29Kou6afaigCABF X-Received: by 2002:a05:6a20:a127:b0:101:b080:e763 with SMTP id q39-20020a056a20a12700b00101b080e763mr14351786pzk.31.1684850933471; Tue, 23 May 2023 07:08:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684850933; cv=none; d=google.com; s=arc-20160816; b=etTs7RnH4w2+8ggQBdB0iDhPSRkXNtgR9/tYj6jwBcNoaC3TJZhNobN2a98PWxymZ1 oDP88C7oYTQCBaBx7c7ijIVou0Vf7HzHT6as4sx9pqsVybK6hBLRTwfaXP47x6quRupG 16m5qAxMblijYW2hVZwWsN0m1dxbRgzjpI+4Kxsu3cTumZ8NAJ1xkrM/APbvyp28ExGQ WJp+K0EnbG27zylsarMz4sj9DBsM0vPxaKKIc62ZbXNP7M9jfFb2iSaNuWiHE35v/L0V 1Xfuz7gruJ2+2CusdJ9WbNzEZZGHvLiIQBf6GK805p8Y3x674hMfbBvOr/u1NNjh4ro6 T7og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=y2wJywGMXAg5Rl4zmKdJvnE9yWsAlKB6eSvxlDxCSBo=; b=kov0tfJKQYH4baXedoDkdJuuLMj5MEMpmvnriY0FGe4N41iPe1F/szBc3VSfZYj+Ie hkBex8QT+Gvr9+idXrorGTtXrVtow9ICcqiIt13WPaJ7v9oPZesPx4B3NYmR+gfDP22v DJmmReIHHBzpobpfJBm76MwPTjiD7gQKfGjTpUYVy10cCN/PtZJEWXEE+sdTgxE08D7J 0uGUgcvwkAs+jyR97JDEMsjnJTZFd9WcFGcO/E93oj4uoEZkwoYJQPaI2HN3WnOUPF60 hvxE4qox9RJkbJaxcQpBcy85WXjDTvbZrDCL9hs8+9PL0xbUhCuLbb71jU9C7ojW+SDA Iq0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=IxctZ5iT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m13-20020a63710d000000b0053ef547263csi782796pgc.398.2023.05.23.07.08.31; Tue, 23 May 2023 07:08:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=IxctZ5iT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234243AbjEWN5w (ORCPT + 99 others); Tue, 23 May 2023 09:57:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237038AbjEWN5q (ORCPT ); Tue, 23 May 2023 09:57:46 -0400 X-Greylist: delayed 1374 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 23 May 2023 06:57:11 PDT Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FCB3E5B for ; Tue, 23 May 2023 06:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=y2wJywGMXAg5Rl4zmKdJvnE9yWsAlKB6eSvxlDxCSBo=; b=IxctZ5iTliTKUn52gnBzfNMZRZ +qy6wO6boaePW4GOeZ1YyLHlH+4zFx+t1fHBvVrq1oTBMdBwSW7vdczXMaq2Ngiq9pr4qQIUYbCfv 1qKND1pQDz9xGUfTAF0VGa321Ochw8r45iBUVHIFuPCPLksIsqxHVVjYPgXtNhbCAz+C3/vEGE74w KoPr2OVptIkezVncRKsSUGSW3Cb8AFfJQjIlg1KeYWwRYFH6PiGcFwRhhbM3XB7CRqDGqx7AQkS2E rbTSQ0JVXqHoNbhl0ymljVXal7v44hcOSJtWNEGnhDP3Fy1rKUheEp8pN7fTqORnzKqtJ0rQYZAWc lngK3EXg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1q1S7K-00AFpO-ND; Tue, 23 May 2023 13:31:58 +0000 Date: Tue, 23 May 2023 14:31:58 +0100 From: Matthew Wilcox To: aloktiagi Cc: viro@zeniv.linux.org.uk, brauner@kernel.org, David.Laight@aculab.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, keescook@chromium.org, hch@infradead.org, tycho@tycho.pizza Subject: Re: [RFC v6 1/2] epoll: Implement eventpoll_replace_file() Message-ID: References: <20230523065802.2253926-1-aloktiagi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230523065802.2253926-1-aloktiagi@gmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 23, 2023 at 06:58:01AM +0000, aloktiagi wrote: > +/* > + * This is called from eventpoll_replace() to replace a linked file in the epoll > + * interface with a new file received from another process. This is useful in > + * cases where a process is trying to install a new file for an existing one > + * that is linked in the epoll interface > + */ > +int eventpoll_replace_file(struct file *toreplace, struct file *file, int tfd) Functions do not control where they are called from. Just take that clause out: /* * Replace a linked file in the epoll interface with a new file received * from another process. This allows a process to * install a new file for an existing one that is linked in the epoll * interface */ But, erm, aren't those two sentences basically saying the same thing? So simplify again: /* * Replace a linked file in the epoll interface with a new file */ > diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h > index 3337745d81bd..2a6c8f52f272 100644 > --- a/include/linux/eventpoll.h > +++ b/include/linux/eventpoll.h > @@ -25,6 +25,14 @@ struct file *get_epoll_tfile_raw_ptr(struct file *file, int tfd, unsigned long t > /* Used to release the epoll bits inside the "struct file" */ > void eventpoll_release_file(struct file *file); > > +/* > + * This is called from fs/file.c:do_replace() to replace a linked file in the > + * epoll interface with a new file received from another process. This is useful > + * in cases where a process is trying to install a new file for an existing one > + * that is linked in the epoll interface > + */ > +int eventpoll_replace_file(struct file *toreplace, struct file *file, int tfd); No need to repeat the comment again. Just delete it here.