From owner-freebsd-fs@FreeBSD.ORG Fri Jan 22 07:20:42 2010 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A201E106566B for ; Fri, 22 Jan 2010 07:20:42 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi [195.197.172.115]) by mx1.freebsd.org (Postfix) with ESMTP id 620C08FC14 for ; Fri, 22 Jan 2010 07:20:42 +0000 (UTC) Received: from a91-153-117-195.elisa-laajakaista.fi (a91-153-117-195.elisa-laajakaista.fi [91.153.117.195]) by gw01.mail.saunalahti.fi (Postfix) with SMTP id 451B31513FA; Fri, 22 Jan 2010 09:20:38 +0200 (EET) Date: Fri, 22 Jan 2010 09:20:38 +0200 From: Jaakko Heinonen To: freebsd-fs@FreeBSD.org Message-ID: <20100122072038.GA977@a91-153-117-195.elisa-laajakaista.fi> References: <201001080757.o087vhrr009799@svn.freebsd.org> <20100109051536.R57595@delplex.bde.org> <20100108214821.GA985@a91-153-117-195.elisa-laajakaista.fi> <20100110181132.D1354@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100110181132.D1354@besplex.bde.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: tmpfs maximum file size limit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 07:20:42 -0000 Unless I am missing something tmpfs maximum file size limit useless because it is set to the total amount of memory in the system including swap ((cnt.v_page_count + get_swpgtotal()) * PAGE_SIZE). In addition, it's wrong because it's set at mount time and swap space may be added or removed after the mount. So I propose adding a new mount mount option to make the limit configurable at mount time and by default setting it to UINT64_MAX ("no limit"). --- Add "maxfilesize" mount option for tmpfs to allow specifying the maximum file size limit. Default is UINT64_MAX when the option is not specified. Use tmpfs_mem_info() rather than get_swpgtotal() in tmpfs_mount() to check if there is enough memory available. Remove now unused get_swpgtotal(). The patch: http://people.freebsd.org/~jh/patches/tmpfs-maxfilesize.diff -- Jaakko