Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1281792rbb; Mon, 26 Feb 2024 04:52:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVBPnpWtVTDj5zXTbkINURJkDRhhJK8vFmiMHw1A9u9+zUrcNtgrV7225oYZn9PAXInT3FWGfNF/QvUggP8g1rbqnJRnCbP8XC2FHBR9g== X-Google-Smtp-Source: AGHT+IG54xb+JLT4DBmyirWYN/UxwOAhbvjd7SG55vWyznytkoysLyFIFMF6g3mg5lAo66gQ7D00 X-Received: by 2002:a17:906:dfcf:b0:a3f:1043:9078 with SMTP id jt15-20020a170906dfcf00b00a3f10439078mr4452731ejc.30.1708951940029; Mon, 26 Feb 2024 04:52:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708951940; cv=pass; d=google.com; s=arc-20160816; b=dGRsB93dIjqpMteA0RF9Yq2WrivBalCMipkzZ6fO1/lrz2JtIkvc0iQQNja2jd9tMP 6mc0dcLUFnMvHZDjZdOSk/PNNVsDIDe2a29ZwtzHcA+xvocqTMXRusrzCOEY+uqrfy2v ZUC0vCfD9sg2clo+Ia6uWH8QOIBE2IZGRfLQm0tkly0DvccVwh+qQQymlaj86hQ/W/Uy rC+jQr3vgEg3/6axW08XBDlaPuStWCRtm/m80v4+6cHFgeSEXtIWtw/J77J4sqhqD9hW aZeVHXq3ur5khrUM6K9Og0KOAXaNN8LtY4YaQugTFoO/DhimW5ixB3XRg6JmdUpA5Bjq 9zhA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date; bh=Xh06lop6aYfqdw78fgjhdlOEahX9cIZUy8Y+0WxoNDo=; fh=NxEgvf8Rw6A11ITJWFIYtOfb5rphg3RFyVjPJ/rcJm4=; b=KwdxGymYccy7VJYxaumLscjIV5+jVcZF6IeHHu4RRPlZyZES7nvMQ6DVIX3oQVkjP/ h3LbQlWRyf0bP5xrjmd1uw/yoIg5l3OG2vaY4qEWVI5lTjHzN48IahaPzUj3T0iZhPa4 m4+fL+XcWiiAe+4uwRyJJJMto1N/ygZAmpCY4p99x1yOlRxIYwldU2yFf+JmUl1lcge/ DV5m7f0EfxUaWZNy3+TrDlzLI5kDdtH9wP/H5MC9pqV2gknRCgjpVdFEIrUQB70lU8D9 98FgVCkAit4zHg6mWKcw1ykXl+ol1kv7bsm0fhRbJllSD5NknbRajfuOyh47Z7C+nS2e X6Aw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-81412-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81412-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id oy4-20020a170907104400b00a430aefba3bsi1571078ejb.523.2024.02.26.04.52.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 04:52:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81412-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-81412-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81412-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E63101F267F5 for ; Mon, 26 Feb 2024 12:51:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1FABA80029; Mon, 26 Feb 2024 12:51:44 +0000 (UTC) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A33507F7D0; Mon, 26 Feb 2024 12:51:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708951903; cv=none; b=cvH6b3rsHOT4J0uz7vaEBWwDH89lRhije050IMlwEWVcfdB+ZmYzaLXqy8162o0m9+NSHiLniu3LhUAi1s/ji/QafPFjc2t0CvJgK9aXvqwadnvD4wnMtKt71ayodfPcHdqHcXOZDUDyAx1l5ik8Hp4488ieHMb2znJlov84tCM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708951903; c=relaxed/simple; bh=WXZHOU0/VVsz2WZBsy4+DbitB3SDhWUUx6Cp0aYy9iI=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FnBUE0jFubCTuduXcddWtQQiBa1bSQdbseaNvehtsjKsUWJFEi+ZbZc8eougetnGpPe0h2pj5vOCQEVpKoGv9BKmNc3wYliUU1yBTWyZW5i5DoK2xUK60n+3MY2Ke6nKidHPIpdRbaflEtHpgAeycoGECS/oar9TNcNBw8Ws5JM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Tk0kb5lhdz689Hq; Mon, 26 Feb 2024 20:47:19 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 5A6C71400DB; Mon, 26 Feb 2024 20:51:38 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 26 Feb 2024 12:51:37 +0000 Date: Mon, 26 Feb 2024 12:51:36 +0000 From: Jonathan Cameron To: John Groves CC: John Groves , Jonathan Corbet , "Dan Williams" , Vishal Verma , Dave Jiang , "Alexander Viro" , Christian Brauner , "Jan Kara" , Matthew Wilcox , , , , , , , Dave Chinner , Christoph Hellwig , , Subject: Re: [RFC PATCH 09/20] famfs: Add super_operations Message-ID: <20240226125136.00002e64@Huawei.com> In-Reply-To: <537f836056c141ae093c42b9623d20de919083b1.1708709155.git.john@groves.net> References: <537f836056c141ae093c42b9623d20de919083b1.1708709155.git.john@groves.net> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml100002.china.huawei.com (7.191.160.241) To lhrpeml500005.china.huawei.com (7.191.163.240) On Fri, 23 Feb 2024 11:41:53 -0600 John Groves wrote: > Introduce the famfs superblock operations > > Signed-off-by: John Groves > --- > fs/famfs/famfs_inode.c | 72 ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 72 insertions(+) > create mode 100644 fs/famfs/famfs_inode.c > > diff --git a/fs/famfs/famfs_inode.c b/fs/famfs/famfs_inode.c > new file mode 100644 > index 000000000000..3329aff000d1 > --- /dev/null > +++ b/fs/famfs/famfs_inode.c > @@ -0,0 +1,72 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * famfs - dax file system for shared fabric-attached memory > + * > + * Copyright 2023-2024 Micron Technology, inc > + * > + * This file system, originally based on ramfs the dax support from xfs, > + * is intended to allow multiple host systems to mount a common file system > + * view of dax files that map to shared memory. > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include That's a lot of header for such a small patch.. I'm going to guess they aren't all used - bring them in as you need them - I hope you never need some of these! > + > +#include "famfs_internal.h" > + > +#define FAMFS_DEFAULT_MODE 0755 > + > +static const struct super_operations famfs_ops; > +static const struct inode_operations famfs_file_inode_operations; > +static const struct inode_operations famfs_dir_inode_operations; Why are these all up here? > + > +/********************************************************************************** > + * famfs super_operations > + * > + * TODO: implement a famfs_statfs() that shows size, free and available space, etc. > + */ > + > +/** > + * famfs_show_options() - Display the mount options in /proc/mounts. Run kernel doc script + fix all warnings. > + */ > +static int famfs_show_options( > + struct seq_file *m, > + struct dentry *root) Not that familiar with fs code, but this unusual kernel style. I'd go with something more common static int famfs_show_options(struct seq_file *m, struct dentry *root) > +{ > + struct famfs_fs_info *fsi = root->d_sb->s_fs_info; > + > + if (fsi->mount_opts.mode != FAMFS_DEFAULT_MODE) > + seq_printf(m, ",mode=%o", fsi->mount_opts.mode); > + > + return 0; > +} > + > +static const struct super_operations famfs_ops = { > + .statfs = simple_statfs, > + .drop_inode = generic_delete_inode, > + .show_options = famfs_show_options, > +}; > + > + One blank line probably fine. Add the rest of the stuff a module normally has, author etc in this patch. > +MODULE_LICENSE("GPL");