Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp815278pxb; Wed, 11 Nov 2020 17:38:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxsDldiyckAT3REftlF0VEuar+C5Kc9ohlDlwN2A/alsWlG6qJ+Nd7CuvdFB8oX30c+ZAiG X-Received: by 2002:aa7:d888:: with SMTP id u8mr2718108edq.210.1605145087626; Wed, 11 Nov 2020 17:38:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605145087; cv=none; d=google.com; s=arc-20160816; b=uKxcFgDMitavxdNstTe9d2QA1uYgFU3dNl/NLrQo/Dgt9PELy4gOhG20Em1eit/dMH fKiz8AlkX+9HoZnkjTD4e9GRRWrKXNYHKt7cVBJydZ37TfmYt4AnTULjCz1DJSAJ9RUF Im1nnl58SoqSeeT6PZGZTTDq2UJgWAF6QdnAZD2Ojxq1S/io1NnNJX4tXq/SKEJDx5d0 xxjSFxGh30SZqSFzU7Cs7DyIIMRibATXHQNOiuE/aImvv8PRzTGKPP47/Og6v1y9POC1 egl1XwW7GAkccmuToNvn11hruVBw3gPxl1ZWV/ZMKwIol83W717scO1sli83QVJOT7b5 KPSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Qc+pQFCgQMjZ5FIKl5MRoERArInQGHNgj6aYa8HhkfA=; b=daMAo5GHlmFwj3SwnFJsSvoOMF+0eWvT5Y1NsQ/OEJFhuq9AQoBqZ8l+dZq19fW6ty Qfcv9CThag9xtsjmAgkSLzIEG1QHcl7CQm05N5EDIlAgk1T/UvyiKAUPy33hS7GHy0qe n1jcVOPGbGFGDIEqLvkQSbqKeVXJXunSkyxFZ5E6u7GLOHCSyyLTY6KXva5CO3qA7437 p5H7X7sf/XRw0AD/3e6JDOcS4bafZj0OqGA4NDfA1A11m/f/L0PH4T2WGip/RJSxtg9T 43moaPL0IIvU+6Mjm0nVbf4s0AECJ+3Znl/cva1YJyUG2S2RqFIRMb1g0LopRJiXxK84 l6zg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v24si2939891edq.0.2020.11.11.17.37.44; Wed, 11 Nov 2020 17:38:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728816AbgKLBfC (ORCPT + 99 others); Wed, 11 Nov 2020 20:35:02 -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: linux-kernel@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.