From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Akinobu Mita" Subject: Re: [PATCH 4/5] shmem: use call_once() Date: Tue, 11 Mar 2008 21:29:11 +0900 Message-ID: <961aa3350803110529o61fe42e8q27ab10e0cb8f9bb6@mail.gmail.com> References: <20080310145704.GA6396@APFDCB5C> <20080310150026.GA6407@APFDCB5C> <20080310150148.GB6407@APFDCB5C> <20080310150308.GC6407@APFDCB5C> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org To: "Hugh Dickins" Return-path: Received: from py-out-1112.google.com ([64.233.166.178]:64603 "EHLO py-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752473AbYCKM3O (ORCPT ); Tue, 11 Mar 2008 08:29:14 -0400 Received: by py-out-1112.google.com with SMTP id u52so3539091pyb.10 for ; Tue, 11 Mar 2008 05:29:14 -0700 (PDT) In-Reply-To: Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 2008/3/11, Hugh Dickins : > On Tue, 11 Mar 2008, Akinobu Mita wrote: > > This patch defers mounting tmpfs till shmem_file_setup() is > > called first time by using call_once(). > > > Please explain why we might need this patch: is something changing > elsewhere? Or are you misled by that "module_init(init_tmpfs)" > into thinking that mm/shmem.c is sometimes built modular? > If no processes call shmem_file_setup() (via shm_get(2)), it is unnecessary to do vfs_kern_mount(&tmpfs_fs_type, ...) unconditionary in boot-time. So I thought it is suitable example to demonstrate how to use "call_once()" in this patch set.