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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E14B2C433EF for ; Mon, 4 Apr 2022 14:03:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 42C6B6B0072; Mon, 4 Apr 2022 10:02:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3B3DD6B0074; Mon, 4 Apr 2022 10:02:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 22E496B0075; Mon, 4 Apr 2022 10:02:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 114536B0072 for ; Mon, 4 Apr 2022 10:02:54 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id BAC961216D3 for ; Mon, 4 Apr 2022 14:02:43 +0000 (UTC) X-FDA: 79319362206.09.1E7A8A6 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [142.44.231.140]) by imf08.hostedemail.com (Postfix) with ESMTP id 658F0160037 for ; Mon, 4 Apr 2022 14:02:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VwMhEknRMkAk/hwgaifPpZf3WDZJdkc/1FgL6FEHGlQ=; b=ROSopLXhlrp+f3UqkL7cYPHfAA XcF4IdHLWggOzVjtsvJhvLSA7wZ+gXuklrkYC35xu8G473oP11nN2PBcMOo9Ccnoqc8o3it2S3Vp7 OfhDUWQ78MBjQtgDKi8DM/staji/UuTgtP8D2c4yCWKTcTGF/oZJ4jp1ddsZ4YFs1eRhCDLR/9Aa3 YtsSXLuvsC5e2Q/stU9fPW+TSvOQwyfh8a2tHh42cxU3wU1bSSk88RdqBErlUPOp9bwhdESp561Wf sBXfwA0gcENjcRXXIxgFTqm56r2YvRQ2SZ28XKKgftvdsLGuYezdRvlJNNQdjSoIqBLdf5GAejNtU nyhXhJGw==; Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbNHy-002T3a-CW; Mon, 04 Apr 2022 14:02:38 +0000 Date: Mon, 4 Apr 2022 14:02:38 +0000 From: Al Viro To: Gabriel Krisman Bertazi Cc: Hugh Dickins , Andrew Morton , Amir Goldstein , kernel@collabora.com, Khazhismel Kumykov , Linux MM , linux-fsdevel Subject: Re: [PATCH RESEND 2/3] shmem: Introduce /sys/fs/tmpfs support Message-ID: References: <20220404134137.26284-1-krisman@collabora.com> <20220404134137.26284-3-krisman@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220404134137.26284-3-krisman@collabora.com> X-Rspam-User: X-Stat-Signature: yhw8gnd4f45hg5aarekft5dfopkk1ywm Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=linux.org.uk header.s=zeniv-20220401 header.b=ROSopLXh; spf=none (imf08.hostedemail.com: domain of viro@ftp.linux.org.uk has no SPF policy when checking 142.44.231.140) smtp.mailfrom=viro@ftp.linux.org.uk; dmarc=pass (policy=none) header.from=zeniv.linux.org.uk X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 658F0160037 X-HE-Tag: 1649080962-601418 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Apr 04, 2022 at 09:41:36AM -0400, Gabriel Krisman Bertazi wrote: > In order to expose tmpfs statistics on sysfs, add the boilerplate code > to create the /sys/fs/tmpfs structure. As suggested on a previous > review, this uses the minor as the volume directory in /sys/fs/. > > This takes care of not exposing SB_NOUSER mounts. I don't think we have > a usecase for showing them and, since they don't appear elsewhere, they > might be confusing to users. > > Signed-off-by: Gabriel Krisman Bertazi > +static void shmem_unregister_sysfs(struct super_block *sb) > +{ > + struct shmem_sb_info *sbinfo = SHMEM_SB(sb); > + > + kobject_del(&sbinfo->s_kobj); > + kobject_put(&sbinfo->s_kobj); > + wait_for_completion(&sbinfo->s_kobj_unregister); > +} If you embed kobject into something, you basically commit to having the lifetime rules maintained by that kobject...