From patchwork Thu Dec 1 07:00:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyungmin Park X-Patchwork-Id: 128648 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 69C87B6F68 for ; Thu, 1 Dec 2011 18:00:46 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751096Ab1LAHAp (ORCPT ); Thu, 1 Dec 2011 02:00:45 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:45422 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750926Ab1LAHAo (ORCPT ); Thu, 1 Dec 2011 02:00:44 -0500 Received: from epcpsbgm1.samsung.com (mailout3.samsung.com [203.254.224.33]) by mailout3.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LVI004QAJH4N9B0@mailout3.samsung.com>; Thu, 01 Dec 2011 16:00:43 +0900 (KST) X-AuditID: cbfee61a-b7b62ae0000030b0-1d-4ed7261bb806 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id C5.DF.12464.B1627DE4; Thu, 01 Dec 2011 16:00:43 +0900 (KST) Received: from july ([165.213.219.175]) by mmp1.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTPA id <0LVI00ITQJH5WCF0@mmp1.samsung.com>; Thu, 01 Dec 2011 16:00:43 +0900 (KST) Received: by july (sSMTP sendmail emulation); Thu, 01 Dec 2011 16:00:52 +0900 Date: Thu, 01 Dec 2011 16:00:52 +0900 From: Kyungmin Park To: tytso@mit.edu, tm@tao.ma Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Set the initial TRIM information as TRIMMED Message-id: <20111201070052.GA29708@july> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: AAAAAA== Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Kyungmin Park Now trim information doesn't stored at disk so every boot time. it's cleared. and do the trim all disk groups. But assume that it's already trimmed at previous time so don't need to trim it again. So set the intial state as trimmed. Signed-off-by: Kyungmin Park --- -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index e2d8be8..97ef342 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -1098,6 +1098,12 @@ int ext4_mb_init_group(struct super_block *sb, ext4_group_t group) goto err; } mark_page_accessed(page); + + /* + * TRIM information is not stored at disk so set the initial + * state as trimmed. Since previous time it's already trimmed all + */ + EXT4_MB_GRP_SET_TRIMMED(this_grp); err: ext4_mb_put_buddy_page_lock(&e4b); return ret;