From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C00CAC56201 for ; Thu, 12 Nov 2020 01:31:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 774B32076E for ; Thu, 12 Nov 2020 01:31:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727888AbgKLBbr (ORCPT ); Wed, 11 Nov 2020 20:31:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727813AbgKKXJ2 (ORCPT ); Wed, 11 Nov 2020 18:09:28 -0500 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC1A7C0613D4; Wed, 11 Nov 2020 15:09:28 -0800 (PST) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kczEi-003t2b-3Z; Wed, 11 Nov 2020 23:09:08 +0000 Date: Wed, 11 Nov 2020 23:09:08 +0000 From: Al Viro To: yulei zhang Cc: Andrew Morton , Naoya Horiguchi , Paolo Bonzini , linux-fsdevel , kvm , LKML , Xiao Guangrong , Wanpeng Li , Haiwei Li , Yulei Zhang , Xiao Guangrong Subject: Re: [PATCH 01/35] fs: introduce dmemfs module Message-ID: <20201111230908.GC3576660@ZenIV.linux.org.uk> References: <20201110200411.GU3576660@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Wed, Nov 11, 2020 at 04:53:00PM +0800, yulei zhang wrote: > > ... same here, seeing that you only call that thing from the next two functions > > and you do *not* provide ->mknod() as a method (unsurprisingly - what would > > device nodes do there?) > > > > Thanks for pointing this out. we may need support the mknod method, otherwise > the dev is redundant and need to be removed. I'd suggest turning that into (static) __create_file(....) with static int dmemfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool excl) { return __create_file(dir, dentry, mode | S_IFREG); } static int dmemfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) { return __create_file(dir, dentry, mode | S_IFDIR); } (i.e. even inc_nlink() of parent folded into that). [snip] > Yes, we seperate the full implementation for dmemfs_file_mmap into > patch 05/35, it > will assign the interfaces to handle the page fault. It would be less confusing to move the introduction of ->mmap() to that patch, then.