From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [patch 3/5] tmpfs: convert to use the new truncate convention Date: Wed, 9 Dec 2009 15:45:59 +0100 Message-ID: <20091209144559.GC7044@quack.suse.cz> References: <20091208083832.GA19823@wotan.suse.de> <20091208084109.GC19823@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Al Viro , Christoph Hellwig , Jan Kara , linux-fsdevel@vger.kernel.org To: Nick Piggin Return-path: Received: from cantor.suse.de ([195.135.220.2]:59031 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756163AbZLIQKz (ORCPT ); Wed, 9 Dec 2009 11:10:55 -0500 Content-Disposition: inline In-Reply-To: <20091208084109.GC19823@wotan.suse.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue 08-12-09 09:41:09, Nick Piggin wrote: > Cc: Christoph Hellwig > Acked-by: Hugh Dickins > Signed-off-by: Nick Piggin ... > @@ -821,11 +824,11 @@ static void shmem_delete_inode(struct in > { > struct shmem_inode_info *info = SHMEM_I(inode); > > - if (inode->i_op->truncate == shmem_truncate) { > + if (inode->i_mapping->a_ops == &shmem_aops) { How about symlinks here? Originally we've truncated inode for them as well... BTW the check is really strange. Shouldn't we rather make it something like S_ISLNK || S_ISREG? > truncate_inode_pages(inode->i_mapping, 0); > shmem_unacct_size(info->flags, inode->i_size); > inode->i_size = 0; > - shmem_truncate(inode); > + shmem_truncate_range(inode, 0, (loff_t)-1); > if (!list_empty(&info->swaplist)) { > mutex_lock(&shmem_swaplist_mutex); > list_del_init(&info->swaplist); Honza -- Jan Kara SUSE Labs, CR