From owner-freebsd-fs@FreeBSD.ORG Fri Jan 22 11:35:47 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 982BC1065693; Fri, 22 Jan 2010 11:35:47 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by mx1.freebsd.org (Postfix) with ESMTP id BFFAB8FC0A; Fri, 22 Jan 2010 11:35:46 +0000 (UTC) Received: by ewy26 with SMTP id 26so44723ewy.3 for ; Fri, 22 Jan 2010 03:35:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=u0GHiDwcnR0fmxC1Bco75XhJwbkbkgZmfBo044WOj8E=; b=PT2WMU4IDMY+Bp8Psd9M72mrelmRd4xSQduFlflMv9HSjvGwbGNYYF3/wh5K7+7fTK SOs741Vw+AuPWmGtEitM6ocOlIyavcif+/dD7RagRGrNYLinnFSuHaR/WD/ZyznuLjEg 38flYNYABjBNthVcL0mZh2aZ1GZgzYm8cHyvo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=QdxHbInNDTSxBDazaVQHIIK2WSqn/76Q4hfe4Vo3SWD4AFpw/y5WTETMmelCHmG1vw E9PEMiMmcatxgaLCngChYWuno+oEgZD8h0NV1rJZaxKakAvIOGfv21Wmu0UTftgs+Spx 04OZj+DeVJIT90haFPWQGbnjwJTmI74K59crQ= Received: by 10.213.111.15 with SMTP id q15mr2625730ebp.86.1264160145855; Fri, 22 Jan 2010 03:35:45 -0800 (PST) Received: from localhost (lan-78-157-90-54.vln.skynet.lt [78.157.90.54]) by mx.google.com with ESMTPS id 5sm2785209eyh.0.2010.01.22.03.35.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 22 Jan 2010 03:35:45 -0800 (PST) Date: Fri, 22 Jan 2010 13:35:42 +0200 From: Gleb Kurtsou To: Jaakko Heinonen Message-ID: <20100122113542.GA1662@tops> 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> <20100122072038.GA977@a91-153-117-195.elisa-laajakaista.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20100122072038.GA977@a91-153-117-195.elisa-laajakaista.fi> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-fs@FreeBSD.org Subject: Re: 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 11:35:47 -0000 On (22/01/2010 09:20), Jaakko Heinonen wrote: > > 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"). Yes, that's why I removed it in the first place. I was using INT_MAX, but UINT64_MAX would be even better. I like the patch. Thanks, Gleb. > --- > > 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