From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boaz Harrosh Subject: Re: [PATCH ver2] exofs: New truncate sequence Date: Tue, 01 Jun 2010 13:59:53 +0300 Message-ID: <4C04E829.6070609@panasas.com> References: <4C03ABCA.4050602@panasas.com> <4C04E0E2.4020103@panasas.com> <20100601104354.GA2057@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Nick Piggin , linux-fsdevel , open-osd , Al Viro To: Christoph Hellwig Return-path: Received: from daytona.panasas.com ([67.152.220.89]:21785 "EHLO daytona.int.panasas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754934Ab0FAK74 (ORCPT ); Tue, 1 Jun 2010 06:59:56 -0400 In-Reply-To: <20100601104354.GA2057@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 06/01/2010 01:43 PM, Christoph Hellwig wrote: > On Tue, Jun 01, 2010 at 01:28:50PM +0300, Boaz Harrosh wrote: >> + if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || >> + S_ISLNK(inode->i_mode))) >> + return -EINVAL; >> if (exofs_inode_is_fast_symlink(inode)) >> - return; >> + return -EINVAL; > > do_sys_truncate already makes sure ATTR_SIZE changes only happen on > ISREG files. > I copy/pasted this from ext2_setsize. (Would you remove it from there as well?) >> if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) >> - return; > > Same for these - IS_APPEND directly and IS_IMMUTABLE via > inode_permission(). > >> + oldsize = inode->i_size; >> + i_size_write(inode, newsize); >> + truncate_pagecache(inode, oldsize, newsize); > > At this point you can probably just inline this in exofs_setattr. > Especially as the lines above will be replaced with a single > function call in my next batch. > OK, I'm re-spinning minus these and inlined. I'll want to re-run a few tests just to make sure. Thanks Boaz