Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2683613pxb; Tue, 9 Mar 2021 08:25:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFrZCm+uA0O+kM5ysDfVhtM2YBxxc4FG5nWcqQZqtrqqu6x5oh6qAqJkcqkDXg/1FoSwc7 X-Received: by 2002:a05:6402:1103:: with SMTP id u3mr4946076edv.205.1615307109817; Tue, 09 Mar 2021 08:25:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615307109; cv=none; d=google.com; s=arc-20160816; b=tpJTWEMvxPR/un4dnE37oSvAOQcW9gtqQjmgwgVyEYj/kzO5L5gOFqFU3ogSHe+fT0 f/4WxJrojrZHmUZ8LdcYgTR/JeEdkczlGTQwSN2UJGOn+axbZ/OV5MNV2jCQQ+2KrBWG UiqAK5JjTHTRGGjx5VSaGPPeAWVn4nX63UiU+1T1Y19hGmjvdZw9lhEHiZAQqeTxEoUW 4vKYw4AmDCnsnbUQMN4pqs5HmYvdk6Q+HmfEKmxW37kQ9Vpj4SKLY+9tHdXH1V75NcCa eem2f5ei7Uu70johgR9s3+Uqk7Rn+34r2KnwgRPzwZfxC6PJLvUKx4z9Tw1Ht8FB07eN Vx3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=19LP5gRKwmwH1jc81ul4akn1QbWUor1+lZY/TUhT8Cc=; b=FaPW43yU5jbTwiNASa/WK9cn2psVqkYEF+VKvHOSYDhqZOJU/CdFUBwQDhC6kli1/v X50id541OdXWq0AnkwMpa7F+diGgOpHZ8HA/6TkXCaZAkzI+vjsqxy2HB8TFz7NI508I Il2KedaByPnDzzPcs8wRmU3XpyI/XF6opXw7VukRh14FYt9p17RVD28W3JuhuNsmP1rU sGRxCU30aFtlF+EVwlitf25tALnDw6SUFTmDich9TogQiMqWI4/5hJkKath3hMM+/7bU ipt/rKoiE0UHcoEFSdoVwXBxP1kt+7aEvMJ0zhU87d/0w6VQFOUhzJS07kHu8vW+BpZC QGBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XJb4Obr+; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id vr7si9239865ejb.392.2021.03.09.08.24.46; Tue, 09 Mar 2021 08:25:09 -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=@redhat.com header.s=mimecast20190719 header.b=XJb4Obr+; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229790AbhCIQXW (ORCPT + 99 others); Tue, 9 Mar 2021 11:23:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:27851 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230512AbhCIQXC (ORCPT ); Tue, 9 Mar 2021 11:23:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615306981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=19LP5gRKwmwH1jc81ul4akn1QbWUor1+lZY/TUhT8Cc=; b=XJb4Obr+FQUpaJjZu4O5DER5+ZOj0BXYJfIQ0XsQ8Zx3j1LEFjTvIdLu1oxZBCWbmPVXyw uQ+lxDUMC4QiqyRtgsVmGfIWTrRCb9no0hC2a8j98yWbOfXFrivsTIcebmZEEVqw/3QFx3 iNoJKChhqt6MsPd4W/Re6E0jK4FoU7Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-274-6dAmojhlMgOOkpbQO0364g-1; Tue, 09 Mar 2021 11:22:58 -0500 X-MC-Unique: 6dAmojhlMgOOkpbQO0364g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 411A310199A6; Tue, 9 Mar 2021 16:22:56 +0000 (UTC) Received: from [10.36.114.143] (ovpn-114-143.ams2.redhat.com [10.36.114.143]) by smtp.corp.redhat.com (Postfix) with ESMTP id ADE225C233; Tue, 9 Mar 2021 16:22:46 +0000 (UTC) Subject: Re: [PATCH 2/9] fs: add an argument-less alloc_anon_inode To: Christoph Hellwig , Al Viro Cc: Andrew Morton , Daniel Vetter , Nadav Amit , "VMware, Inc." , "Michael S. Tsirkin" , Minchan Kim , Nitin Gupta , Jason Gunthorpe , Alex Williamson , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org References: <20210309155348.974875-1-hch@lst.de> <20210309155348.974875-3-hch@lst.de> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Tue, 9 Mar 2021 17:22:45 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210309155348.974875-3-hch@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09.03.21 16:53, Christoph Hellwig wrote: > Add a new alloc_anon_inode helper that allocates an inode on > the anon_inode file system. > > Signed-off-by: Christoph Hellwig > --- > fs/anon_inodes.c | 15 +++++++++++++-- > include/linux/anon_inodes.h | 1 + > 2 files changed, 14 insertions(+), 2 deletions(-) > > diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c > index 4745fc37014332..b6a8ea71920bc3 100644 > --- a/fs/anon_inodes.c > +++ b/fs/anon_inodes.c > @@ -63,7 +63,7 @@ static struct inode *anon_inode_make_secure_inode( > const struct qstr qname = QSTR_INIT(name, strlen(name)); > int error; > > - inode = alloc_anon_inode_sb(anon_inode_mnt->mnt_sb); > + inode = alloc_anon_inode(); > if (IS_ERR(inode)) > return inode; > inode->i_flags &= ~S_PRIVATE; > @@ -225,13 +225,24 @@ int anon_inode_getfd_secure(const char *name, const struct file_operations *fops > } > EXPORT_SYMBOL_GPL(anon_inode_getfd_secure); > > +/** > + * alloc_anon_inode - create a new anonymous inode > + * > + * Create an inode on the anon_inode file system and return it. > + */ > +struct inode *alloc_anon_inode(void) > +{ > + return alloc_anon_inode_sb(anon_inode_mnt->mnt_sb); > +} > +EXPORT_SYMBOL_GPL(alloc_anon_inode); > + > static int __init anon_inode_init(void) > { > anon_inode_mnt = kern_mount(&anon_inode_fs_type); > if (IS_ERR(anon_inode_mnt)) > panic("anon_inode_init() kernel mount failed (%ld)\n", PTR_ERR(anon_inode_mnt)); > > - anon_inode_inode = alloc_anon_inode_sb(anon_inode_mnt->mnt_sb); > + anon_inode_inode = alloc_anon_inode(); > if (IS_ERR(anon_inode_inode)) > panic("anon_inode_init() inode allocation failed (%ld)\n", PTR_ERR(anon_inode_inode)); > > diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h > index 71881a2b6f7860..b5ae9a6eda9923 100644 > --- a/include/linux/anon_inodes.h > +++ b/include/linux/anon_inodes.h > @@ -21,6 +21,7 @@ int anon_inode_getfd_secure(const char *name, > const struct file_operations *fops, > void *priv, int flags, > const struct inode *context_inode); > +struct inode *alloc_anon_inode(void); > > #endif /* _LINUX_ANON_INODES_H */ > > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb