From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH ver2] exofs: New truncate sequence Date: Tue, 1 Jun 2010 12:43:54 +0200 Message-ID: <20100601104354.GA2057@lst.de> References: <4C03ABCA.4050602@panasas.com> <4C04E0E2.4020103@panasas.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoph Hellwig , Nick Piggin , linux-fsdevel , open-osd , Al Viro To: Boaz Harrosh Return-path: Received: from verein.lst.de ([213.95.11.210]:58244 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753408Ab0FAKoW (ORCPT ); Tue, 1 Jun 2010 06:44:22 -0400 Content-Disposition: inline In-Reply-To: <4C04E0E2.4020103@panasas.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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. > 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.