From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Subject: Re: [patch 01/11] fs: new truncate helpers Date: Mon, 7 Sep 2009 09:33:30 +0200 Message-ID: <20090907073330.GD1875@wotan.suse.de> References: <20090820163504.131529718@suse.de> <20090820164050.401703779@suse.de> <4A94E663.90705@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , linux-fsdevel@vger.kernel.org, Christoph Hellwig To: Artem Bityutskiy Return-path: Received: from cantor2.suse.de ([195.135.220.15]:34997 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751417AbZIGHd2 (ORCPT ); Mon, 7 Sep 2009 03:33:28 -0400 Content-Disposition: inline In-Reply-To: <4A94E663.90705@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Aug 26, 2009 at 10:38:11AM +0300, Artem Bityutskiy wrote: > Hi, > > On 08/20/2009 07:35 PM, npiggin@suse.de wrote: > >+/** > >+ * inode_newsize_ok - may this inode be truncated to a given size > >+ * @inode: the inode to be truncated > >+ * @offset: the new size to assign to the inode > >+ * @Returns: 0 on success, -ve errno on failure > >+ * > >+ * inode_newsize_ok will check filesystem limits and ulimits to check > >that the > >+ * new inode size is within limits. inode_newsize_ok will also send > >SIGXFSZ > >+ * when necessary. Caller must not proceed with inode size change if > >failure is > >+ * returned. @inode must be a file (not directory), with appropriate > >+ * permissions to allow truncate (inode_newsize_ok does NOT check these > >+ * conditions). > >+ * > >+ * inode_newsize_ok must be called with i_mutex held. > >+ */ > >+int inode_newsize_ok(struct inode *inode, loff_t offset) > >+{ > > Could you use 'const' for inode here? Sorry, I don't think I replied to you. Thanks for the suggestions, yes const wouldn't hurt I guess. I will be sending a couple of incremental updates to Andrew shortly so I'll include that.