Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp226865pxb; Thu, 12 Nov 2020 02:06:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzCcVwJqYTvGYhICTXBYmXXE9pw3fDrrO5eWcgLAVWqfXP/8NyOrw8e3TxS0QPz/UYhVOu+ X-Received: by 2002:a50:d942:: with SMTP id u2mr4371242edj.202.1605175603185; Thu, 12 Nov 2020 02:06:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605175603; cv=none; d=google.com; s=arc-20160816; b=SEvK1Xyh1jt4HeSaCbJNUMEcAHu9cPGKNQvIVPWfAAjnnR0Dtk+M40/Z1uxgAkNuRa Iwg5ZESYoCaouM+v1T4KHZPFFoWjWn+4MQozELLzNo4ZM2kjmMTm9QenVAXkPvf0q1aX e2iHnE4y+xy8sDvNmlL2XzN2QPHuP1GbDxQY45JgD9Cm3UQbVD2P6VrajTh0T59Q68pc SSAlGsAGCiJFqNxhzafWLwzXUsK/tmbmxJO9ydrRP1BCyzbyswzUhBYUBoJ4N/6kVTfW faXSF359uOPKsEy+IdUal4YBu5Er1FCB6sgzHg7uyClTfiKseF7JjcCKpNweQOOjHNCK KEMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=AQZyFP+icQ6Gn+nIuSyMic/jsZR6XqrBTW4Q4kxWbsc=; b=Hlb72iqfN9cFSObIhZkMZYUVXAe5mxxGinBzIEw1PrJ5hWH28007dcTiT0giDmrF1W cPiy1GNn0GYafX/G3zU340I538eSauGaJQEwgFsWpmC8HaVZfxvqeLQdLchepTVH8hRx bFyn956gmkm7Yuyp51sQdU6i5O6TvncDpVKnNu4/+ybiB/JWkOcf1DReNBcFYzgCP+GO 98qdPlfTqNfQbDGTnXEC2J6YnfHbOrSJq/SSQzd9XYvzMo0VAm8wzldQhmEtQpWv27G7 cAF02iLzzB7fRbu6JnsnMaztybeOBr4Ph1EjThJTpiqeZtGaMti2Kcjc6N9tlVHth30I RMIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ta+ZqYqN; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si3161053ejd.678.2020.11.12.02.06.19; Thu, 12 Nov 2020 02:06:43 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ta+ZqYqN; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727560AbgKLKDc (ORCPT + 99 others); Thu, 12 Nov 2020 05:03:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726061AbgKLKDc (ORCPT ); Thu, 12 Nov 2020 05:03:32 -0500 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36C75C0613D1; Thu, 12 Nov 2020 02:03:32 -0800 (PST) Received: by mail-ot1-x342.google.com with SMTP id n15so5019958otl.8; Thu, 12 Nov 2020 02:03:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AQZyFP+icQ6Gn+nIuSyMic/jsZR6XqrBTW4Q4kxWbsc=; b=ta+ZqYqNIy9QGI0x10rsJEncrpVQ1T2zSQKnOUL7XSKQ3ge+yq7y70/fHmgJ4ix1ek DD7qGiiv4+8NTvbCfXlfTKUEcUrYFOenButeYWUcClxi54CvqFfJXHdmtGqVp7P+8RvF pTDzp57IVEQDqeI8f6GiFCDuRzNVBMVaoV++VGtTjm8yM5TKNdVFq0kCPdLWAVVosuZ+ dxOmJmhltDVrEz6/h8Ui5Yj5sp9C7coAA/hrvU55xgDlqwFnzx9521SN1Oa8Za7oBRvK aLqczMJfeF0E/EHvHYjYHZHJn/038E+kdW42Shf1JyljgiyLs0SpHTsmDJb+pyT5VJR2 eDEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AQZyFP+icQ6Gn+nIuSyMic/jsZR6XqrBTW4Q4kxWbsc=; b=ouPchq5eBV6vzaWvy1Y5rxANt9sn5dnwrgVD3jIAy8HsdJR0gzgdbhtWVOrpZk6Sgd fEUMn0/9E17XnqhMFksTCyKrXf67L0cJ6K2LotfcWftkAxVPFIroVybcBCBdL5Ygztn4 rhKsEEenBN3N14YNkNDDKDathmi4rlS80vfczjP25nIK6XcxMNdqH/pHIHJ54RZULK+7 HUd+6XSNzTtDAhe4aJsX/m8VbpSq+9+tz+0gfiqB7tVX19vaWN3NQaCP+lqYz6tctKdX NaFMPUabW6vx99Xy4nR6PYtkRUDrml+cXJm2IHjs9DO41t1AB8IvFn3OKB1VukDb1tJn hYNg== X-Gm-Message-State: AOAM532hVN8VE+g4Pfyp3PEqz/Pg+R6pMeRzlGodRBJnsnq5P4CCEmcO 5sXzEycPOKNNSb6KOFb8xGrSY0NdHW3FrO9m58puGc4O X-Received: by 2002:a9d:12ab:: with SMTP id g40mr21957319otg.369.1605175411617; Thu, 12 Nov 2020 02:03:31 -0800 (PST) MIME-Version: 1.0 References: <20201110200411.GU3576660@ZenIV.linux.org.uk> <20201111230908.GC3576660@ZenIV.linux.org.uk> In-Reply-To: <20201111230908.GC3576660@ZenIV.linux.org.uk> From: yulei zhang Date: Thu, 12 Nov 2020 18:03:20 +0800 Message-ID: Subject: Re: [PATCH 01/35] fs: introduce dmemfs module To: Al Viro Cc: Andrew Morton , Naoya Horiguchi , Paolo Bonzini , linux-fsdevel , kvm , LKML , Xiao Guangrong , Wanpeng Li , Haiwei Li , Yulei Zhang , Xiao Guangrong Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 12, 2020 at 7:09 AM Al Viro wrote: > > 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. Thanks for the suggestion. will refactor the patches accordingly.