From patchwork Wed Dec 7 00:16:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Dilger X-Patchwork-Id: 129859 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 668071007D5 for ; Wed, 7 Dec 2011 11:16:08 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754868Ab1LGAQF (ORCPT ); Tue, 6 Dec 2011 19:16:05 -0500 Received: from mail-gy0-f174.google.com ([209.85.160.174]:52020 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752896Ab1LGAQE (ORCPT ); Tue, 6 Dec 2011 19:16:04 -0500 Received: by ghbz2 with SMTP id z2so44785ghb.19 for ; Tue, 06 Dec 2011 16:16:03 -0800 (PST) Received: by 10.236.190.197 with SMTP id e45mr23511688yhn.101.1323216963749; Tue, 06 Dec 2011 16:16:03 -0800 (PST) Received: from cabot-wlan.adilger.int (S0106002191d9348c.cg.shawcable.net. [68.147.208.101]) by mx.google.com with ESMTPS id w68sm40077758yhe.14.2011.12.06.16.16.02 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 06 Dec 2011 16:16:03 -0800 (PST) Subject: [PATCH 02/02] ext2: reserve INCOMPAT_LARGEDIR feature flag Mime-Version: 1.0 (Apple Message framework v1084) From: Andreas Dilger In-Reply-To: Date: Tue, 6 Dec 2011 17:16:00 -0700 Cc: ext4 development , Liang Zhen , Tao Ma Message-Id: <512B3CCF-26FD-4DFB-BA22-2D6664E03BE5@whamcloud.com> References: To: Theodore Ts'o X-Mailer: Apple Mail (2.1084) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Reserve the EXT4_FEATURE_INCOMPAT_LARGEDIR feature flag for use by directories larger than 2GB in size, or with more than 2-level htree. This allows directories to exceed the following size limits: best case typical case worst case blocksize 8-byte name 64-byte name 255-byte name ========= ============ ============ ============= 1024 768k entries 168k entries 36k entries 4096 50M entries 10.9M entries 2.9M entries 16384 3.2B entries 713M entries 195M entries The 2GB size limit could be handled by an RO_COMPAT feature (as was done with LARGE_FILE) since it only affects the use of i_size_high, but the 2-level htree limit is hard coded into the kernel code by the use of frame->at[2] allowing only 2 levels of index. Since it is impossible that a directory larger than 2GB would be created without a 3-level htree for blocksize 4096, a single INCOMPAT flag is used for both of these cases. Signed-off-by: Liang Zhen Signed-off-by: Andreas Dilger --- lib/ext2fs/ext2_fs.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h index 6cf47f9..154356a 100644 --- a/lib/ext2fs/ext2_fs.h +++ b/lib/ext2fs/ext2_fs.h @@ -720,6 +720,7 @@ struct ext2_super_block { #define EXT4_FEATURE_INCOMPAT_EA_INODE 0x0400 #define EXT4_FEATURE_INCOMPAT_DIRDATA 0x1000 #define EXT4_FEATURE_INCOMPAT_INLINEDATA 0x2000 /* data in inode */ +#define EXT4_FEATURE_INCOMPAT_LARGEDIR 0x4000 /* >2GB or 3-lvl htree */ #define EXT2_FEATURE_COMPAT_SUPP 0 #define EXT2_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE| \