From patchwork Mon Feb 20 07:01:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tao Ma X-Patchwork-Id: 142124 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 0574EB6FA2 for ; Mon, 20 Feb 2012 18:09:28 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751432Ab2BTHI5 (ORCPT ); Mon, 20 Feb 2012 02:08:57 -0500 Received: from oproxy5-pub.bluehost.com ([67.222.38.55]:50556 "HELO oproxy5-pub.bluehost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750720Ab2BTHI4 (ORCPT ); Mon, 20 Feb 2012 02:08:56 -0500 Received: (qmail 32472 invoked by uid 0); 20 Feb 2012 07:08:56 -0000 Received: from unknown (HELO box585.bluehost.com) (66.147.242.185) by cpoproxy2.bluehost.com with SMTP; 20 Feb 2012 07:08:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tao.ma; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=0byBl47FxPgwidrbu0TZk6n6R8ApC2hBQXCeEyw6YLw=; b=jFONuOrbSZtryTeYfqwjuYC3j+lctlMszE2jBCnRMr4+jRt8wCC/UK3DHL6tMo9WDMaE+H1vCpc6SXiYHfUKS43FLAr7GQINoK/d3lRqcn4Xm9Y7ruAda5EjVO78qJqv; Received: from [182.92.247.2] (helo=tma-laptop1.taobao.ali.com) by box585.bluehost.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1RzNHC-0000US-42; Mon, 20 Feb 2012 00:03:10 -0700 From: Tao Ma To: linux-ext4@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org Subject: [PATCH V4 22/22] ext4: Enable ext4 inline support. Date: Mon, 20 Feb 2012 15:01:56 +0800 Message-Id: <1329721316-4955-22-git-send-email-tm@tao.ma> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1329721316-4955-1-git-send-email-tm@tao.ma> References: <4F41EF95.2000909@tao.ma> <1329721316-4955-1-git-send-email-tm@tao.ma> X-Identified-User: {1390:box585.bluehost.com:colyli:tao.ma} {sentby:smtp auth 182.92.247.2 authed with tm@tao.ma} Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Tao Ma Signed-off-by: Tao Ma --- fs/ext4/ext4.h | 3 ++- fs/ext4/ialloc.c | 4 ++++ 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 26024a3..9486cce 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -1452,7 +1452,8 @@ static inline void ext4_clear_state_flags(struct ext4_inode_info *ei) EXT4_FEATURE_INCOMPAT_EXTENTS| \ EXT4_FEATURE_INCOMPAT_64BIT| \ EXT4_FEATURE_INCOMPAT_FLEX_BG| \ - EXT4_FEATURE_INCOMPAT_MMP) + EXT4_FEATURE_INCOMPAT_MMP | \ + EXT4_FEATURE_INCOMPAT_INLINEDATA) #define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \ EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \ EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \ diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 25d8c97..2401934 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -901,6 +901,10 @@ got: ei->i_extra_isize = EXT4_SB(sb)->s_want_extra_isize; + ei->i_inline_off = 0; + if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_INLINEDATA)) + ext4_set_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA); + ret = inode; dquot_initialize(inode); err = dquot_alloc_inode(inode);