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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA16CC433F5 for ; Mon, 4 Apr 2022 14:02:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376672AbiDDOEo (ORCPT ); Mon, 4 Apr 2022 10:04:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355979AbiDDOEl (ORCPT ); Mon, 4 Apr 2022 10:04:41 -0400 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BC2A3335E for ; Mon, 4 Apr 2022 07:02:42 -0700 (PDT) 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> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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...